mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 12:52:47 -07:00
feat: polyfill URLSearchParams on the server side (#555)
This commit is contained in:
@@ -31,8 +31,9 @@ function getInitialLocation(
|
|||||||
hash: '',
|
hash: '',
|
||||||
href: serverPayloadLocation.href || '',
|
href: serverPayloadLocation.href || '',
|
||||||
searchStr: serverPayloadLocation.searchStr || '',
|
searchStr: serverPayloadLocation.searchStr || '',
|
||||||
// TODO: Polyfill URLSearchParams
|
search: Object.fromEntries(
|
||||||
search: {},
|
new URLSearchParams(serverPayloadLocation.searchStr),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
"fast-text-encoding": "^1.0.6",
|
"fast-text-encoding": "^1.0.6",
|
||||||
"tuono-fs-router-vite-plugin": "workspace:*",
|
"tuono-fs-router-vite-plugin": "workspace:*",
|
||||||
"tuono-router": "workspace:*",
|
"tuono-router": "workspace:*",
|
||||||
|
"url-search-params-polyfill": "^8.2.5",
|
||||||
"vite": "^5.4.14",
|
"vite": "^5.4.14",
|
||||||
"web-streams-polyfill": "^4.0.0"
|
"web-streams-polyfill": "^4.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
* https://docs.rs/ssr_rs/latest/ssr_rs/struct.Ssr.html#method.add_global_fn
|
* https://docs.rs/ssr_rs/latest/ssr_rs/struct.Ssr.html#method.add_global_fn
|
||||||
*/
|
*/
|
||||||
import 'fast-text-encoding'
|
import 'fast-text-encoding'
|
||||||
|
import 'url-search-params-polyfill'
|
||||||
|
|
||||||
/* eslint-disable import/order, import/newline-after-import */
|
/* eslint-disable import/order, import/newline-after-import */
|
||||||
import { MessageChannelPolyfill } from './polyfills/MessageChannel'
|
import { MessageChannelPolyfill } from './polyfills/MessageChannel'
|
||||||
|
|||||||
Generated
+8
@@ -223,6 +223,9 @@ importers:
|
|||||||
tuono-router:
|
tuono-router:
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../tuono-router
|
version: link:../tuono-router
|
||||||
|
url-search-params-polyfill:
|
||||||
|
specifier: ^8.2.5
|
||||||
|
version: 8.2.5
|
||||||
vite:
|
vite:
|
||||||
specifier: ^5.4.14
|
specifier: ^5.4.14
|
||||||
version: 5.4.14(@types/node@22.13.1)(lightningcss@1.29.1)(sugarss@4.0.1(postcss@8.5.1))
|
version: 5.4.14(@types/node@22.13.1)(lightningcss@1.29.1)(sugarss@4.0.1(postcss@8.5.1))
|
||||||
@@ -3256,6 +3259,9 @@ packages:
|
|||||||
uri-js@4.4.1:
|
uri-js@4.4.1:
|
||||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||||
|
|
||||||
|
url-search-params-polyfill@8.2.5:
|
||||||
|
resolution: {integrity: sha512-FOEojW4XReTmtZOB7xqSHmJZhrNTmClhBriwLTmle4iA7bwuCo6ldSfbtsFSb8bTf3E0a3XpfonAdaur9vqq8A==}
|
||||||
|
|
||||||
use-callback-ref@1.3.3:
|
use-callback-ref@1.3.3:
|
||||||
resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==}
|
resolution: {integrity: sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@@ -7020,6 +7026,8 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.3.1
|
punycode: 2.3.1
|
||||||
|
|
||||||
|
url-search-params-polyfill@8.2.5: {}
|
||||||
|
|
||||||
use-callback-ref@1.3.3(@types/react@19.0.8)(react@19.0.0):
|
use-callback-ref@1.3.3(@types/react@19.0.8)(react@19.0.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
react: 19.0.0
|
react: 19.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user