Skip to content

docs: add module customization hooks reference page#3099

Open
bartlomieju wants to merge 1 commit intomainfrom
docs/module-customization-hooks
Open

docs: add module customization hooks reference page#3099
bartlomieju wants to merge 1 commit intomainfrom
docs/module-customization-hooks

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Adds a new reference page documenting module.register() and module.registerHooks() APIs
  • Covers resolve/load hooks, hook chaining (LIFO), deregistration, passing data via initialize()
  • Includes practical examples: virtual modules, custom transpilation, module aliasing, test mocking
  • Adds sidebar entry under Reference guides
  • Removes outdated "register is a non-functional stub" note from node:module compatibility status

These APIs are being implemented in denoland/deno#28985 and allow users to fully customize module resolution and loading, following the Node.js module customization hooks specification.

Test plan

  • Verify page renders correctly on the docs site
  • Verify sidebar link works
  • Verify node:module compatibility table no longer shows the stub warning

Document module.register() and module.registerHooks() APIs that allow
customizing module resolution and loading in Deno. These APIs follow the
Node.js module customization hooks specification and enable use cases like
virtual modules, custom transpilation, module aliasing, and test mocking.

Also removes the outdated "register is a non-functional stub" note from
the node:module compatibility description.
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

Successfully merging this pull request may close these issues.

1 participant