@reckona/mreact-router 0.0.127 → 0.0.129

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/dist/client.js CHANGED
@@ -706,7 +706,12 @@ function isStyleModuleSpecifier(source) {
706
706
  }
707
707
  const styleModuleExtensions = new Set([".css", ".less", ".sass", ".scss", ".styl", ".stylus"]);
708
708
  function isClientBoundaryFallbackEligibleSource(source) {
709
- return !/\bon[A-Z][A-Za-z0-9_$]*\s*=/u.test(source) && !/\bglobalThis\b/u.test(source);
709
+ const sourceWithoutComponentCallbackProps = source.replaceAll(/<[A-Z][A-Za-z0-9_$.]*(?:\s[\s\S]*?)?>/gu, (tag) => tag.replaceAll(/\s+on[A-Z][A-Za-z0-9_$]*\s*=\s*\{[^{}]*\}/gu, ""));
710
+ const sourceWithoutGuardedUndefinedCallbacks = sourceWithoutComponentCallbackProps
711
+ .replaceAll(/\bon[A-Z][A-Za-z0-9_$]*\s*=\s*\{\s*props\.[A-Za-z_$][\w$]*\s*===\s*undefined\s*\?\s*undefined\s*:/gu, "")
712
+ .replaceAll(/\bon[A-Z][A-Za-z0-9_$]*\s*=\s*\{\s*props\.[A-Za-z_$][\w$]*\s*\?\s*[^{}]*:\s*undefined\s*\}/gu, "");
713
+ return (!/\bon[A-Z][A-Za-z0-9_$]*\s*=/u.test(sourceWithoutGuardedUndefinedCallbacks) &&
714
+ !/\bglobalThis\b/u.test(source));
710
715
  }
711
716
  function renderedImportedExportNames(reference, componentRoots) {
712
717
  if (reference.sideEffect) {