octane 0.2.0 → 0.2.1

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.
@@ -10296,12 +10296,12 @@ function reportListenerError(err) {
10296
10296
  console.error(err);
10297
10297
  }
10298
10298
  function maybeFlushDiscrete(type) {
10299
- if (_dispatchDepth === 0 && DISCRETE_EVENTS.has(type)) {
10299
+ if (_dispatchDepth === 0 && DISCRETE_EVENTS.has(type) && pendingRestores.length > 0) {
10300
10300
  if (hasPendingWork()) {
10301
10301
  if (VIEW_TRANSITION_DRIVER?.queueAllTransition() === true) flush();
10302
10302
  else flushSync(noop);
10303
10303
  }
10304
- if (pendingRestores.length > 0) restoreControlledStates();
10304
+ restoreControlledStates();
10305
10305
  }
10306
10306
  if (type === "click") activationCheckable = null;
10307
10307
  }
@@ -10833,9 +10833,8 @@ function setValue(el, value) {
10833
10833
  const prev = ctrl.v;
10834
10834
  ctrl.v = value;
10835
10835
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0);
10836
+ if (!(ctrl.composing && Object.is(prev, value)) && valueNeedsWrite(input, value)) input.value = s;
10836
10837
  if (input.defaultValue !== s) input.defaultValue = s;
10837
- if (ctrl.composing && Object.is(prev, value)) return;
10838
- if (valueNeedsWrite(input, value)) input.value = s;
10839
10838
  }
10840
10839
  function setCheckedState(input, value, ctrl) {
10841
10840
  const first = !ctrl.sawC;
@@ -21,7 +21,7 @@ __export(version_exports, {
21
21
  version: () => version
22
22
  });
23
23
  module.exports = __toCommonJS(version_exports);
24
- const version = "0.2.0";
24
+ const version = "0.2.1";
25
25
  // Annotate the CommonJS export names for ESM import in node:
26
26
  0 && (module.exports = {
27
27
  version
package/dist/runtime.d.ts CHANGED
@@ -602,8 +602,9 @@ export declare function setIsOctaneActEnvironment(value: boolean): void;
602
602
  * React-DOM parity. Runs `fn` and synchronously drains any renders/effects it scheduled
603
603
  * before returning. Bypasses the microtask-batched flush — used by the benchmark
604
604
  * timing rig to measure operation wall-clock without microtask coalescing. Also the
605
- * discrete-event commit path: maybeFlushDiscrete flushes through here so
606
- * click/keydown/input handlers commit before the browser regains control.
605
+ * controlled-restore commit path: maybeFlushDiscrete flushes through here at the
606
+ * outermost boundary of a discrete event that armed a controlled `value`/`checked`
607
+ * restore, so the restore compares the DOM against freshly committed state.
607
608
  */
608
609
  export declare function flushSync<T>(fn: () => T): T;
609
610
  /**
package/dist/runtime.js CHANGED
@@ -10130,12 +10130,12 @@ function reportListenerError(err) {
10130
10130
  console.error(err);
10131
10131
  }
10132
10132
  function maybeFlushDiscrete(type) {
10133
- if (_dispatchDepth === 0 && DISCRETE_EVENTS.has(type)) {
10133
+ if (_dispatchDepth === 0 && DISCRETE_EVENTS.has(type) && pendingRestores.length > 0) {
10134
10134
  if (hasPendingWork()) {
10135
10135
  if (VIEW_TRANSITION_DRIVER?.queueAllTransition() === true) flush();
10136
10136
  else flushSync(noop);
10137
10137
  }
10138
- if (pendingRestores.length > 0) restoreControlledStates();
10138
+ restoreControlledStates();
10139
10139
  }
10140
10140
  if (type === "click") activationCheckable = null;
10141
10141
  }
@@ -10667,9 +10667,8 @@ function setValue(el, value) {
10667
10667
  const prev = ctrl.v;
10668
10668
  ctrl.v = value;
10669
10669
  if (process.env.NODE_ENV !== "production") queueDevFormDiagnostic(el, CURRENT_SCOPE ?? void 0);
10670
+ if (!(ctrl.composing && Object.is(prev, value)) && valueNeedsWrite(input, value)) input.value = s;
10670
10671
  if (input.defaultValue !== s) input.defaultValue = s;
10671
- if (ctrl.composing && Object.is(prev, value)) return;
10672
- if (valueNeedsWrite(input, value)) input.value = s;
10673
10672
  }
10674
10673
  function setCheckedState(input, value, ctrl) {
10675
10674
  const first = !ctrl.sawC;
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- const version = "0.2.0";
1
+ const version = "0.2.1";
2
2
  export {
3
3
  version
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octane",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": [