GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — @nativescript/vite: HMR graph collapses distinct native and shared source identities · Issue #11569 · NativeScript/NativeScript Open Labels Description@nativescript/vite: HMR graph collapses distinct native and shared source identities
Verified scope
Expected and observedWith
Expected: distinct files retain distinct identities, and registering both produces two graph entries. Actual: the second registration replaces the first; graph size is one. The normalizer strips the plugin-root prefix, then truncates every remaining path at the first app-root substring. That last step also truncates external filesystem and shared-library identities. Source: ReproductionCreate the following files in an empty directory. Run
{
"name": "nativescript-hmr-identity-repro",
"version": "0.0.0",
"private": true,
"type": "module",
"packageManager": "[email protected]",
"scripts": {
"check": "node repro.mjs"
},
"devDependencies": {
"@nativescript/vite": "8.0.20",
"vite": "8.3.0"
}
}
packages: - . allowBuilds: esbuild: true "@parcel/watcher": true minimumReleaseAgeExclude: - "@nativescript/[email protected]"
import assert from 'node:assert/strict' import { createRequire } from 'node:module' import { writeFile } from 'node:fs/promises' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' const require = createRequire(import.meta.url) const ns = pathToFileURL(require.resolve('@nativescript/vite')) const { HmrModuleGraph } = await import(new URL('./hmr/server/hmr-module-graph.js', ns)) const { getProjectAppVirtualPath } = await import(new URL('./helpers/utils.js', ns)) const app = getProjectAppVirtualPath().replace(/^\/+|\/+$/g, '') const graph = new HmrModuleGraph({ verbose: false, strategy: { matchesFile: () => true }, getWss: () => null, getPluginRoot: () => '/workspace/native', }) const native = `/workspace/native/${app}/screen.tsx` const shared = `/workspace/shared/${app}/screen.tsx` const nativeId = graph.normalizeGraphId(native) const sharedId = graph.normalizeGraphId(shared) graph.upsert(native, 'export const origin = "native"', [], { bumpVersion: false }) graph.upsert(shared, 'export const origin = "shared"', [], { bumpVersion: false }) const result = { scope: 'Unpatched NativeScript 8.0.20 production HMR graph, no Coreframe or Octane transform plugins and no device runtime', appVirtualPath: getProjectAppVirtualPath(), native, shared, nativeId, sharedId, distinctIds: nativeId !== sharedId, graphSizeForTwoFiles: graph.size, } await writeFile(new URL('./result.json', import.meta.url), JSON.stringify(result, null, 2) + '\n') console.log(JSON.stringify(result, null, 2)) assert.notEqual(nativeId, sharedId, 'Distinct native and shared files must retain distinct HMR identities') assert.equal(graph.size, 2) Related consumer evidenceA shared-source app declares its external source roots through a conventional The shared update is reported as Requested fixPreserve distinct canonical identities for modules outside the native host root and keep graph lookup, change broadcasts, client accept registration, and module fetching consistent. Retain ordinary app-relative IDs and existing query/file-URL normalization. Please cover same-named files in separate roots, external workspace libraries, and a real shared-source edit that reaches the running native view. ActivityMetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |