[loader] Add Web/PWA plugin asset server #217
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#217
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Installed plugin files stored through vault adapters are not naturally URL-addressable in the browser, but dynamic
import()requires module URLs for ESM plugins.Goal
Define and implement the Web/PWA plugin asset serving path needed to import verified installed ESM plugin files from versioned same-origin URLs.
Scope
PluginAssetServerinterface./__lapis/plugins/[vault-id]/[plugin-id]/[version-or-hash]/[path].Non-goals
Acceptance Criteria
/__lapis/plugins/.../main.mjs.Implementation Notes
Active Implementation Plan
PluginAssetServer.DefaultPluginDistributionManager.getInstalled()to resolve installed plugin metadata, verify every mirrored file with the existing size/SHA-256 helper, and store versioned responses in Cache Storage under/__lapis/plugins/..../__lapis/plugins/that serves only mirrored cache entries, so relative ESM imports resolve under the same same-origin URL space.mountWorkspaceApp()from the web host entrypoint.Affected Packages and Files
packages/api/src/lib/plugin-asset-server.tspackages/api/src/lib/__tests__/plugin-asset-server.test.tspackages/web/src/main.tspackages/web/src/plugin-asset-server.tspackages/web/vite.config.tsspec/src/20-packages/web/index.mdspec/src/30-cross-package-contracts/plugin-runtime.mdSuggested Files or Specs To Inspect
spec/src/20-packages/web/index.mdspec/src/30-cross-package-contracts/plugin-runtime.mdspec/src/30-cross-package-contracts/plugin-registry.mdpackages/api/src/lib/plugin-distribution/packages/web/src/Validation Commands
pnpm --filter @lapis-notes/api check:allpnpm --filter @lapis-notes/web check:allpnpm check:allRelated Issues
Follow-up Tasks
Implementation Summary
Implemented a Web/PWA PluginAssetServer that verifies installed plugin metadata, mirrors supported assets into Cache Storage under versioned /__lapis/plugins URLs, registers the Workbox CacheOnly route, updates workspace host wiring, and documents/tests the behavior.