@octanejs/rspack-plugin 0.1.42 → 0.1.44

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/README.md CHANGED
@@ -55,15 +55,21 @@ Source maps, module layers, compiler metadata, and watched package manifests
55
55
  are preserved in both modes. Worker startup has a fixed cost, so very small
56
56
  builds may be faster with `parallel: false`.
57
57
 
58
- Set `strong: true` to reject state updates during rendering, state updates from
59
- effects, and ref writes during rendering in your application code:
58
+ Set `strong: true` to opt application code into Strong mode's immutable
59
+ render-snapshot and pure-render contract. The compiler rejects detectable state,
60
+ ref, Effect Event, snapshot-mutation, and nondeterministic-render violations;
61
+ production client builds condition memoization on the author's assertion that
62
+ every user-authored render operation is pure for its witnessed inputs. Callee
63
+ shape and `use*` spelling do not disable that optimization:
60
64
 
61
65
  ```js
62
66
  new OctaneRspackPlugin({ strong: true });
63
67
  ```
64
68
 
65
- Dependencies keep their existing behavior. Any module can opt in on its own by
66
- putting `"use strong"` before its imports.
69
+ Dependencies keep their existing compatibility behavior. Any module can opt in
70
+ on its own by putting `"use strong"` before its imports. Strong analysis is
71
+ bounded: unknown calls are assumed pure, so live accessors must remain in a
72
+ compatibility-mode consumer or receive an actual snapshot.
67
73
 
68
74
  The experimental `renderers` option accepts the same declarative registry,
69
75
  filename rules, and module/export boundary metadata as `compiler.renderers` in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/rspack-plugin",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@rspack/core": "^2.0.0",
48
- "octane": "0.1.47"
48
+ "octane": "0.1.49"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@rspack/core": "^2.1.4",
@@ -54,7 +54,7 @@
54
54
  "css-loader": "6.11.0",
55
55
  "jsdom": "^30.0.1",
56
56
  "vitest": "^4.1.10",
57
- "octane": "0.1.47"
57
+ "octane": "0.1.49"
58
58
  },
59
59
  "scripts": {
60
60
  "test": "vitest run --config vitest.config.js"
package/src/loader.js CHANGED
@@ -118,6 +118,7 @@ export default function octaneLoader(source, inputSourceMap) {
118
118
  root,
119
119
  profile,
120
120
  ...(options.strong === undefined ? null : { strong: options.strong }),
121
+ ...(options.nativeReads === undefined ? null : { nativeReads: options.nativeReads }),
121
122
  ...(options.exclude === undefined ? null : { exclude: options.exclude }),
122
123
  ...(compilerOptions.renderers === undefined
123
124
  ? null
package/src/plugin.js CHANGED
@@ -177,6 +177,7 @@ function createDiscoveryCompiler(options, root, profile, specialization) {
177
177
  root,
178
178
  profile,
179
179
  ...(options.strong === undefined ? null : { strong: options.strong }),
180
+ ...(options.nativeReads === undefined ? null : { nativeReads: options.nativeReads }),
180
181
  ...(options.exclude === undefined ? null : { exclude: options.exclude }),
181
182
  ...(renderers === undefined ? null : { renderers }),
182
183
  ...(universalRuntime === undefined ? null : { universalRuntime }),
@@ -367,6 +368,7 @@ export class OctaneRspackPlugin {
367
368
  dev,
368
369
  profile,
369
370
  strong: this.options.strong === true,
371
+ nativeReads: this.options.nativeReads === true,
370
372
  exclude: this.options.exclude ?? [],
371
373
  renderers: this.options.renderers?.signature,
372
374
  runtime: this.options.runtime,
@@ -407,6 +409,9 @@ export class OctaneRspackPlugin {
407
409
  environment,
408
410
  profile,
409
411
  ...(this.options.strong === undefined ? null : { strong: this.options.strong }),
412
+ ...(this.options.nativeReads === undefined
413
+ ? null
414
+ : { nativeReads: this.options.nativeReads }),
410
415
  ...(this.options.hmr === undefined ? null : { hmr: this.options.hmr }),
411
416
  ...(this.options.dev === undefined ? null : { dev: this.options.dev }),
412
417
  ...(this.options.exclude === undefined ? null : { exclude: this.options.exclude }),
package/src/shared.js CHANGED
@@ -41,6 +41,7 @@ const LOADER_OPTION_KEYS = new Set([
41
41
  'dev',
42
42
  'profile',
43
43
  'strong',
44
+ 'nativeReads',
44
45
  'exclude',
45
46
  'renderers',
46
47
  'requireDirective',
@@ -208,6 +209,7 @@ function normalizeOptions(value, plugin) {
208
209
  assertBooleanOption(options, 'dev');
209
210
  assertBooleanOption(options, 'profile');
210
211
  assertBooleanOption(options, 'strong');
212
+ assertBooleanOption(options, 'nativeReads');
211
213
  assertBooleanOption(options, 'requireDirective');
212
214
  if (
213
215
  options.exclude !== undefined &&
@@ -239,6 +241,7 @@ function normalizeOptions(value, plugin) {
239
241
  ...(options.dev === undefined ? null : { dev: options.dev }),
240
242
  ...(options.profile === undefined ? null : { profile: options.profile }),
241
243
  ...(options.strong === undefined ? null : { strong: options.strong }),
244
+ ...(options.nativeReads === undefined ? null : { nativeReads: options.nativeReads }),
242
245
  ...(options.exclude === undefined ? null : { exclude: [...options.exclude] }),
243
246
  ...(renderers === undefined ? null : { renderers }),
244
247
  ...(universalRuntime === undefined ? null : { universalRuntime }),
package/types/index.d.ts CHANGED
@@ -138,11 +138,14 @@ export interface OctaneRspackLoaderOptions {
138
138
  /** Emit client profiling metadata and enable the profiling runtime. Default `false`. */
139
139
  profile?: boolean;
140
140
  /**
141
- * Enable Strong-mode compiler rules for project-owned modules. Dependencies
142
- * remain compatible unless their own module begins with `"use strong"`.
141
+ * Assert pure immutable-snapshot renders and enable Strong-mode compiler
142
+ * checks for project-owned modules. Dependencies remain compatible unless
143
+ * their own module begins with `"use strong"`.
143
144
  * @default false
144
145
  */
145
146
  strong?: boolean;
147
+ /** Experimental native signal reads in DOM client/server render scopes. */
148
+ nativeReads?: boolean;
146
149
  /**
147
150
  * Path fragments excluded from the plain `.ts`/`.js` hook-slot pass. With
148
151
  * `requireDirective`, excluded paths are exempt from Octane ownership