@ecopages/react 0.2.0-beta.42 → 0.2.0-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -254,6 +254,8 @@ Auto-discovery runs at plugin setup when **both** are true:
|
|
|
254
254
|
|
|
255
255
|
Without `router`, only explicit `runtimeModules` entries are vendored.
|
|
256
256
|
|
|
257
|
+
Semantic `404.*` / `500.*` templates render outside the page-request middleware pipeline. Do not use `cache: 'dynamic'`, `middleware`, or `requires` on those files; they receive safe empty `pageLocals` instead of request-scoped locals.
|
|
258
|
+
|
|
257
259
|
#### Discovery modes
|
|
258
260
|
|
|
259
261
|
| Mode | Trigger | Layout roots scanned | npm packages collected |
|
|
@@ -341,9 +343,11 @@ Manual entries **override** auto-discovered entries for the same specifier.
|
|
|
341
343
|
| Symptom | Likely cause | Fix |
|
|
342
344
|
| ------------------------------------------ | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
343
345
|
| `No QueryClient set` after SPA navigation | Provider library bundled per page chunk | Ensure `router` is enabled; add `runtimeProvider: true` on the provider layout; rebuild vendors |
|
|
346
|
+
| Duplicate React context / Tone init logs | Provider package is bundled through multiple client entrypoints | Import through the package root and register that root in `runtimeModules` |
|
|
344
347
|
| Wrong packages vendored (slow dev startup) | Shell layout scanned as discovery root | Set `runtimeProvider: true` only on provider roots; keep shell layouts unflagged |
|
|
345
348
|
| Package not discovered | Layout outside `layouts/` / `components/`, or import not reachable from `render` | Move layout file or add explicit `runtimeModules` entry |
|
|
346
349
|
| `@/` alias not followed | Missing or invalid tsconfig paths | Add `compilerOptions.paths`; ensure `include` globs are valid JSON (not broken by comment stripping) |
|
|
350
|
+
| Stale bootstrap script hash in dev | Rendered HTML cached before runtime vendors/bootstrap scripts changed | Rebuild or touch a route file; development HTML cache keys include browser-runtime generation |
|
|
347
351
|
|
|
348
352
|
#### Tests
|
|
349
353
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/react",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.43",
|
|
4
4
|
"description": "React integration for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -93,16 +93,16 @@
|
|
|
93
93
|
"directory": "packages/integrations/react"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@ecopages/core": "0.2.0-beta.
|
|
96
|
+
"@ecopages/core": "0.2.0-beta.43",
|
|
97
97
|
"@types/react": "^19",
|
|
98
98
|
"@types/react-dom": "^19",
|
|
99
99
|
"react": "^19",
|
|
100
100
|
"react-dom": "^19"
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@ecopages/file-system": "0.2.0-beta.
|
|
103
|
+
"@ecopages/file-system": "0.2.0-beta.43",
|
|
104
104
|
"@ecopages/logger": "^0.2.3",
|
|
105
|
-
"@ecopages/mdx": "0.2.0-beta.
|
|
105
|
+
"@ecopages/mdx": "0.2.0-beta.43",
|
|
106
106
|
"@mdx-js/mdx": "^3.1.1",
|
|
107
107
|
"oxc-parser": "^0.141.0",
|
|
108
108
|
"oxc-transform": "^0.141.0",
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { isBarePackageImportSpecifier, resolveProjectModulePath, } from '@ecopages/core/plugins/tsconfig-import-resolver';
|
|
9
|
+
import { toPackageRootSpecifier } from '@ecopages/core/plugins/package-specifier';
|
|
9
10
|
import { analyzeReachability } from '../client-graph/reachability-analyzer.js';
|
|
10
11
|
import { REACT_RUNTIME_SPECIFIERS } from './runtime-alias-map.js';
|
|
11
12
|
const MODULE_EXTENSIONS = ['.tsx', '.ts', '.jsx', '.js', '.mts', '.mjs'];
|
|
@@ -46,14 +47,7 @@ export function isProviderRuntimeModulePath(filePath, source) {
|
|
|
46
47
|
* Normalizes import specifiers to the package entry used for browser vendors.
|
|
47
48
|
*/
|
|
48
49
|
export function normalizeRuntimePackageSpecifier(specifier) {
|
|
49
|
-
|
|
50
|
-
const parts = specifier.split('/');
|
|
51
|
-
if (parts.length >= 2) {
|
|
52
|
-
return `${parts[0]}/${parts[1]}`;
|
|
53
|
-
}
|
|
54
|
-
return specifier;
|
|
55
|
-
}
|
|
56
|
-
return specifier.split('/')[0] ?? specifier;
|
|
50
|
+
return toPackageRootSpecifier(specifier);
|
|
57
51
|
}
|
|
58
52
|
function isAutoRuntimeExcludedPackage(packageRoot) {
|
|
59
53
|
if (AUTO_RUNTIME_EXCLUDED_PACKAGE_PREFIXES.some((prefix) => packageRoot.startsWith(prefix))) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Specifier classification and requested-export registry helpers for the client graph boundary.
|
|
3
3
|
*/
|
|
4
4
|
import { loadTsconfigPathPrefixes, matchesTsconfigPathPrefix } from '@ecopages/core/plugins/tsconfig-import-resolver';
|
|
5
|
+
import { toPackageRootSpecifier } from '@ecopages/core/plugins/package-specifier';
|
|
5
6
|
import { dirname, resolve } from 'node:path';
|
|
6
7
|
export function isBareSpecifier(specifier) {
|
|
7
8
|
if (specifier.startsWith('.'))
|
|
@@ -52,17 +53,7 @@ export function isServerOnlySpecifier(specifier) {
|
|
|
52
53
|
* @returns The root package name, preserving scoped npm organizations.
|
|
53
54
|
*/
|
|
54
55
|
export function toModuleBaseSpecifier(specifier) {
|
|
55
|
-
|
|
56
|
-
return specifier;
|
|
57
|
-
}
|
|
58
|
-
if (specifier.startsWith('@')) {
|
|
59
|
-
const [scope, name] = specifier.split('/');
|
|
60
|
-
if (!scope || !name)
|
|
61
|
-
return specifier;
|
|
62
|
-
return `${scope}/${name}`;
|
|
63
|
-
}
|
|
64
|
-
const [name] = specifier.split('/');
|
|
65
|
-
return name ?? specifier;
|
|
56
|
+
return toPackageRootSpecifier(specifier);
|
|
66
57
|
}
|
|
67
58
|
/**
|
|
68
59
|
* Parses the grammar syntax of declared modules.
|
|
@@ -107,6 +107,10 @@ export type ReactPluginOptions = {
|
|
|
107
107
|
* });
|
|
108
108
|
* ```
|
|
109
109
|
*
|
|
110
|
+
* Manual entries override auto-discovered entries for the same specifier.
|
|
111
|
+
* Subpath imports such as `@acme/ui/button` dedupe to the registered package
|
|
112
|
+
* root vendor URL when `@acme/ui` is configured here or auto-discovered.
|
|
113
|
+
*
|
|
110
114
|
* @example Advanced vendor config
|
|
111
115
|
* ```ts
|
|
112
116
|
* runtimeModules: [
|