Skip to content

Instantly share code, notes, and snippets.

@thomasballinger
Created November 5, 2024 00:37
Show Gist options
  • Save thomasballinger/29f856a160ab55f6d8cadc13cf9fc657 to your computer and use it in GitHub Desktop.
Save thomasballinger/29f856a160ab55f6d8cadc13cf9fc657 to your computer and use it in GitHub Desktop.
--- left.html 2024-11-04 16:36:50
+++ right.html 2024-11-04 16:36:50
@@ -1,79 +1,22 @@
<head>
<meta name="tsr-meta" />
<title>TanStack Start Starter</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/_build/app/styles/app.css" />
- <script class="tsr-once">
- __TSR__ = {
- matches: [],
- streamedValues: {},
- initMatch: (index) => {
- Object.entries(__TSR__.matches[index].extracted).forEach(([id, ex]) => {
- if (ex.type === "stream") {
- let controller;
- ex.value = new ReadableStream({
- start(c) {
- controller = c;
- },
- });
- ex.value.controller = controller;
- } else if (ex.type === "promise") {
- let r, j;
- ex.value = new Promise((r_, j_) => {
- (r = r_), (j = j_);
- });
- ex.resolve = r;
- ex.reject = j;
- }
- });
- },
- cleanScripts: () => {
- document.querySelectorAll(".tsr-once").forEach((el) => {
- el.remove();
- });
- },
- };
- </script>
- <script class="tsr-once">
- __TSR__.dehydrated =
- '{"router":{"state":{"dehydratedMatches":[{"id":"__root__","status":"success","updatedAt":1730766916508,"error":{"$undefined":""}},{"id":"/","status":"success","updatedAt":1730766916508,"error":{"$undefined":""}}]},"manifest":{"routes":{"__root__":{"preloads":{"$undefined":""},"assets":[{"tag":"script","children":"window.__vite_plugin_react_preamble_installed__ = true"},{"tag":"script","attrs":{"src":"/_build/@fs/Users/tomb/start-repro/app/client.tsx","type":"module","async":true,"suppressHydrationWarning":true}}]}}}},"payload":{"$undefined":""}}';
- console.info(`Injected From Server:
-__TSR__.dehydrated = "{\"router\":{\"state\":{\"dehydratedMatches\":[{\"id\":\"__root__\",\"status\":\"success\",\"updatedAt\":1730766916508,\"error\":{\"$undefined\":\"\"}},{\"id\":\"/\",\"status\":\"success\",\"updatedAt\":1730766916508,\"error\":{\"$undefined\":\"\"}}]},\"manifest\":{\"routes\":{\"__root__\":{\"preloads\":{\"$undefined\":\"\"},\"assets\":[{\"tag\":\"script\",\"children\":\"window.__vite_plugin_react_preamble_installed__ = true\"},{\"tag\":\"script\",\"attrs\":{\"src\":\"/_build/@fs/Users/tomb/start-repro/app/client.tsx\",\"type\":\"module\",\"async\":true,\"suppressHydrationWarning\":true}}]}}}},\"payload\":{\"$undefined\":\"\"}}"`);
- </script>
<meta name="/tsr-meta" />
</head>
<body>
<div id="root">
- <!--$--><button type="button">Add 1?</button>
- <script class="tsr-once">
- __TSR__.matches[1] = {
- __beforeLoadContext: "{}",
- loaderData: '{"$undefined":""}',
- extracted: {},
- };
- __TSR__.initMatch(1);
- console.info(`Injected From Server:
-__TSR__.matches[1] = {"__beforeLoadContext":"{}","loaderData":"{\"$undefined\":\"\"}","extracted":{}}; __TSR__.initMatch(1)`);
- </script>
- <!--/$-->
+ <!--$--><button type="button">Add 1?</button
+ ><!--/$-->
<script>
window.__vite_plugin_react_preamble_installed__ = true;
</script>
<script
src="/_build/@fs/Users/tomb/start-repro/app/client.tsx"
type="module"
async=""
></script>
</div>
- <script class="tsr-once">
- __TSR__.matches[0] = {
- __beforeLoadContext: "{}",
- loaderData: '{"$undefined":""}',
- extracted: {},
- };
- __TSR__.initMatch(0);
- console.info(`Injected From Server:
-__TSR__.matches[0] = {"__beforeLoadContext":"{}","loaderData":"{\"$undefined\":\"\"}","extracted":{}}; __TSR__.initMatch(0)`);
- </script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment