it's implied in some of the documentation that godotjs aims to support npm dependencies. would it make more sense to investigate supporting import maps instead? they're supported by all major browsers and deno. node has implemented package maps which are very roughly similar to import maps.
presumably, the user would define some json file which maps import names to paths that resolve to javascript modules. this would hopefully alleviate a little of the headache of runtime variance in module imports. if a developer wants to use NPM, they can just write their paths to resolve modules from node_modules.
obviously this is a non-trivial suggestion. there are still outstanding issues
- is the project and all its dependencies bundled as one file?
- commonjs? esm? some secret third thing?
i'd be happy to look eventually creating a PR for it but i wanted to see if there's any interest in this.
it's implied in some of the documentation that godotjs aims to support npm dependencies. would it make more sense to investigate supporting import maps instead? they're supported by all major browsers and deno. node has implemented package maps which are very roughly similar to import maps.
presumably, the user would define some json file which maps import names to paths that resolve to javascript modules. this would hopefully alleviate a little of the headache of runtime variance in module imports. if a developer wants to use NPM, they can just write their paths to resolve modules from node_modules.
obviously this is a non-trivial suggestion. there are still outstanding issues
i'd be happy to look eventually creating a PR for it but i wanted to see if there's any interest in this.