@nifrajs/web-solid 5.2.0 → 5.4.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @nifrajs/web-solid
2
2
 
3
+ ## 5.4.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e7d43ca]
8
+ - Updated dependencies [5183c00]
9
+ - Updated dependencies [01b97ec]
10
+ - Updated dependencies [e589893]
11
+ - Updated dependencies [ff66db6]
12
+ - Updated dependencies [02ac072]
13
+ - Updated dependencies [529f8d2]
14
+ - @nifrajs/web@5.4.0
15
+ - @nifrajs/core@5.4.0
16
+ - @nifrajs/i18n@5.4.0
17
+ - @nifrajs/image@5.4.0
18
+
19
+ ## 5.3.0
20
+
21
+ ### Patch Changes
22
+
23
+ - 90433ee: Solid server renders no longer read `process.env.NODE_ENV` on every render. The check that keeps a caught server error's text out of the hydration script now runs only when an error is serialized, with the same outcome: outside development and test, including an unset `NODE_ENV`, the browser receives "Internal Server Error". On Node, where each `process.env` read is a native call, the SSR benchmark's catalog page renders about 1.5% faster.
24
+ - Updated dependencies [7ab9692]
25
+ - Updated dependencies [7ab9692]
26
+ - Updated dependencies [0e1d03f]
27
+ - Updated dependencies [808bac8]
28
+ - Updated dependencies [605c246]
29
+ - Updated dependencies [271917a]
30
+ - Updated dependencies [d4bae56]
31
+ - Updated dependencies [007060d]
32
+ - Updated dependencies [69dfb60]
33
+ - Updated dependencies [190ab39]
34
+ - Updated dependencies [605c246]
35
+ - Updated dependencies [13224fe]
36
+ - Updated dependencies [00c266e]
37
+ - Updated dependencies [7cf8df3]
38
+ - @nifrajs/core@5.3.0
39
+ - @nifrajs/i18n@5.3.0
40
+ - @nifrajs/image@5.3.0
41
+ - @nifrajs/web@5.3.0
42
+
43
+ ## 5.2.1
44
+
45
+ ### Patch Changes
46
+
47
+ - @nifrajs/core@5.2.1
48
+ - @nifrajs/i18n@5.2.1
49
+ - @nifrajs/image@5.2.1
50
+ - @nifrajs/web@5.2.1
51
+
3
52
  ## 5.2.0
4
53
 
5
54
  ### Minor Changes
package/dist/index.js CHANGED
@@ -19,17 +19,16 @@ function redactedError() {
19
19
  /**
20
20
  * Render `app` with every Error that Solid serializes for hydration replaced. An `<ErrorBoundary>` that
21
21
  * caught on the server, or a failed resource, otherwise ships the message and stack in an inline script.
22
- * Nested contexts copy this one, so they keep the wrapped `serialize`.
22
+ * Nested contexts copy this one, so they keep the wrapped `serialize`. NODE_ENV is read only when an
23
+ * Error is serialized: on Node every `process.env` read is a native call, and this runs every render.
23
24
  */
24
25
  function redactingErrors(app) {
25
- if (showsErrors())
26
- return app;
27
26
  return () => {
28
27
  // biome-ignore lint/plugin/requireSafetyCommentForTypeAssertion: Solid's server renderers set a context with serialize; the check below handles its absence.
29
28
  const context = sharedConfig.context;
30
29
  const serialize = context?.serialize;
31
30
  if (context !== undefined && serialize !== undefined) {
32
- context.serialize = (id, value) => serialize(id, value instanceof Error ? redactedError() : value);
31
+ context.serialize = (id, value) => serialize(id, value instanceof Error && !showsErrors() ? redactedError() : value);
33
32
  }
34
33
  return app();
35
34
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EACL,uBAAuB,EACvB,cAAc,IAAI,mBAAmB,EACrC,cAAc,IAAI,mBAAmB,GACtC,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,MAAM,cAAc,GAAG,uBAAuB,EAAE,CAAA;AAEhD,kFAAkF;AAClF,MAAM,WAAW,GAAG,GAAY,EAAE;IAChC,MAAM,OAAO,GAAG,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAA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,mBAAmB,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;IACxD,CAAC;IACD,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO;QAClC,uFAAuF;QACvF,2FAA2F;QAC3F,6FAA6F;QAC7F,4FAA4F;QAC5F,oGAAoG;QACpG,MAAM,EAAE,GAAG,IAAI,eAAe,EAA0B,CAAA;QACxD,MAAM,GAAG,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;QAClD,MAAM,MAAM,GACV,OAAO,EAAE,KAAK,KAAK,SAAS;YAC1B,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC;YAC1B,CAAC,CAAC,mBAAmB,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;QACxD,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;QAC1B,OAAO,EAAE,CAAC,QAAQ,CAAA;IACpB,CAAC;IACD,aAAa;QACX,OAAO,cAAc,CAAA;IACvB,CAAC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nifrajs/web-solid",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "description": "Solid render adapter for @nifrajs/web - SSR + hydration, with the Solid Babel build plugin (@nifrajs/web-solid/plugin).",
5
5
  "keywords": [
6
6
  "bun",
@@ -122,10 +122,10 @@
122
122
  "dependencies": {
123
123
  "@babel/core": "^7.26.0",
124
124
  "@babel/preset-typescript": "^7.26.0",
125
- "@nifrajs/core": "5.2.0",
126
- "@nifrajs/i18n": "5.2.0",
127
- "@nifrajs/image": "5.2.0",
128
- "@nifrajs/web": "5.2.0",
125
+ "@nifrajs/core": "5.4.0",
126
+ "@nifrajs/i18n": "5.4.0",
127
+ "@nifrajs/image": "5.4.0",
128
+ "@nifrajs/web": "5.4.0",
129
129
  "babel-preset-solid": "^1.9.3",
130
130
  "solid-refresh": "^0.7.8"
131
131
  },
package/src/index.ts CHANGED
@@ -34,10 +34,10 @@ function redactedError(): Error {
34
34
  /**
35
35
  * Render `app` with every Error that Solid serializes for hydration replaced. An `<ErrorBoundary>` that
36
36
  * caught on the server, or a failed resource, otherwise ships the message and stack in an inline script.
37
- * Nested contexts copy this one, so they keep the wrapped `serialize`.
37
+ * Nested contexts copy this one, so they keep the wrapped `serialize`. NODE_ENV is read only when an
38
+ * Error is serialized: on Node every `process.env` read is a native call, and this runs every render.
38
39
  */
39
40
  function redactingErrors<T>(app: () => T): () => T {
40
- if (showsErrors()) return app
41
41
  return () => {
42
42
  // biome-ignore lint/plugin/requireSafetyCommentForTypeAssertion: Solid's server renderers set a context with serialize; the check below handles its absence.
43
43
  const context = sharedConfig.context as
@@ -46,7 +46,7 @@ function redactingErrors<T>(app: () => T): () => T {
46
46
  const serialize = context?.serialize
47
47
  if (context !== undefined && serialize !== undefined) {
48
48
  context.serialize = (id, value) =>
49
- serialize(id, value instanceof Error ? redactedError() : value)
49
+ serialize(id, value instanceof Error && !showsErrors() ? redactedError() : value)
50
50
  }
51
51
  return app()
52
52
  }