[loader] Add renderer ESM execution host and hybrid delegation #7

Open
opened 2026-06-02 08:21:13 +00:00 by steve · 0 comments
Owner

Source: Lapis plugin module loading plan, 2026-06-02.

Goal: make ESM the first-party renderer execution path while preserving CommonJS compatibility and explicit fallback behavior.

Scope:

  • Add RendererEsmPluginExecutionHost using PluginAssetServer and dependency policy checks.
  • Add HybridCommunityPluginExecutionHost to delegate between ESM, CommonJS, and sidecar hosts.
  • Use selectPluginRuntimeEntry() for format/host decisions.
  • Resolve supported ESM module export shapes without instantiating in the execution host.
  • Fall back to CommonJS only when fallbackPath is explicitly declared or the plugin is Obsidian-compatible.
  • Add diagnostics for module format, fallback used, asset URL mode, and ESM import failures.

Acceptance:

  • esm-basic loads in web and Electron renderer.
  • hybrid-esm-with-cjs-fallback falls back only when declared.
  • Obsidian-only plugins continue through CommonJS.
Source: Lapis plugin module loading plan, 2026-06-02. Goal: make ESM the first-party renderer execution path while preserving CommonJS compatibility and explicit fallback behavior. Scope: - Add RendererEsmPluginExecutionHost using PluginAssetServer and dependency policy checks. - Add HybridCommunityPluginExecutionHost to delegate between ESM, CommonJS, and sidecar hosts. - Use selectPluginRuntimeEntry() for format/host decisions. - Resolve supported ESM module export shapes without instantiating in the execution host. - Fall back to CommonJS only when fallbackPath is explicitly declared or the plugin is Obsidian-compatible. - Add diagnostics for module format, fallback used, asset URL mode, and ESM import failures. Acceptance: - esm-basic loads in web and Electron renderer. - hybrid-esm-with-cjs-fallback falls back only when declared. - Obsidian-only plugins continue through CommonJS.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/plugin-registry#7
No description provided.