godotjs / godotjs/GodotJS

Suggestion: Import maps

Open
#233 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
765
Forks
46
PR merge metrics
No merged PRs in 30d

Description

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](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap) instead? they're supported by all major browsers and deno. node has implemented [package maps](https://nodejs.org/api/packages.html#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.

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reviewing GodotJS's module-loading and runtime architecture, then resolve the listed bundling and CommonJS/ESM questions. Done means an agreed scope and implementation plan for import-map support.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, javascript, node.js
Domain
developer-experience, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.