@webjsdev/server 0.8.60 → 0.8.61
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 +2 -2
- package/src/actions.js +1 -1
- package/src/check.js +1 -1
- package/src/component-elision.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webjsdev/server",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The server for WebJs, a full-stack JavaScript framework built on web components with server-side rendering and no build step. Provides the file-based router, SSR, server actions, route handlers, middleware, and live reload on Node 24+ or Bun.",
|
|
6
6
|
"main": "index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@webjsdev/core": "^0.7.
|
|
31
|
+
"@webjsdev/core": "^0.7.49",
|
|
32
32
|
"ws": "^8.20.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
package/src/actions.js
CHANGED
|
@@ -245,7 +245,7 @@ export async function isServerAction(file) {
|
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
247
|
* @param {ActionIndex} idx
|
|
248
|
-
* @param {string} urlPath
|
|
248
|
+
* @param {string} urlPath A browser-visible URL path like `/actions/foo.server.js`
|
|
249
249
|
*/
|
|
250
250
|
export function resolveServerModule(idx, urlPath) {
|
|
251
251
|
const abs = join(idx.appDir, urlPath.split('/').join(sep));
|
package/src/check.js
CHANGED
|
@@ -190,7 +190,7 @@ function isServerActionFile(filePath, content) {
|
|
|
190
190
|
/**
|
|
191
191
|
* Check whether a file resides under a components/ directory (shared or
|
|
192
192
|
* module-scoped).
|
|
193
|
-
* @param {string} relPath
|
|
193
|
+
* @param {string} relPath Path relative to appDir
|
|
194
194
|
* @returns {boolean}
|
|
195
195
|
*/
|
|
196
196
|
function isComponentFile(relPath) {
|
package/src/component-elision.js
CHANGED
|
@@ -238,8 +238,13 @@ const SERVER_FILE_RE = /\.server\.m?[jt]s$/;
|
|
|
238
238
|
|
|
239
239
|
/** Side-effect or named import of the client router subpath. */
|
|
240
240
|
const CLIENT_ROUTER_SUBPATH_RE = /['"]@webjsdev\/core\/client-router['"]/;
|
|
241
|
-
/**
|
|
242
|
-
|
|
241
|
+
/**
|
|
242
|
+
* Client-only named APIs from the `@webjsdev/core` main entry. Exported so
|
|
243
|
+
* `test/elision/lifecycle-coverage.test.js` can guard it the way it guards
|
|
244
|
+
* REACTIVE_IMPORTS: a router function the barrel re-exports but this list omits
|
|
245
|
+
* is not recognized as client work, so a component using it is wrongly elided.
|
|
246
|
+
*/
|
|
247
|
+
export const CLIENT_ROUTER_IMPORTS = ['navigate', 'enableClientRouter', 'disableClientRouter', 'revalidate', 'loadFrame'];
|
|
243
248
|
|
|
244
249
|
/** Identifiers that only exist in a browser; their presence means client work. */
|
|
245
250
|
const CLIENT_GLOBAL_RE = /\b(?:window|document|navigator|localStorage|sessionStorage|customElements|matchMedia|addEventListener)\b/;
|