Repository navigation
fix(vite): route unvendored plugin-patterned deps through /ns/m HTTP - #11459
Merged
NathanWalker merged 2 commits intoSep 29, 2026
Merged
Conversation
Plugin-patterned specifiers (@nativescript/*, @nativescript-community/*, nativescript-*) absent from the vendor manifest — e.g. a package's own transitive dependency under pnpm's isolated linker, NS_VENDOR_EXCLUDE'd packages, or flavor vendor.exclude entries — were rewritten to synchronous __nsVendorRequire calls against a registry with no entry, resolving to the __nsMissing stub. The designed per-module HTTP fallback already serves these (via Vite's importer-aware resolution, including .pnpm realpaths). resolveVendorRouting's plugin fast paths and ensureNativeScriptModuleBindings' force-canonical now require vendor manifest membership when a manifest is active, leaving unvendored plugin imports as HTTP imports. Behavior is unchanged while no manifest exists (unit tests, early boot). Refs NativeScript#11458
|
View your CI Pipeline Execution ↗ for commit aa2a1ee
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
aleclarson
added a commit
to octane-xplat/octane-xplat
that referenced
this pull request
Sep 27, 2026
…er /ns/m Vendor routing assumed plugin-patterned specifiers were always vendored: unvendored transitive deps (plugin-bearing leaf packages under pnpm's isolated linker, e.g. @octane-xplat/gif → @nativescript-community/ui-image) rewrote to sync __nsVendorRequire calls against a registry with no entry, resolving to the __nsMissing stub. With a manifest active, plugin-patterned ids now require manifest membership — unvendored ones keep their bare/HTTP form and resolve per-module via Vite's importer-aware resolution (verified: the leaf emits a real /ns/m URL into .pnpm and it serves 200). Upstream: NativeScript/NativeScript#11459. Drop the patch when a release carries the fix.
…embership Matches resolveVendorRouting's check so vendored plugins keep their existing binding behavior; only packages absent from the manifest fall back to HTTP.
nativescript-oss
pushed a commit
to aleclarson/nativescript
that referenced
this pull request
Sep 29, 2026
- guard the workspace fallback against escaping its node_modules dir - probe pnpm's hoisted virtual store for deps of published packages - probe only the active platform suffix so iOS never picks .android.js - fix the spec's unterminated string literals - drop the resolveVendorRouting change duplicated from NativeScript#11459
NathanWalker
approved these changes
Sep 29, 2026
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.
Closes #11458.
Summary
In dev sessions, plugin-patterned specifiers absent from the vendor manifest — a package's own transitive plugin dependency under pnpm's isolated linker, an
NS_VENDOR_EXCLUDEd package, or a flavorvendor.excludeentry — were rewritten to synchronous__nsVendorRequirecalls against a registry with no entry, resolving to the__nsMissingstub (X is not a constructordownstream). The designed per-module HTTP fallback already serves these modules via Vite's importer-aware resolution (including.pnpmrealpaths).resolveVendorRouting(websocket-module-specifiers.ts): theisLikelyNativeScriptRuntimePluginSpecifierfast paths now require manifest membership when a manifest is active.ensureNativeScriptModuleBindings(websocket-module-bindings.ts):canonicalis dropped when the active manifest doesn't contain it, and theisLikelyNativeScriptPluginSpecifierforce-canonical branch requiresresolveVendorSpecifierwhen a manifest is active.Both gates preserve legacy behavior while no manifest exists (unit tests, early boot).
Verified in a pnpm
nodeLinker: isolatedworkspace: an unvendored transitive@nativescript-community/ui-imageimport in a leaf package now emitsimport { Img } from "/ns/m/node_modules/.pnpm/@nativescript-community+ui-image@4.6.20/node_modules/@nativescript-community/ui-image/index.ios.js", which serves real transformed code.Test plan
npx nx run vite:test— all specs pass excepttypescript-optional.spec.ts, which fails identically onmainin this checkout (environmental).resolveVendorRoutingreturnsnullfor a plugin-patterned package absent from the manifest (websocket-vendor-routing.spec.ts).ensureNativeScriptModuleBindingskeeps an unvendored plugin import unbound (websocket-vendor-bindings.spec.ts).ns runagainst a pnpm-linked wrapper package — verified manually, not covered byapps/automated.