You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vue-lynx's main-thread worklet loader (extractLocalImports in plugin/dist/loaders/worklet-loader-mt.js) only re-emits relative import specifiers into the MT module graph. Any non-relative specifier is silently dropped, so the worklet's registerWorkletInternal(...) is never written to the MT bundle and the first interaction throws TypeError: cannot read property 'bind' of undefined.
Full write-up: docs/upstream/vue-lynx-mt-worklet-import-issue.md.
Two affected surfaces
Aliases (@/…), intra-package — e.g. SwiperRoot.vue importing @/shared/gesture/useDragGesture inside @vyui/core.
Surface 1 is fixed by patches/vue-lynx@0.4.0.patch (pnpm patchedDependencies in pnpm-workspace.yaml): broadens the loader regex to also follow @/…. Carries a [REMOVE WHEN UPSTREAM FIXED] banner. Verified — MT bundle audit reports UNRESOLVED: 0 (7 unresolved without it).
Surface 2 is worked around by the side-effect import '../../../../packages/core/src' in each demo's index.ts (drags core's worklets into the MT graph via a relative path).
Converts the loader to async and resolves non-relative specifiers via the bundler resolver (this.getResolve()), re-emitting project-source imports with their original specifiers → replaces our regex patch (surface 1).
Adds opt-in includeWorkletPackages to follow imports into named node_modules packages that ship MT worklets → replaces the side-effect import (surface 2), via includeWorkletPackages: ['@vyui/core'].
Status: open, ready for review. Not yet released, so we keep the stopgaps until it lands.
Cleanup when #190 ships in a vue-lynx release
Delete patches/vue-lynx@0.4.0.patch + its patchedDependencies entry in pnpm-workspace.yaml.
Drop the import '../../../../packages/core/src' side-effect from each demo index.ts; add includeWorkletPackages: ['@vyui/core'] to the loader config.
Summary
vue-lynx's main-thread worklet loader (
extractLocalImportsinplugin/dist/loaders/worklet-loader-mt.js) only re-emits relative import specifiers into the MT module graph. Any non-relative specifier is silently dropped, so the worklet'sregisterWorkletInternal(...)is never written to the MT bundle and the first interaction throwsTypeError: cannot read property 'bind' of undefined.Full write-up:
docs/upstream/vue-lynx-mt-worklet-import-issue.md.Two affected surfaces
@/…), intra-package — e.g.SwiperRoot.vueimporting@/shared/gesture/useDragGestureinside@vyui/core.@vyui/core), cross-package — the demo apps consuming@vyui/core's MT worklets. (Was tracked as Shared gesture/animation worklets ARE viable — blocker is @vyui/core worklet packaging (local loader) #37.)Current state — patched locally, works
patches/vue-lynx@0.4.0.patch(pnpmpatchedDependenciesinpnpm-workspace.yaml): broadens the loader regex to also follow@/…. Carries a[REMOVE WHEN UPSTREAM FIXED]banner. Verified — MT bundle audit reportsUNRESOLVED: 0(7 unresolved without it).import '../../../../packages/core/src'in each demo'sindex.ts(drags core's worklets into the MT graph via a relative path).Both are stopgaps.
Proper upstream fix — vue-lynx#190
Huxpro/vue-lynx#190 fixes both:
this.getResolve()), re-emitting project-source imports with their original specifiers → replaces our regex patch (surface 1).includeWorkletPackagesto follow imports into namednode_modulespackages that ship MT worklets → replaces the side-effect import (surface 2), viaincludeWorkletPackages: ['@vyui/core'].Status: open, ready for review. Not yet released, so we keep the stopgaps until it lands.
Cleanup when #190 ships in a vue-lynx release
patches/vue-lynx@0.4.0.patch+ itspatchedDependenciesentry inpnpm-workspace.yaml.import '../../../../packages/core/src'side-effect from each demoindex.ts; addincludeWorkletPackages: ['@vyui/core']to the loader config.pnpm install, rebuild, re-run the MT-bundle audit (expectUNRESOLVED: 0), device-verify drag/gesture.Supersedes #37. Item 1 of the #50 umbrella points here.