@webjsdev/server 0.8.34 → 0.8.35
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 +1 -1
- package/src/check.js +4 -4
- package/src/vendor.js +1 -1
package/package.json
CHANGED
package/src/check.js
CHANGED
|
@@ -77,12 +77,12 @@ export const RULES = [
|
|
|
77
77
|
{
|
|
78
78
|
name: 'no-static-properties',
|
|
79
79
|
description:
|
|
80
|
-
'Reactive properties must be declared via the `extends WebComponent({ … })` factory, never a hand-written `static properties = { … }` field in the class body. The factory types each field for you (no `declare` needed) and the runtime throws on a direct `static properties`. Migrate `class X extends WebComponent { static properties = { count: { type: Number } } }` to `class X extends WebComponent({ count: Number })`; use the `prop()` helper for options (`prop(Number, { reflect: true })`) and set defaults
|
|
80
|
+
'Reactive properties must be declared via the `extends WebComponent({ … })` factory, never a hand-written `static properties = { … }` field in the class body. The factory types each field for you (no `declare` needed) and the runtime throws on a direct `static properties`. Migrate `class X extends WebComponent { static properties = { count: { type: Number } } }` to `class X extends WebComponent({ count: Number })`; use the `prop()` helper for options (`prop(Number, { reflect: true })`) and set defaults in the constructor after super().',
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
name: 'reactive-props-no-class-field',
|
|
84
84
|
description:
|
|
85
|
-
'A reactive property declared via the `extends WebComponent({ … })` factory must NOT also have a plain class-field initializer (`count = 0` or `count: number = 0`) in the class body. Under modern class-field semantics that initializer runs Object.defineProperty *after* super(), clobbering the framework\'s reactive accessor and silently breaking re-renders. Set the default
|
|
85
|
+
'A reactive property declared via the `extends WebComponent({ … })` factory must NOT also have a plain class-field initializer (`count = 0` or `count: number = 0`) in the class body. Under modern class-field semantics that initializer runs Object.defineProperty *after* super(), clobbering the framework\'s reactive accessor and silently breaking re-renders. Set the default by assigning in the constructor after super().',
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
name: 'array-prop-uses-array-type',
|
|
@@ -451,7 +451,7 @@ export async function checkConventions(appDir) {
|
|
|
451
451
|
file: rel,
|
|
452
452
|
message:
|
|
453
453
|
'`static properties = { … }` is no longer supported; declare reactive properties via the `extends WebComponent({ … })` factory instead.',
|
|
454
|
-
fix: 'Move the properties into the factory call: `class X extends WebComponent({ count: Number })`. Use `prop(Number, { reflect: true })` for options and set defaults
|
|
454
|
+
fix: 'Move the properties into the factory call: `class X extends WebComponent({ count: Number })`. Use `prop(Number, { reflect: true })` for options and set defaults in the constructor after super(). Delete the `static properties` block and any `declare` fields for those props.',
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
}
|
|
@@ -471,7 +471,7 @@ export async function checkConventions(appDir) {
|
|
|
471
471
|
rule: 'reactive-props-no-class-field',
|
|
472
472
|
file: rel,
|
|
473
473
|
message: `Reactive prop \`${bad}\` uses a class-field initializer; this clobbers the framework's reactive accessor under modern class-field semantics.`,
|
|
474
|
-
fix: `Remove the class-field initializer and set the default
|
|
474
|
+
fix: `Remove the class-field initializer and set the default by assigning \`this.${bad} = <value>\` inside \`constructor()\` after \`super()\`.`,
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
}
|
package/src/vendor.js
CHANGED
|
@@ -412,7 +412,7 @@ async function jspmCall(installs, provider) {
|
|
|
412
412
|
// A 5xx/429 is a transient jspm problem worth retrying. A 401/4xx
|
|
413
413
|
// means at least one install is genuinely unresolvable (jspm uses
|
|
414
414
|
// 401 for that): a private / workspace / server-only package (e.g.
|
|
415
|
-
// @webjsdev/server,
|
|
415
|
+
// @webjsdev/server, pg) the browser never fetches
|
|
416
416
|
// anyway. Permanent failures must NOT block readiness.
|
|
417
417
|
const transient = response.status >= 500 || response.status === 429;
|
|
418
418
|
return { ok: false, imports: {}, transient };
|