@askrjs/askr 0.0.7 → 0.0.9

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.
@@ -1,4 +1,4 @@
1
- import { P as Props, J as JSXElement } from '../jsx-AzPM8gMS.js';
1
+ import { P as Props, J as JSXElement } from '../jsx-CSWf4VFg.js';
2
2
  import { b as RouteHandler } from '../router-DaGtH1Sq.js';
3
3
 
4
4
  /**
package/dist/ssr/index.js CHANGED
@@ -347,6 +347,10 @@ function isSchedulerExecuting() {
347
347
  return globalScheduler.isExecuting();
348
348
  }
349
349
 
350
+ // src/common/jsx.ts
351
+ var ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("askr.element");
352
+ var Fragment = /* @__PURE__ */ Symbol.for("askr.fragment");
353
+
350
354
  // src/runtime/context.ts
351
355
  var CONTEXT_FRAME_SYMBOL = /* @__PURE__ */ Symbol("__tempoContextFrame__");
352
356
  var currentContextFrame = null;
@@ -363,7 +367,7 @@ function getCurrentContextFrame() {
363
367
  return currentContextFrame;
364
368
  }
365
369
 
366
- // src/renderer/diag/index.ts
370
+ // src/renderer/diag.ts
367
371
  function getDiagMap() {
368
372
  try {
369
373
  const root = globalThis;
@@ -665,10 +669,6 @@ function isKeyedReorderFastPathEligible(parent, newChildren, oldKeyMap) {
665
669
  };
666
670
  }
667
671
 
668
- // src/common/jsx.ts
669
- var ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("askr.element");
670
- var Fragment = /* @__PURE__ */ Symbol.for("askr.fragment");
671
-
672
672
  // src/runtime/dev-namespace.ts
673
673
  function getDevNamespace() {
674
674
  if (process.env.NODE_ENV === "production") return {};
@@ -1032,6 +1032,20 @@ function removeAllListeners(root) {
1032
1032
 
1033
1033
  // src/renderer/dom.ts
1034
1034
  var IS_DOM_AVAILABLE = typeof document !== "undefined";
1035
+ var fallbackComponentInstanceId = 0;
1036
+ function nextComponentInstanceId() {
1037
+ const key = "__COMPONENT_INSTANCE_ID";
1038
+ try {
1039
+ __ASKR_incCounter(key);
1040
+ const root = globalThis;
1041
+ const diag = root.__ASKR_DIAG;
1042
+ const n = diag ? diag[key] : void 0;
1043
+ if (typeof n === "number" && Number.isFinite(n)) return `comp-${n}`;
1044
+ } catch {
1045
+ }
1046
+ fallbackComponentInstanceId++;
1047
+ return `comp-${fallbackComponentInstanceId}`;
1048
+ }
1035
1049
  function addTrackedListener(el, eventName, handler) {
1036
1050
  const wrappedHandler = createWrappedHandler(handler, true);
1037
1051
  const options = getPassiveOptions(eventName);
@@ -1209,7 +1223,7 @@ function createComponentElement(node, type, props) {
1209
1223
  let childInstance = node.__instance;
1210
1224
  if (!childInstance) {
1211
1225
  childInstance = createComponentInstance(
1212
- `comp-${Math.random().toString(36).slice(2, 7)}`,
1226
+ nextComponentInstanceId(),
1213
1227
  componentFn,
1214
1228
  props || {},
1215
1229
  null