@markdy/astro 0.7.3 → 0.7.4

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/Markdy.astro +4 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/astro",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "Astro island component for MarkdyScript animations.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@markdy/renderer-dom": "0.7.3"
40
+ "@markdy/renderer-dom": "0.7.4"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "astro": ">=4.0.0"
package/src/Markdy.astro CHANGED
@@ -121,7 +121,7 @@ const {
121
121
  </noscript>
122
122
  </div>
123
123
 
124
- <script is:inline>
124
+ <script is:inline data-cfasync="false">
125
125
  // ── Rocket Loader rescue ──────────────────────────────────────────────────
126
126
  // Cloudflare Rocket Loader rewrites <script type="module" src="..."> in
127
127
  // one of two ways, both of which prevent the hydration logic from running:
@@ -131,8 +131,8 @@ const {
131
131
  // <!--<script type="{uuid}-module" src="..."></script>-->
132
132
  // making it invisible to querySelectorAll.
133
133
  //
134
- // This inline script is NOT touched by Rocket Loader (no src, no type attr).
135
- // It rescues module scripts via two strategies:
134
+ // `data-cfasync="false"` keeps this rescue script executable even when
135
+ // Rocket Loader is active. It rescues module scripts via two strategies:
136
136
  // 1. Query the DOM for type$="-module" + src (covers case A)
137
137
  // 2. Regex-parse the raw HTML for commented-out script tags (covers case B)
138
138
  // Dynamically-created scripts bypass Rocket Loader entirely.
@@ -176,6 +176,7 @@ const {
176
176
  var fix = document.createElement('script');
177
177
  fix.type = 'module';
178
178
  fix.src = src;
179
+ fix.setAttribute('data-cfasync', 'false');
179
180
  document.head.appendChild(fix);
180
181
  });
181
182
  }