* fix(react-router): prevent hydration warning for async/defer scripts
Strip async, defer, and src attributes from script tags during client-side hydration to match the server-rendered output and prevent React hydration mismatch warnings.
* test(react-router): add unit and e2e tests for async script hydration
Adds unit tests to verify server output includes async/defer attributes, and e2e tests to verify no hydration warnings occur on the client.
---------
Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de>
* fix: preserve data script content during client hydration
The Script component renders all <script> tags with empty content on
the client side, then uses useEffect to recreate them via DOM
manipulation. While necessary for executable scripts (they need
document.createElement to trigger execution), this causes data-only
scripts like application/ld+json to briefly flash empty during
hydration.
Per the HTML spec, any script with a type that isn't a JavaScript MIME
type or "module" is a "data block" that the browser never executes.
These can safely render their content directly via innerHTML on both
server and client, just like <style> tags already do in the same file.
Changes across react-router, solid-router, and vue-router:
- Detect non-executable script types via the type attribute
- Early-return in the client-side effect for data scripts
- Render data script content directly instead of emptying it
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: optimize match retrieval by using a Map for previous matches
* feat: add strict false parameter handling and related routes
* replace params only when routeParams is fully parsed
---------
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>