-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
4,792 additions
and
255 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
.yarn/patches/@tanstack-react-router-npm-1.91.3-8e077b923e.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
diff --git a/dist/cjs/router.cjs b/dist/cjs/router.cjs | ||
index 540b3d44e8a7163e9c6ff6063002c046e497149c..db9db4fcf5dbf81ec49f4027bb5875855f1cdb49 100644 | ||
--- a/dist/cjs/router.cjs | ||
+++ b/dist/cjs/router.cjs | ||
@@ -1442,7 +1442,7 @@ ${script}\`)` : ""}; if (typeof __TSR__ !== 'undefined') __TSR__.cleanScripts()< | ||
!this.streamedKeys.has(key), | ||
"Key has already been streamed: " + key | ||
); | ||
- this.streamedKeys.add(key); | ||
+ this.emit({ type: 'onStreamedValue', key }); | ||
this.injectScript( | ||
`__TSR__.streamedValues['${key}'] = { value: ${(_a = this.serializer) == null ? void 0 : _a.call(this, this.options.transformer.stringify(value))}}` | ||
); | ||
@@ -1495,7 +1495,12 @@ ${script}\`)` : ""}; if (typeof __TSR__ !== 'undefined') __TSR__.cleanScripts()< | ||
}); | ||
if (typeof document !== "undefined") { | ||
window.__TSR__ROUTER__ = this; | ||
+ this.streamedKeys = new Set( | ||
+ Object.keys(window.__TSR__?.streamedValues || {}), | ||
+ ); | ||
} | ||
+ | ||
+ this.subscribe('onStreamedValue', ({ key }) => this.streamedKeys.add(key)); | ||
} | ||
get state() { | ||
return this.__store.state; | ||
diff --git a/dist/esm/router.d.ts b/dist/esm/router.d.ts | ||
index 2c52a521d9ac164e395c128e1749448cd166f620..7b98a7ed3ea6e9aaa86100fa0a00b895d2a39b30 100644 | ||
--- a/dist/esm/router.d.ts | ||
+++ b/dist/esm/router.d.ts | ||
@@ -472,6 +472,10 @@ export type RouterEvents = { | ||
pathChanged: boolean; | ||
hrefChanged: boolean; | ||
}; | ||
+ onStreamedValue: { | ||
+ type: 'onStreamedValue' | ||
+ key: string | ||
+ }; | ||
}; | ||
export type RouterEvent = RouterEvents[keyof RouterEvents]; | ||
export type RouterListener<TRouterEvent extends RouterEvent> = { | ||
diff --git a/dist/esm/router.js b/dist/esm/router.js | ||
index 88e500ca78d521c4ab2041c7c42367dee4526b54..ca0381faa1fbd950abf2d9185420ec1a43c10dc6 100644 | ||
--- a/dist/esm/router.js | ||
+++ b/dist/esm/router.js | ||
@@ -1440,7 +1440,7 @@ ${script}\`)` : ""}; if (typeof __TSR__ !== 'undefined') __TSR__.cleanScripts()< | ||
!this.streamedKeys.has(key), | ||
"Key has already been streamed: " + key | ||
); | ||
- this.streamedKeys.add(key); | ||
+ this.emit({ type: 'onStreamedValue', key }) | ||
this.injectScript( | ||
`__TSR__.streamedValues['${key}'] = { value: ${(_a = this.serializer) == null ? void 0 : _a.call(this, this.options.transformer.stringify(value))}}` | ||
); | ||
@@ -1493,7 +1493,11 @@ ${script}\`)` : ""}; if (typeof __TSR__ !== 'undefined') __TSR__.cleanScripts()< | ||
}); | ||
if (typeof document !== "undefined") { | ||
window.__TSR__ROUTER__ = this; | ||
+ this.streamedKeys = new Set( | ||
+ Object.keys(window.__TSR__?.streamedValues || {}), | ||
+ ); | ||
} | ||
+ this.subscribe('onStreamedValue', ({ key }) => this.streamedKeys.add(key)) | ||
} | ||
get state() { | ||
return this.__store.state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/dist/cjs/client/Meta.cjs b/dist/cjs/client/Meta.cjs | ||
index 2495f0e4597b6e75470af5b8c8d33fc32a68e699..c96fb28d719fc018a0c11e9136736f455bc8c685 100644 | ||
--- a/dist/cjs/client/Meta.cjs | ||
+++ b/dist/cjs/client/Meta.cjs | ||
@@ -118,7 +118,7 @@ const useMetaElements = () => { | ||
reactRouter.ScriptOnce, | ||
{ | ||
log: false, | ||
- children: `__TSR__={matches:[],streamedValues:{},queue:[],runQueue:()=>{let e=!1;__TSR__.queue=__TSR__.queue.filter((_=>!_()||(e=!0,!1))),e&&__TSR__.runQueue()},initMatch:e=>{__TSR__.queue.push((()=>(__TSR__.matches[e.index]||(__TSR__.matches[e.index]=e,Object.entries(e.extracted).forEach((([e,_])=>{if("stream"===_.type){let e;_.value=new ReadableStream({start(_){e=_}}),_.value.controller=e}else if("promise"===_.type){let e,t;_.value=new Promise(((_,u)=>{e=_,t=u})),_.resolve=e,_.reject=t}}))),!0))),__TSR__.runQueue()},resolvePromise:e=>{__TSR__.queue.push((()=>{const _=__TSR__.matches[e.matchIndex];if(_){const t=_.extracted[e.id];if(t)return t.resolve(e.value.data),!0}return!1})),__TSR__.runQueue()},cleanScripts:()=>{document.querySelectorAll(".tsr-once").forEach((e=>{e.remove()}))}};` | ||
+ children: `__TSR__={matches:[],streamedValues:new Proxy({},{set(e,_,t){const r=Reflect.set(e,_,t);return window.__TSR__ROUTER__&&__TSR__ROUTER__.emit({type:"onStreamedValue",key:_}),r}}),queue:[],runQueue:()=>{let e=!1;__TSR__.queue=__TSR__.queue.filter((_=>!_()||(e=!0,!1))),e&&__TSR__.runQueue()},initMatch:e=>{__TSR__.queue.push((()=>(__TSR__.matches[e.index]||(__TSR__.matches[e.index]=e,Object.entries(e.extracted).forEach((([e,_])=>{if("stream"===_.type){let e;_.value=new ReadableStream({start(_){e=_}}),_.value.controller=e}else if("promise"===_.type){let e,t;_.value=new Promise(((_,u)=>{e=_,t=u})),_.resolve=e,_.reject=t}}))),!0))),__TSR__.runQueue()},resolvePromise:e=>{__TSR__.queue.push((()=>{const _=__TSR__.matches[e.matchIndex];if(_){const t=_.extracted[e.id];if(t)return t.resolve(e.value.data),!0}return!1})),__TSR__.runQueue()},cleanScripts:()=>{document.querySelectorAll(".tsr-once").forEach((e=>{e.remove()}))}};` | ||
} | ||
), | ||
/* @__PURE__ */ jsxRuntime.jsx( | ||
diff --git a/dist/esm/client/Meta.js b/dist/esm/client/Meta.js | ||
index bb69cd494686acbc26c9a6ec409e8ba8c36436a3..d7add4aaeb87f6ff7550802b9afbd59e468551d4 100644 | ||
--- a/dist/esm/client/Meta.js | ||
+++ b/dist/esm/client/Meta.js | ||
@@ -100,7 +100,7 @@ const useMetaElements = () => { | ||
ScriptOnce, | ||
{ | ||
log: false, | ||
- children: `__TSR__={matches:[],streamedValues:{},queue:[],runQueue:()=>{let e=!1;__TSR__.queue=__TSR__.queue.filter((_=>!_()||(e=!0,!1))),e&&__TSR__.runQueue()},initMatch:e=>{__TSR__.queue.push((()=>(__TSR__.matches[e.index]||(__TSR__.matches[e.index]=e,Object.entries(e.extracted).forEach((([e,_])=>{if("stream"===_.type){let e;_.value=new ReadableStream({start(_){e=_}}),_.value.controller=e}else if("promise"===_.type){let e,t;_.value=new Promise(((_,u)=>{e=_,t=u})),_.resolve=e,_.reject=t}}))),!0))),__TSR__.runQueue()},resolvePromise:e=>{__TSR__.queue.push((()=>{const _=__TSR__.matches[e.matchIndex];if(_){const t=_.extracted[e.id];if(t)return t.resolve(e.value.data),!0}return!1})),__TSR__.runQueue()},cleanScripts:()=>{document.querySelectorAll(".tsr-once").forEach((e=>{e.remove()}))}};` | ||
+ children: `__TSR__={matches:[],streamedValues:new Proxy({},{set(e,_,t){const r=Reflect.set(e,_,t);return window.__TSR__ROUTER__&&__TSR__ROUTER__.emit({type:"onStreamedValue",key:_}),r}}),queue:[],runQueue:()=>{let e=!1;__TSR__.queue=__TSR__.queue.filter((_=>!_()||(e=!0,!1))),e&&__TSR__.runQueue()},initMatch:e=>{__TSR__.queue.push((()=>(__TSR__.matches[e.index]||(__TSR__.matches[e.index]=e,Object.entries(e.extracted).forEach((([e,_])=>{if("stream"===_.type){let e;_.value=new ReadableStream({start(_){e=_}}),_.value.controller=e}else if("promise"===_.type){let e,t;_.value=new Promise(((_,u)=>{e=_,t=u})),_.resolve=e,_.reject=t}}))),!0))),__TSR__.runQueue()},resolvePromise:e=>{__TSR__.queue.push((()=>{const _=__TSR__.matches[e.matchIndex];if(_){const t=_.extracted[e.id];if(t)return t.resolve(e.value.data),!0}return!1})),__TSR__.runQueue()},cleanScripts:()=>{document.querySelectorAll(".tsr-once").forEach((e=>{e.remove()}))}};` | ||
} | ||
), | ||
/* @__PURE__ */ jsx( |
94 changes: 0 additions & 94 deletions
94
integration-test/.yarn/patches/react-router-npm-7.0.2-b96f2bd13c.patch
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.