Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensibility? #9

Closed
matthew-dean opened this issue Mar 15, 2018 · 3 comments
Closed

Extensibility? #9

matthew-dean opened this issue Mar 15, 2018 · 3 comments

Comments

@matthew-dean
Copy link

Are there any ideas around building in natively extensibility the way that Webpack builds into imports? Meaning: could there be a way in which a named map (or a matched regex) returns not a path but can point to a function that returns a resource? It would break the JSON format but IMO using JSON is limiting. It should probably be something more imperative like the way Custom Elements are registered, and could then support scenarios like returning JS imports from, say, import styles from "styles.css" or to provide other extensibility.

@justinfagnani
Copy link
Collaborator

Breaking the declarative format would be very bad, IMO. This format will need to be written and read by a number of tools in different languages. IDEs will need to read it to find imports and offer intellisense, etc. Web servers will need to read it to do server push. Package managers and build systems like Bazel and Buck will need to write it. Not all of these can easily or performantly execute JavaScript functions.

@matthewp
Copy link

@domenic
Copy link
Collaborator

domenic commented Mar 15, 2018

Yeah, this is covered in the readme :). It's not really a feasible direction for running in web browsers.

Additionally, this proposal is very strict on restricting itself to name resolution, and not any kind of source transformation. I think there could still be future ways to register custom Content-Type processors/source transformers, but it wouldn't be part of this proposal, and would have a lot of issues of its own to work out.

So, let's close this.

@domenic domenic closed this as completed Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants