@ecopages/react 0.2.0-beta.20 → 0.2.0-beta.22
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-beta.
|
|
3
|
+
"version": "0.2.0-beta.22",
|
|
4
4
|
"description": "React integration for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -85,16 +85,16 @@
|
|
|
85
85
|
"directory": "packages/integrations/react"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@ecopages/core": "0.2.0-beta.
|
|
88
|
+
"@ecopages/core": "0.2.0-beta.22",
|
|
89
89
|
"@types/react": "^19",
|
|
90
90
|
"@types/react-dom": "^19",
|
|
91
91
|
"react": "^19",
|
|
92
92
|
"react-dom": "^19"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@ecopages/file-system": "0.2.0-beta.
|
|
95
|
+
"@ecopages/file-system": "0.2.0-beta.22",
|
|
96
96
|
"@ecopages/logger": "^0.2.3",
|
|
97
|
-
"@ecopages/mdx": "0.2.0-beta.
|
|
97
|
+
"@ecopages/mdx": "0.2.0-beta.22",
|
|
98
98
|
"@mdx-js/mdx": "^3.1.1",
|
|
99
99
|
"oxc-parser": "^0.124.0",
|
|
100
100
|
"oxc-transform": "^0.124.0",
|
|
@@ -127,6 +127,8 @@ export declare class ReactHmrStrategy extends HmrStrategy {
|
|
|
127
127
|
* @returns True if this file should trigger React HMR rebuilds
|
|
128
128
|
*/
|
|
129
129
|
matches(filePath: string): boolean;
|
|
130
|
+
canEmitEntrypoint(entrypointPath: string): boolean;
|
|
131
|
+
emitEntrypoint(entrypointPath: string, _outputPath: string): Promise<void>;
|
|
130
132
|
/**
|
|
131
133
|
* Checks if a file is a layout file.
|
|
132
134
|
*
|
|
@@ -75,8 +75,7 @@ class ReactHmrStrategy extends HmrStrategy {
|
|
|
75
75
|
declaredModules,
|
|
76
76
|
cache: this.clientGraphBoundaryCache
|
|
77
77
|
}),
|
|
78
|
-
...runtimeRewritePlugin ? [runtimeRewritePlugin] : []
|
|
79
|
-
...this.context.getPlugins()
|
|
78
|
+
...runtimeRewritePlugin ? [runtimeRewritePlugin] : []
|
|
80
79
|
];
|
|
81
80
|
}
|
|
82
81
|
isReactEntrypoint(filePath) {
|
|
@@ -157,9 +156,6 @@ class ReactHmrStrategy extends HmrStrategy {
|
|
|
157
156
|
matches(filePath) {
|
|
158
157
|
const watchedFiles = this.context.getWatchedFiles();
|
|
159
158
|
appLogger.debug(`Checking ${filePath}. Watched: ${watchedFiles.size}`);
|
|
160
|
-
if (watchedFiles.size === 0) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
159
|
if (watchedFiles.has(filePath)) {
|
|
164
160
|
return this.ownsWatchedEntrypoint(filePath);
|
|
165
161
|
}
|
|
@@ -174,6 +170,13 @@ class ReactHmrStrategy extends HmrStrategy {
|
|
|
174
170
|
}
|
|
175
171
|
return this.isReactEntrypoint(filePath);
|
|
176
172
|
}
|
|
173
|
+
canEmitEntrypoint(entrypointPath) {
|
|
174
|
+
return this.isReactEntrypoint(entrypointPath) && this.ownsWatchedEntrypoint(entrypointPath);
|
|
175
|
+
}
|
|
176
|
+
async emitEntrypoint(entrypointPath, _outputPath) {
|
|
177
|
+
const { outputUrl } = this.getEntrypointOutput(entrypointPath);
|
|
178
|
+
await this.bundleReactEntrypoint(entrypointPath, outputUrl);
|
|
179
|
+
}
|
|
177
180
|
/**
|
|
178
181
|
* Checks if a file is a layout file.
|
|
179
182
|
*
|