@ecopages/react 0.2.0-rc.10 → 0.2.0-rc.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/react",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.11",
|
|
4
4
|
"description": "React integration for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -104,16 +104,16 @@
|
|
|
104
104
|
"directory": "packages/integrations/react"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
|
-
"@ecopages/core": "0.2.0-rc.
|
|
107
|
+
"@ecopages/core": "0.2.0-rc.11",
|
|
108
108
|
"@types/react": "^19",
|
|
109
109
|
"@types/react-dom": "^19",
|
|
110
110
|
"react": "^19",
|
|
111
111
|
"react-dom": "^19"
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@ecopages/file-system": "0.2.0-rc.
|
|
114
|
+
"@ecopages/file-system": "0.2.0-rc.11",
|
|
115
115
|
"@ecopages/logger": "^0.2.3",
|
|
116
|
-
"@ecopages/mdx": "0.2.0-rc.
|
|
116
|
+
"@ecopages/mdx": "0.2.0-rc.11",
|
|
117
117
|
"@mdx-js/mdx": "^3.1.1",
|
|
118
118
|
"oxc-parser": "^0.141.0",
|
|
119
119
|
"oxc-transform": "^0.141.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* during the transform is correctly grown on replay against a fresh
|
|
35
35
|
* registry as well.
|
|
36
36
|
*/
|
|
37
|
-
import { rapidhash } from '@ecopages/core/
|
|
37
|
+
import { rapidhash } from '@ecopages/core/hash';
|
|
38
38
|
const DEFAULT_MAX_ENTRIES = 5_000;
|
|
39
39
|
/**
|
|
40
40
|
* Clone a single rule value: `'*'` is a singleton, Sets get a shallow copy.
|
|
@@ -3,4 +3,4 @@ export interface CreateReactMdxLoaderPluginOptions {
|
|
|
3
3
|
compilerOptions?: CompileOptions;
|
|
4
4
|
projectRoot: string;
|
|
5
5
|
}
|
|
6
|
-
export declare function createReactMdxLoaderPlugin(options: CreateReactMdxLoaderPluginOptions): import("@ecopages/core/
|
|
6
|
+
export declare function createReactMdxLoaderPlugin(options: CreateReactMdxLoaderPluginOptions): import("@ecopages/core/plugins/processor").EcoBuildPlugin;
|
package/src/hmr/hmr-scripts.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HMR script utilities for React components.
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Checks if code has already been processed with HMR marker.
|
|
7
|
-
* @param code - The bundled code to check
|
|
8
|
-
* @returns True if the code already contains the HMR marker
|
|
9
|
-
*/
|
|
10
|
-
export declare function hasHmrMarker(code: string): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Injects HMR acceptance handler into bundled code.
|
|
13
|
-
* When a module with React exports changes, it triggers a full invalidation
|
|
14
|
-
* to ensure the parent module re-imports and re-renders with the updated component.
|
|
15
|
-
* @param code - The bundled code to wrap
|
|
16
|
-
* @returns Code with HMR handler injected
|
|
17
|
-
*/
|
|
18
|
-
export declare function injectHmrHandler(code: string): string;
|
package/src/hmr/hmr-scripts.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HMR script utilities for React components.
|
|
3
|
-
* @module
|
|
4
|
-
*/
|
|
5
|
-
/** Marker comment to identify already-processed HMR code */
|
|
6
|
-
const HMR_MARKER = '/* [ecopages] react-hmr */';
|
|
7
|
-
/**
|
|
8
|
-
* Checks if code has already been processed with HMR marker.
|
|
9
|
-
* @param code - The bundled code to check
|
|
10
|
-
* @returns True if the code already contains the HMR marker
|
|
11
|
-
*/
|
|
12
|
-
export function hasHmrMarker(code) {
|
|
13
|
-
return code.includes(HMR_MARKER);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Injects HMR acceptance handler into bundled code.
|
|
17
|
-
* When a module with React exports changes, it triggers a full invalidation
|
|
18
|
-
* to ensure the parent module re-imports and re-renders with the updated component.
|
|
19
|
-
* @param code - The bundled code to wrap
|
|
20
|
-
* @returns Code with HMR handler injected
|
|
21
|
-
*/
|
|
22
|
-
export function injectHmrHandler(code) {
|
|
23
|
-
return `${HMR_MARKER}
|
|
24
|
-
${code}
|
|
25
|
-
if (import.meta.hot) {
|
|
26
|
-
import.meta.hot.accept((newModule) => {
|
|
27
|
-
if (newModule) {
|
|
28
|
-
const exports = Object.keys(newModule);
|
|
29
|
-
const hasReactExport = exports.some(key => {
|
|
30
|
-
const value = newModule[key];
|
|
31
|
-
return value && (
|
|
32
|
-
typeof value === 'function' ||
|
|
33
|
-
(typeof value === 'object' && value.$$typeof)
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
if (hasReactExport) {
|
|
38
|
-
import.meta.hot.invalidate();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
}
|