MDL-87922 [docs] Add guide for JavaScript import maps in Moodle#1529
Open
meirzamoodle wants to merge 1 commit intomoodle:mainfrom
Open
MDL-87922 [docs] Add guide for JavaScript import maps in Moodle#1529meirzamoodle wants to merge 1 commit intomoodle:mainfrom
meirzamoodle wants to merge 1 commit intomoodle:mainfrom
Conversation
Adds a new documentation page explaining how Moodle uses native browser import maps to resolve bare module specifiers (e.g. `react`, `@moodle/lms/`) to real URLs at runtime. The guide covers: - What an import map is and how the browser uses it - How Moodle builds and injects the import map via `page_requirements_manager` - The `core\output\requirements\import_map` class and its built-in specifiers (React, react-dom, jsx-runtime, and the Moodle design system) - How to register custom or plugin specifiers from a `pre_render` hook - The ESM serving endpoint and how it resolves external bundles vs component React builds - The HTTP caching strategy (immutable headers for versioned revisions, short-lived for `-1` development mode) - How to author a component React module and expose it through the map - How to override a built-in specifier (e.g. swap in a debug React build)
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new documentation page explaining how Moodle uses native browser import maps to resolve bare module specifiers (e.g.
react,@moodle/lms/) to real URLs at runtime.The guide covers:
page_requirements_managercore\output\requirements\import_mapclass and its built-in specifiers (React, react-dom, jsx-runtime, and the Moodle design system)pre_renderhook-1development mode)