Comments (2)
You can use glob-like patterns in export maps. It looks like the documentation says that in their glob syntax *
matches subpaths as well so in their example an export map like this:
"exports": {
"./features/*.js": "./src/features/*.js"
},
would allow importing a file like this:
import featureY from 'es-module-package/features/y/y.js';
main
is standardized in node, but not for importing of esm files from esm files (that was always nonstandard and only implemented by bundlers).
module
, jsnext:main
, es2015
, and es2017
are all nonstandard, just implemented by some bundlers and tools.
I think we should stick to export maps and add the globs as needed.
from cloudfour.com-patterns.
I dug into this a bit, but I'm putting it back because it requires a bit more discussion (and, frankly, a check-in with @calebeby about the right path forward).
My (admittedly shallow) understanding is that exports
is the new standard, aiming to replace main
and module
, and has the capability of conditional exports. However, it also introduces the new side effect that @tylersticka mentioned.
My gut says the right answer is to remove exports
in favor of our main
and module
lines, unless exports
is giving us some advantage or feature that I'm missing.
A quick survey of how some other pattern libraries handle this:
- Bootstrap has
main
andmodule
- Material Components just uses
main
- Ionic has
main
andmodule
as well ases2015
,es2017
, andjsnext:main
- ZenDesk uses
main
andmodule
- Primer just uses
main
from cloudfour.com-patterns.
Related Issues (20)
- Adjust `o-deck` column minimum width based on use cases that shipped HOT 2
- Comment component docs in Storybook cause the browser to hang HOT 8
- Image block captions should be able to extend past the width of the image HOT 3
- Add ability to limit video width HOT 3
- Tables in comments are unstyled
- Allow Group block to use o-rhythm class
- [Contact Page] Make WordPress font size `big` utility responsive
- [Contact Page] Download icon
- [Contact Page] Add `c-input` modifier for more padding HOT 1
- Create Highlight theme in preparation for server-side rendering HOT 4
- Explore updates to our fluid type calculations for simplicity and accessibility
- Explore alternate button pointer effects
- Media-text block not handling most common use case very well HOT 1
- Embed block contents do not fill their container
- I would love a "Side Note" block
- Radio component
- Quote citation styles intended for WordPress blocks are leaking out to all blockquotes
- Inline code color has too little contrast against lightest gray
- Should we disable the CSSNano calc optimization? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudfour.com-patterns.