Comments (8)
@ljharb the thing is, it is very hard to ask Web Assembly developers to very nicely get LLVM and WASI to change the default conventions to support such a thing!
The alternative may be not being able to import WASI using the ESM integration...
from modules.
The alternative seems better; by removing the #
prefix, it expands it from "internal imports" to "package-scoped overrides", which is a very very large can of worms to open.
from modules.
Actually package name self-resolution could provide a route here too --- have a subfolder with a package.json "name" field equal to "wasi_snapshot_preview1" which then has a main pointing to the local wasi instance.
from modules.
Letting #
naturally become best practice sounds ok to me. We can obviously do more to communicate this over time.
IMO this relaxation would harm that adoption story because it makes it less obvious as to whether a package is following these good conventions.
from modules.
Thanks @ljharb @robpalme, helps to know. I have started the conversations with some Wasm folks to try and encourage having LLVM emit "#env" / "#wasi_snapshot_preview1" etc style specifiers. I am not even slightly hopeful I will make any progress in convincing anyone here though :)
Alternatives are to have LLVM / toolchain permit alternative names for these, rebuild Wasm when publishing it into the JS ecosystem or to have the JS esm integration return uninstantiated modules for a more flexible instantiation process. Will follow up appropriately.
from modules.
from modules.
Just thinking about another use case here - there is another argument that disabling this restriction could enable self-contained monorepos. I wonder if anyone else has considered this use case too @ljharb @robpalme?
from modules.
What would it enable that they can't do now by using #
-prefixed paths throughout the monorepo?
iow, many monorepos make it explicit and clear when a specifier is "inside the monorepo" by prefixing it like @/blah
or ~/blah
, etc, and transforming those specifiers to relative paths. In this case, you could do the same with #blah
at the root, no?
from modules.
Related Issues (20)
- Mocking use cases HOT 13
- Enabling import meta resolve by default? HOT 16
- Node.js Modules Team Meeting 2020-09-09
- Node.js Modules Team Meeting 2020-09-23 HOT 1
- Document node: scheme HOT 4
- Clarification for bundlers re "import" / "require" matching HOT 7
- Node.js Modules Team Meeting 2020-10-07 HOT 3
- File URL normalization changes HOT 1
- s/master/main HOT 3
- Node.js Modules Team Meeting 2020-10-21 HOT 4
- Experimental Status HOT 18
- Node.js Modules Team Meeting 2020-11-04
- Archiving modules repo and stopping team meetings HOT 1
- Use existing context for SourceTextModule evaluation? HOT 2
- Node.js Modules Team Meeting 2020-11-18
- import local files fails while import() succeeds HOT 5
- Proposal: ESM should not export PromiseLike instance HOT 5
- `import.meta.url` is `undefined` inside module file. HOT 3
- Extensionless files should allow --input-type (or work) HOT 14
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 modules.