Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NativeScript/NativeScript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 36a88dd
Choose a base ref
...
head repository: NativeScript/NativeScript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8635dd3
Choose a head ref
  • 2 commits
  • 28 files changed
  • 1 contributor

Commits on Nov 9, 2026

  1. feat(webpack,vite): keep ns: builtin module imports for the runtime

    The iOS and Android runtimes resolve `ns:<name>` builtin modules (and a
    few `node:<name>` compatibility shims) themselves. Webpack failed on these
    imports with an unhandled-scheme error, and Vite failed to resolve `ns:`
    specifiers and replaced `node:` ones with an empty browser stub.
    
    Every `ns:` specifier is now left verbatim in the output, matched by
    prefix so modules added in future runtime versions work without changes.
    Both packages expose the same helpers:
    
    - addBuiltinModule(matcher, target?) opts more specifiers in, e.g. the
      `node:` shims a runtime version ships, optionally forwarding a bare
      specifier such as `worker_threads` to `node:worker_threads`.
    - polyfillBuiltinModule(specifier, path) bundles a replacement instead,
      for runtimes that don't provide a builtin.
    
    In Vite this covers `vite build`, workers, dep optimization and the HMR
    dev server (esbuild dependency bundles, `/@id/` unwrapping, worker realm
    routing, core rewriting, the dev import map and the CommonJS require
    shim).
    edusperoni committed Nov 9, 2026
    Configuration menu
    Copy the full SHA
    4faf46b View commit details
    Browse the repository at this point in the history
  2. refactor(webpack,vite): configure builtin modules through bundler-nat…

    …ive hooks
    
    Replace the addBuiltinModule/polyfillBuiltinModule helpers with a single
    plugin per bundler, customized the way each bundler is normally
    customized:
    
    - webpack: NativeScriptBuiltinModulesPlugin, registered by name so
      webpack-chain can `.tap()` its `include` list. It externalizes on the
      request after `beforeResolve`, so a NormalModuleReplacementPlugin can
      redirect a builtin to a polyfill or forward a bare specifier to one.
    - vite: nativescriptBuiltinModules({ include }). Extra instances add
      specifiers; resolve.alias handles polyfills and forwarding, since
      aliases resolve before the plugin.
    edusperoni committed Nov 9, 2026
    Configuration menu
    Copy the full SHA
    8635dd3 View commit details
    Browse the repository at this point in the history
Loading