GithubHelp home page GithubHelp logo

Comments (8)

guybedford avatar guybedford commented on September 22, 2024 2

@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.

ljharb avatar ljharb commented on September 22, 2024 1

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.

guybedford avatar guybedford commented on September 22, 2024 1

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.

robpalme avatar robpalme commented on September 22, 2024 1

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.

guybedford avatar guybedford commented on September 22, 2024 1

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.

guybedford avatar guybedford commented on September 22, 2024 1

from modules.

guybedford avatar guybedford commented on September 22, 2024

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.

ljharb avatar ljharb commented on September 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.