nodejs / node-eps

Node.js Enhancement Proposals for discussion on future API additions/changes to Node core
443 stars 66 forks source link

002 - Would appreciate more detail on HTTP/PUSH issue #30

Closed wycats closed 7 years ago

wycats commented 8 years ago

In the section referring to the package.json style of solution, this issue is raised:

HTTP/2 PUSH solutions would also need this and would be affected

I would appreciate more information on what issue this is referring to. I'd be happy to write a PR expanding on the issue once I understand it. :smile:

trevnorris commented 8 years ago

/cc @bmeck have a description of what this means?

bmeck commented 8 years ago

When discussing the affect of Node making a choice for modules we end up discussing the whole ecosystem of JavaScript.

The point here is about how browsers/servers will interact in terms of interop. This encompasses 2 specifications: type=module from HTML and Loader. type=module has no plan or mechanism to integrate with non-ES modules. Loader is meant to provide hooks to integrate against non-ES modules, like consuming JSON, or creating client side transforms.

In order for package.json data to be synced to the browser for Loader, any server/technology tracking how node is handling ES/CJS module detection will need to have the package.json available to them. Systems are not always setup to handle separate files as meta data for a source text.

There have been mentions of loader manifests being sent down, but I have not seen package.json related to those discussions. This could also be a duplication of effort, but I would presume manifests would pre-compute all the values rather than filter upon lookup.