toiljs 0.0.7 → 0.0.8

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 (65) hide show
  1. package/build/cli/.tsbuildinfo +1 -1
  2. package/build/cli/configure.d.ts +1 -0
  3. package/build/cli/configure.js +83 -18
  4. package/build/cli/create.d.ts +1 -0
  5. package/build/cli/create.js +14 -3
  6. package/build/cli/features.d.ts +2 -0
  7. package/build/cli/features.js +22 -0
  8. package/build/cli/index.js +8 -0
  9. package/build/client/.tsbuildinfo +1 -1
  10. package/build/client/components/Form.d.ts +12 -0
  11. package/build/client/components/Form.js +23 -0
  12. package/build/client/components/Image.d.ts +13 -0
  13. package/build/client/components/Image.js +22 -0
  14. package/build/client/components/Script.d.ts +13 -0
  15. package/build/client/components/Script.js +68 -0
  16. package/build/client/index.d.ts +10 -2
  17. package/build/client/index.js +5 -1
  18. package/build/client/routing/Router.js +4 -4
  19. package/build/client/routing/action.d.ts +17 -0
  20. package/build/client/routing/action.js +55 -0
  21. package/build/client/routing/hooks.d.ts +1 -0
  22. package/build/client/routing/hooks.js +4 -1
  23. package/build/client/routing/loader.d.ts +8 -2
  24. package/build/client/routing/loader.js +75 -24
  25. package/build/compiler/.tsbuildinfo +1 -1
  26. package/build/compiler/config.d.ts +2 -0
  27. package/build/compiler/config.js +1 -0
  28. package/build/compiler/generate.js +2 -0
  29. package/build/compiler/image-report.d.ts +2 -0
  30. package/build/compiler/image-report.js +62 -0
  31. package/build/compiler/vite.js +8 -0
  32. package/examples/basic/client/components/Header.tsx +38 -0
  33. package/examples/basic/client/components/HoneycombBackground.tsx +86 -18
  34. package/examples/basic/client/global-error.tsx +2 -2
  35. package/examples/basic/client/layout.tsx +2 -33
  36. package/examples/basic/client/public/images/test_image.webp +0 -0
  37. package/examples/basic/client/routes/index.tsx +8 -1
  38. package/examples/basic/client/routes/loader-demo/index.tsx +24 -1
  39. package/examples/basic/client/routes/test.tsx +8 -0
  40. package/examples/basic/client/styles/main.css +48 -1
  41. package/package.json +8 -6
  42. package/presets/eslint.js +4 -4
  43. package/src/cli/configure.ts +98 -17
  44. package/src/cli/create.ts +18 -2
  45. package/src/cli/features.ts +32 -0
  46. package/src/cli/index.ts +9 -0
  47. package/src/client/components/Form.tsx +65 -0
  48. package/src/client/components/Image.tsx +89 -0
  49. package/src/client/components/Script.tsx +113 -0
  50. package/src/client/index.ts +15 -2
  51. package/src/client/routing/Router.tsx +17 -5
  52. package/src/client/routing/action.ts +122 -0
  53. package/src/client/routing/hooks.ts +18 -5
  54. package/src/client/routing/loader.ts +146 -35
  55. package/src/compiler/config.ts +9 -0
  56. package/src/compiler/generate.ts +3 -0
  57. package/src/compiler/image-report.ts +85 -0
  58. package/src/compiler/vite.ts +12 -0
  59. package/test/dom/Image.test.tsx +46 -0
  60. package/test/dom/Script.test.tsx +45 -0
  61. package/test/dom/action.test.tsx +129 -0
  62. package/test/dom/loader.test.tsx +121 -0
  63. package/test/dom/router-loading.test.tsx +44 -0
  64. package/test/features.test.ts +31 -0
  65. package/examples/basic/client/template.tsx +0 -7
@@ -1 +1 @@
1
- {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react/jsx-runtime.d.ts","../../node_modules/@types/react-dom/client.d.ts","../../src/client/navigation/scroll.ts","../../src/client/types.ts","../../src/client/navigation/navigation.ts","../../src/client/routing/match.ts","../../src/client/navigation/prefetch.ts","../../src/client/routing/error-boundary.tsx","../../src/client/routing/loader.ts","../../src/client/routing/params-context.ts","../../src/client/routing/hooks.ts","../../src/client/routing/lazy.ts","../../src/client/routing/router.tsx","../../src/client/routing/mount.tsx","../../src/client/navigation/link.tsx","../../src/client/navigation/navlink.tsx","../../src/client/channel/channel.ts","../../src/client/head/head.ts","../../src/client/index.ts"],"fileIdsList":[[92],[90,91],[92,93],[93,96,97,98,99,101,103,105,106,107,108,109,110],[92,93,96,97,99],[93,95,96],[92,93,103,107],[93,96,98],[93],[92,93,96],[92,93,96,97,98,99,101,102],[92,93,96,97,98],[93,94,96,97,99,105],[92,93,98],[92,93,95,96,97,98,100,101,102,103,104]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"bd7dee3446a5b94651d58000ddfda40296f073e9372891f65003a524b4620697","impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"bc03c3c352f689e38c0ddd50c39b1e65d59273991bfc8858a9e3c0ebb79c023b","impliedFormat":1},{"version":"ee8a149229af2834098b2776d0de116b0ead67ecefb18d06ef9638ad0ebe7286","signature":"2b2db01796f774852b44cacad054f31b9e63a3c4ed787d12c1dd75c75e602bef"},{"version":"3d0fa60fa41b7006654b88d60ca09f0276d63d00f12adaedc87b9a569315dee8","signature":"2fd1e3d213b59f5811462fc92334b3181fc0c4ca81416a2c094a77f9ea767f05"},{"version":"ea409f34b0e9ada29efa6a916d00ccea03b31063bbd5cfbc4296ca79693a6702","signature":"af71906c793629e2fafa484abe4c1da3978fd9473e01320f42b2f37a5510ed8c"},{"version":"4545a2b4483788cc65b488100c61f20ebdb08c22c7344572885ec14826d2f24b","signature":"b9f112f8e9a593f362dd5f434f8f997385dd62f15e2d2fb6d316e5d0d9942a51"},{"version":"488471e75a4cb636dcc2316d57fdd3d8bc51a974bd01488d9c9e9e5a9c7b9d1f","signature":"09d6078412069edc1a6faad02c5846365d560ea26b03f0cd960137bd30ae4df9","affectsGlobalScope":true},{"version":"a8d9211eab44f7cb13502dcd4c3e8499730005cc721e8bcfa50364393dd4930f","signature":"9382f138465c4775c54940f2a3d4334a083a6fc9a622a7c926c5f8233228cbae"},{"version":"79ff21c841f9ff92f33776bae02d6a2ac5c0d788935322db99ecee14b53425c1","signature":"27b266bca63ea07d9ee3b89b1db810edce779ddeb51cefacdd1a8c514466fd06"},{"version":"b823a47f674739ef4f8930b4fc7961da84deed0125827758c3eccf6b0f667943","signature":"c8525f0be940a19f3d03f06b6e43d4bea21ba910db62fb5024ecc671bcc23932"},{"version":"ad676f7fc7e3b420e58878cdd6aa15190a462481ddb571c630093652ee9a3385","signature":"41940ee0ac490301ff33a411c18d7e38dd4db5030e2cdf7774c081574ac4bf91"},{"version":"b344d5ea5bc36bef1134760ef821888da449e01299a7a70251d5655aee8630e9","signature":"c6384012cac726d5b05237d2bd2c9c9da0893feaf54ab1dd0042fe141b9e5bd8"},{"version":"033d63315fb95bf237d50bf43f477afcfd635f48c13deebf499be3dbe2ae1c0a","signature":"dbdc80bc661dfa19a717956262c9d2e8a4cfda54b04eff8f2c80805d04993d07"},{"version":"4f248aff76feaf1251f79b7d33cc8b900746931fcdfce11db4525a5c391e4288","signature":"a893e0340974b84b6e7b17d0b4a810f5f8583453c750afef2712f7c0d03e6a7e"},{"version":"de689459b169728b40b1f74458ad8aa202505424e5f8163fe64c6ee8d83543fc","signature":"5cf43ceac60fba7927af9ce9b27fb6031854fc923263b78c353fb986857218b9"},{"version":"8bec5d913b66865ea88ced047c96b2f048c8343ca8e142e8c37942f6f9d62a35","signature":"0caa217adbbdb001facd9aeb363fa2a446eabbeb4e5af2c1f2c3d1ef4bbffc6e"},{"version":"934d2d6e26d57425550744e36443449d1d1d7e2e5d91e03afb1ca27290d4a158","signature":"bbaa85a96900ee24d770ce38f7807d2d3cc2ca203e223cd4080447680910992e"},{"version":"6ff12fe177bb2840a479ebb97058c5a3307212b75823c62a5229722357e5d843","signature":"931a7114fa2f626f8dfb69c1a932335300d72faf3e231f307976f66a46fc8dae"},{"version":"7aefa32bb563cec35db358fbbc11032273b267222cea678fcef6efd91ed47a1b","signature":"cf149f9c953fb946a052b218c22424d7ebfad7b1f9e6940f1adecd4b5475136a"}],"root":[[95,111]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noImplicitAny":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../../src/client","skipLibCheck":true,"sourceMap":false,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"suppressImplicitAnyIndexErrors":false,"target":99,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[94,1],[92,2],[93,1],[109,3],[110,3],[111,4],[107,5],[97,6],[108,7],[99,8],[95,9],[100,10],[103,11],[104,10],[101,12],[98,9],[106,13],[102,14],[105,15],[96,3]],"version":"6.0.3"}
1
+ {"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/react/index.d.ts","../../node_modules/@types/react/jsx-runtime.d.ts","../../node_modules/@types/react-dom/client.d.ts","../../src/client/navigation/scroll.ts","../../src/client/types.ts","../../src/client/navigation/navigation.ts","../../src/client/routing/match.ts","../../src/client/navigation/prefetch.ts","../../src/client/routing/error-boundary.tsx","../../src/client/routing/loader.ts","../../src/client/routing/params-context.ts","../../src/client/routing/hooks.ts","../../src/client/routing/lazy.ts","../../src/client/routing/router.tsx","../../src/client/routing/mount.tsx","../../src/client/navigation/link.tsx","../../src/client/navigation/navlink.tsx","../../src/client/routing/action.ts","../../src/client/channel/channel.ts","../../src/client/head/head.ts","../../src/client/components/image.tsx","../../src/client/components/script.tsx","../../src/client/components/form.tsx","../../src/client/index.ts"],"fileIdsList":[[92],[90,91],[92,93],[92,93,109],[93,96,97,98,99,101,103,105,106,107,108,109,110,111,112,113,114],[92,93,96,97,99],[93,95,96],[92,93,103,107],[93,96,98],[93],[92,93,96,97,101],[92,93,96],[92,93,96,97,98,99,101,102],[92,93,96,97,98],[93,94,96,97,99,105],[92,93,98],[92,93,95,96,97,98,100,101,102,103,104]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"bd7dee3446a5b94651d58000ddfda40296f073e9372891f65003a524b4620697","impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"bc03c3c352f689e38c0ddd50c39b1e65d59273991bfc8858a9e3c0ebb79c023b","impliedFormat":1},{"version":"ee8a149229af2834098b2776d0de116b0ead67ecefb18d06ef9638ad0ebe7286","signature":"2b2db01796f774852b44cacad054f31b9e63a3c4ed787d12c1dd75c75e602bef"},{"version":"3d0fa60fa41b7006654b88d60ca09f0276d63d00f12adaedc87b9a569315dee8","signature":"2fd1e3d213b59f5811462fc92334b3181fc0c4ca81416a2c094a77f9ea767f05"},{"version":"ea409f34b0e9ada29efa6a916d00ccea03b31063bbd5cfbc4296ca79693a6702","signature":"af71906c793629e2fafa484abe4c1da3978fd9473e01320f42b2f37a5510ed8c"},{"version":"4545a2b4483788cc65b488100c61f20ebdb08c22c7344572885ec14826d2f24b","signature":"b9f112f8e9a593f362dd5f434f8f997385dd62f15e2d2fb6d316e5d0d9942a51"},{"version":"488471e75a4cb636dcc2316d57fdd3d8bc51a974bd01488d9c9e9e5a9c7b9d1f","signature":"09d6078412069edc1a6faad02c5846365d560ea26b03f0cd960137bd30ae4df9","affectsGlobalScope":true},{"version":"a8d9211eab44f7cb13502dcd4c3e8499730005cc721e8bcfa50364393dd4930f","signature":"9382f138465c4775c54940f2a3d4334a083a6fc9a622a7c926c5f8233228cbae"},{"version":"48b72452838a189ca2f928927fa9c17777c7d89852e125a08aa8b0bc2cf2ad47","signature":"747324aaf734f8e99673251852fe29a3c3381d20263110c8576cdd898230a266"},{"version":"b823a47f674739ef4f8930b4fc7961da84deed0125827758c3eccf6b0f667943","signature":"c8525f0be940a19f3d03f06b6e43d4bea21ba910db62fb5024ecc671bcc23932"},{"version":"d001f2aae787f69f958392389c38c8aea5aab5a2aa5831bf2215e0e5db99c11e","signature":"b47403a7e6e239e43bf3b91e224e38b4c8345da2dc9967a2a1682996e1d48829"},{"version":"b344d5ea5bc36bef1134760ef821888da449e01299a7a70251d5655aee8630e9","signature":"c6384012cac726d5b05237d2bd2c9c9da0893feaf54ab1dd0042fe141b9e5bd8"},{"version":"d5212baa998c24885698a44c9e29921a9b7f35aa92c0857474a9007133404006","signature":"dbdc80bc661dfa19a717956262c9d2e8a4cfda54b04eff8f2c80805d04993d07"},{"version":"4f248aff76feaf1251f79b7d33cc8b900746931fcdfce11db4525a5c391e4288","signature":"a893e0340974b84b6e7b17d0b4a810f5f8583453c750afef2712f7c0d03e6a7e"},{"version":"de689459b169728b40b1f74458ad8aa202505424e5f8163fe64c6ee8d83543fc","signature":"5cf43ceac60fba7927af9ce9b27fb6031854fc923263b78c353fb986857218b9"},{"version":"8bec5d913b66865ea88ced047c96b2f048c8343ca8e142e8c37942f6f9d62a35","signature":"0caa217adbbdb001facd9aeb363fa2a446eabbeb4e5af2c1f2c3d1ef4bbffc6e"},{"version":"cca844d294831408ec1269c3d2f367d4f3da259d1851a3b1c6c0a87093d7987f","signature":"63bfd9f3fbbcb2dc649dd7303b9fdcf5680c25e217228a5abe005674bfc8bed5"},{"version":"934d2d6e26d57425550744e36443449d1d1d7e2e5d91e03afb1ca27290d4a158","signature":"bbaa85a96900ee24d770ce38f7807d2d3cc2ca203e223cd4080447680910992e"},{"version":"6ff12fe177bb2840a479ebb97058c5a3307212b75823c62a5229722357e5d843","signature":"931a7114fa2f626f8dfb69c1a932335300d72faf3e231f307976f66a46fc8dae"},{"version":"164fad8076ddd5a6ca1946833d1954527c89561a376eedc4fdd77d93392bf08c","signature":"7302ddfa6ab62295a7ad2cf47cc8b933be587d161d5b818aba3e85d7af69e59e"},{"version":"07d127d354b0ac23001be1d7da278808dcc1eb946687dbe52f9fdafc8baa1814","signature":"d9ce1372a43589027af010d0293b17099bf27089071c6d12ce30eb94b70191af"},{"version":"36476bcec886e34db96d7492ace860b96c4ff4ccc423b98f9e31642bf18c18c1","signature":"dbb3eab27a108491f80873c1031ddc0b1a16c47f4c32e2ec2e70b83e9cee161b"},{"version":"824cbbc35c14dbb3dfbea292095e46f573634bccdd7f8677bc4afab30bd86ce4","signature":"169287adf0b0076e06229d3c651255a3cd8bb819d71b99f9763e7288c8c37908"}],"root":[[95,115]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noImplicitAny":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../../src/client","skipLibCheck":true,"sourceMap":false,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"suppressImplicitAnyIndexErrors":false,"target":99,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[94,1],[92,2],[93,1],[110,3],[114,4],[112,3],[113,3],[111,3],[115,5],[107,6],[97,7],[108,8],[99,9],[95,10],[109,11],[100,12],[103,13],[104,12],[101,14],[98,10],[106,15],[102,16],[105,17],[96,3]],"version":"6.0.3"}
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type ActionState, type RevalidateTarget } from '../routing/action.js';
3
+ export interface FormProps {
4
+ action: (data: FormData) => void | Promise<void>;
5
+ revalidate?: RevalidateTarget;
6
+ onSuccess?: () => void;
7
+ onError?: (error: unknown) => void;
8
+ resetOnSuccess?: boolean;
9
+ className?: string;
10
+ children?: ReactNode | ((state: ActionState<void>) => ReactNode);
11
+ }
12
+ export declare function Form({ action, revalidate, onSuccess, onError, resetOnSuccess, className, children, }: FormProps): ReactNode;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { useAction } from '../routing/action.js';
4
+ export function Form({ action, revalidate, onSuccess, onError, resetOnSuccess = false, className, children, }) {
5
+ const formRef = useRef(null);
6
+ const handle = useAction((data) => action(data), {
7
+ revalidate,
8
+ onError,
9
+ onSuccess: () => {
10
+ if (resetOnSuccess)
11
+ formRef.current?.reset();
12
+ onSuccess?.();
13
+ },
14
+ });
15
+ const onSubmit = (event) => {
16
+ event.preventDefault();
17
+ formRef.current = event.currentTarget;
18
+ void handle.run(new FormData(event.currentTarget));
19
+ };
20
+ return (_jsx("form", { ref: formRef, className: className, onSubmit: onSubmit, children: typeof children === 'function'
21
+ ? children({ pending: handle.pending, error: handle.error, data: handle.data })
22
+ : children }));
23
+ }
@@ -0,0 +1,13 @@
1
+ import { type CSSProperties, type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export interface ImageProps extends Omit<ComponentPropsWithRef<'img'>, 'loading' | 'placeholder' | 'width' | 'height'> {
3
+ src: string;
4
+ alt: string;
5
+ width?: number;
6
+ height?: number;
7
+ fill?: boolean;
8
+ objectFit?: CSSProperties['objectFit'];
9
+ priority?: boolean;
10
+ placeholder?: 'empty' | 'blur';
11
+ blurDataURL?: string;
12
+ }
13
+ export declare function Image(props: ImageProps): ReactNode;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ export function Image(props) {
4
+ const { src, alt, width, height, fill = false, objectFit, priority = false, placeholder = 'empty', blurDataURL, style, onLoad, ...rest } = props;
5
+ const [loaded, setLoaded] = useState(false);
6
+ const showBlur = placeholder === 'blur' && blurDataURL !== undefined && !loaded;
7
+ const layoutStyle = fill
8
+ ? { position: 'absolute', inset: 0, width: '100%', height: '100%' }
9
+ : {};
10
+ const blurStyle = showBlur
11
+ ? {
12
+ backgroundImage: `url(${blurDataURL})`,
13
+ backgroundSize: 'cover',
14
+ backgroundPosition: 'center',
15
+ filter: 'blur(20px)',
16
+ }
17
+ : {};
18
+ return (_jsx("img", { ...rest, src: src, alt: alt, width: fill ? undefined : width, height: fill ? undefined : height, loading: priority ? 'eager' : 'lazy', decoding: "async", fetchPriority: priority ? 'high' : 'auto', onLoad: (event) => {
19
+ setLoaded(true);
20
+ onLoad?.(event);
21
+ }, style: { ...layoutStyle, objectFit, ...blurStyle, ...style } }));
22
+ }
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ export type ScriptStrategy = 'beforeInteractive' | 'afterInteractive' | 'lazyOnload';
3
+ export interface ScriptProps {
4
+ src?: string;
5
+ strategy?: ScriptStrategy;
6
+ id?: string;
7
+ type?: string;
8
+ onLoad?: () => void;
9
+ onReady?: () => void;
10
+ onError?: (error: unknown) => void;
11
+ children?: string;
12
+ }
13
+ export declare function Script(props: ScriptProps): ReactNode;
@@ -0,0 +1,68 @@
1
+ import { useEffect } from 'react';
2
+ const registry = new Map();
3
+ function inject(props, key) {
4
+ const { src, type, onLoad, onReady, onError, children } = props;
5
+ const el = document.createElement('script');
6
+ el.dataset.toilScript = key;
7
+ if (type !== undefined)
8
+ el.type = type;
9
+ if (src !== undefined) {
10
+ el.src = src;
11
+ el.async = true;
12
+ el.addEventListener('load', () => {
13
+ registry.set(key, 'ready');
14
+ onLoad?.();
15
+ onReady?.();
16
+ });
17
+ el.addEventListener('error', (event) => {
18
+ registry.delete(key);
19
+ onError?.(event);
20
+ });
21
+ document.head.appendChild(el);
22
+ }
23
+ else {
24
+ el.textContent = children ?? '';
25
+ document.head.appendChild(el);
26
+ registry.set(key, 'ready');
27
+ onLoad?.();
28
+ onReady?.();
29
+ }
30
+ }
31
+ export function Script(props) {
32
+ const { src, id, strategy = 'afterInteractive', onReady } = props;
33
+ const key = id ?? src;
34
+ useEffect(() => {
35
+ if (key === undefined) {
36
+ return;
37
+ }
38
+ const state = registry.get(key);
39
+ if (state === 'ready') {
40
+ onReady?.();
41
+ return;
42
+ }
43
+ if (state === 'loading') {
44
+ return;
45
+ }
46
+ registry.set(key, 'loading');
47
+ const run = () => {
48
+ inject(props, key);
49
+ };
50
+ if (strategy === 'lazyOnload') {
51
+ if (document.readyState === 'complete') {
52
+ const idle = window.requestIdleCallback?.bind(window);
53
+ if (idle)
54
+ idle(run);
55
+ else
56
+ setTimeout(run, 0);
57
+ }
58
+ else {
59
+ window.addEventListener('load', run, { once: true });
60
+ }
61
+ return () => {
62
+ window.removeEventListener('load', run);
63
+ };
64
+ }
65
+ run();
66
+ }, [key, strategy]);
67
+ return null;
68
+ }
@@ -8,8 +8,10 @@ export { navigate, back, forward, refresh } from './navigation/navigation.js';
8
8
  export type { NavigateOptions } from './navigation/navigation.js';
9
9
  export { useParams, useNavigate, useLocation, usePathname, useSearchParams, useRouter, useNavigationPending, } from './routing/hooks.js';
10
10
  export type { RouterInstance } from './routing/hooks.js';
11
- export { useLoaderData } from './routing/loader.js';
12
- export type { LoaderArgs, LoaderFunction } from './routing/loader.js';
11
+ export { useLoaderData, revalidate, invalidateLoaderData } from './routing/loader.js';
12
+ export type { LoaderArgs, LoaderFunction, LoaderData, Revalidate } from './routing/loader.js';
13
+ export { useAction } from './routing/action.js';
14
+ export type { UseActionOptions, ActionState, ActionHandle, RevalidateTarget, } from './routing/action.js';
13
15
  export { prefetch } from './navigation/prefetch.js';
14
16
  export type { RouteDef, LayoutLoader, LayoutComponentLoader, NotFoundLoader, RouteErrorProps, Register, RoutePath, Href, } from './types.js';
15
17
  export { matchRoute } from './routing/match.js';
@@ -18,3 +20,9 @@ export { connectChannel, useChannel, resolveChannelUrl } from './channel/channel
18
20
  export type { Channel, ChannelOptions, ChannelHook, ChannelData } from './channel/channel.js';
19
21
  export { useHead, useTitle, Head, mergeHead } from './head/head.js';
20
22
  export type { HeadSpec, MetaTag, LinkTag, ResolvedHead } from './head/head.js';
23
+ export { Image } from './components/Image.js';
24
+ export type { ImageProps } from './components/Image.js';
25
+ export { Script } from './components/Script.js';
26
+ export type { ScriptProps, ScriptStrategy } from './components/Script.js';
27
+ export { Form } from './components/Form.js';
28
+ export type { FormProps } from './components/Form.js';
@@ -4,8 +4,12 @@ export { Link } from './navigation/Link.js';
4
4
  export { NavLink, matchActive } from './navigation/NavLink.js';
5
5
  export { navigate, back, forward, refresh } from './navigation/navigation.js';
6
6
  export { useParams, useNavigate, useLocation, usePathname, useSearchParams, useRouter, useNavigationPending, } from './routing/hooks.js';
7
- export { useLoaderData } from './routing/loader.js';
7
+ export { useLoaderData, revalidate, invalidateLoaderData } from './routing/loader.js';
8
+ export { useAction } from './routing/action.js';
8
9
  export { prefetch } from './navigation/prefetch.js';
9
10
  export { matchRoute } from './routing/match.js';
10
11
  export { connectChannel, useChannel, resolveChannelUrl } from './channel/channel.js';
11
12
  export { useHead, useTitle, Head, mergeHead } from './head/head.js';
13
+ export { Image } from './components/Image.js';
14
+ export { Script } from './components/Script.js';
15
+ export { Form } from './components/Form.js';
@@ -3,13 +3,13 @@ import { createElement, Suspense, useLayoutEffect } from 'react';
3
3
  import { ErrorBoundary } from './error-boundary.js';
4
4
  import { useLocation } from './hooks.js';
5
5
  import { errorComponent, loadingComponent, nestedLayout, resolveLayout, resolveNotFound, } from './lazy.js';
6
- import { LoaderDataContext, readRouteData } from './loader.js';
6
+ import { loaderKey, LoaderDataContext, readRouteData } from './loader.js';
7
7
  import { matchRoute } from './match.js';
8
8
  import { ParamsContext } from './params-context.js';
9
9
  import { navigationEpoch, settleNavigation } from '../navigation/navigation.js';
10
10
  import { applyScroll } from '../navigation/scroll.js';
11
11
  function RoutePage(props) {
12
- const { Component, data } = readRouteData(props.route, props.params, props.dataKey);
12
+ const { Component, data } = readRouteData(props.route, props.params, props.dataKey, props.epoch);
13
13
  return _jsx(LoaderDataContext.Provider, { value: data, children: createElement(Component) });
14
14
  }
15
15
  export function Router(props) {
@@ -35,8 +35,8 @@ export function Router(props) {
35
35
  ? createElement(Suspense, { fallback: null }, createElement(loadingComponent(matched.loading)))
36
36
  : null;
37
37
  const search = typeof window === 'undefined' ? '' : window.location.search;
38
- const dataKey = `${String(navigationEpoch())}:${pathname}${search}`;
39
- content = (_jsx(Suspense, { fallback: fallback, children: _jsx(RoutePage, { route: matched, params: params, dataKey: dataKey }) }));
38
+ const dataKey = loaderKey(pathname, search);
39
+ content = (_jsx(Suspense, { fallback: fallback, children: _jsx(RoutePage, { route: matched, params: params, dataKey: dataKey, epoch: navigationEpoch() }) }, matched.loading ? dataKey : undefined));
40
40
  const templates = matched.templates ?? [];
41
41
  for (let i = templates.length - 1; i >= 0; i--) {
42
42
  const Template = nestedLayout(templates[i]);
@@ -0,0 +1,17 @@
1
+ import type { Href } from '../types.js';
2
+ export type RevalidateTarget = boolean | Href | readonly Href[];
3
+ export interface UseActionOptions<TData> {
4
+ readonly revalidate?: RevalidateTarget;
5
+ readonly onSuccess?: (data: TData) => void;
6
+ readonly onError?: (error: unknown) => void;
7
+ }
8
+ export interface ActionState<TData> {
9
+ readonly pending: boolean;
10
+ readonly error: unknown;
11
+ readonly data: TData | undefined;
12
+ }
13
+ export interface ActionHandle<TInput, TData> extends ActionState<TData> {
14
+ run: (input: TInput) => Promise<TData | undefined>;
15
+ reset: () => void;
16
+ }
17
+ export declare function useAction<TInput = void, TData = unknown>(fn: (input: TInput) => TData | Promise<TData>, options?: UseActionOptions<TData>): ActionHandle<TInput, TData>;
@@ -0,0 +1,55 @@
1
+ import { useCallback, useEffect, useRef, useState } from 'react';
2
+ import { invalidateLoaderData } from './loader.js';
3
+ import { refresh } from '../navigation/navigation.js';
4
+ function applyRevalidate(target) {
5
+ if (target === false)
6
+ return;
7
+ if (target === undefined || target === true) {
8
+ invalidateLoaderData();
9
+ }
10
+ else {
11
+ const hrefs = typeof target === 'string' ? [target] : target;
12
+ for (const href of hrefs)
13
+ invalidateLoaderData(href);
14
+ }
15
+ refresh();
16
+ }
17
+ export function useAction(fn, options = {}) {
18
+ const [state, setState] = useState({
19
+ pending: false,
20
+ error: undefined,
21
+ data: undefined,
22
+ });
23
+ const latest = useRef({ fn, options });
24
+ latest.current = { fn, options };
25
+ const runId = useRef(0);
26
+ const mounted = useRef(true);
27
+ useEffect(() => () => {
28
+ mounted.current = false;
29
+ }, []);
30
+ const run = useCallback(async (input) => {
31
+ const id = ++runId.current;
32
+ setState((s) => ({ ...s, pending: true, error: undefined }));
33
+ try {
34
+ const data = await latest.current.fn(input);
35
+ if (mounted.current && id === runId.current) {
36
+ setState({ pending: false, error: undefined, data });
37
+ }
38
+ applyRevalidate(latest.current.options.revalidate);
39
+ latest.current.options.onSuccess?.(data);
40
+ return data;
41
+ }
42
+ catch (error) {
43
+ if (mounted.current && id === runId.current) {
44
+ setState({ pending: false, error, data: undefined });
45
+ }
46
+ latest.current.options.onError?.(error);
47
+ return undefined;
48
+ }
49
+ }, []);
50
+ const reset = useCallback(() => {
51
+ runId.current += 1;
52
+ setState({ pending: false, error: undefined, data: undefined });
53
+ }, []);
54
+ return { ...state, run, reset };
55
+ }
@@ -7,6 +7,7 @@ export interface RouterInstance {
7
7
  back(): void;
8
8
  forward(): void;
9
9
  refresh(): void;
10
+ revalidate(href?: Href): void;
10
11
  prefetch(href: Href): void;
11
12
  }
12
13
  export declare function useParams<T extends RouteParams = RouteParams>(): T;
@@ -1,6 +1,6 @@
1
1
  import { startTransition, useContext, useEffect, useMemo, useReducer, useSyncExternalStore, } from 'react';
2
2
  import { back, forward, isNavigationPending, navigate, refresh, subscribeLocation, subscribePending, } from '../navigation/navigation.js';
3
- import { clearLoaderData } from './loader.js';
3
+ import { clearLoaderData, revalidate as revalidateData } from './loader.js';
4
4
  import { ParamsContext } from './params-context.js';
5
5
  import { prefetch } from '../navigation/prefetch.js';
6
6
  const ROUTER = {
@@ -16,6 +16,9 @@ const ROUTER = {
16
16
  clearLoaderData();
17
17
  refresh();
18
18
  },
19
+ revalidate: (href) => {
20
+ revalidateData(href);
21
+ },
19
22
  prefetch,
20
23
  };
21
24
  export function useParams() {
@@ -6,12 +6,18 @@ export interface LoaderArgs {
6
6
  readonly searchParams: URLSearchParams;
7
7
  }
8
8
  export type LoaderFunction<T = unknown> = (args: LoaderArgs) => T | Promise<T>;
9
+ export type Revalidate = number | false;
10
+ export type LoaderData<T> = T extends (...args: never[]) => infer R ? Awaited<R> : T;
9
11
  interface RouteData {
10
12
  Component: ComponentType;
11
13
  data: unknown;
12
14
  }
13
- export declare function readRouteData(route: RouteDef, params: RouteParams, key: string): RouteData;
15
+ export declare function loaderKey(pathname: string, search: string): string;
16
+ export declare function readRouteData(route: RouteDef, params: RouteParams, key: string, epoch: number): RouteData;
14
17
  export declare function clearLoaderData(): void;
18
+ export declare function invalidateLoaderData(href?: string): void;
19
+ export declare function revalidate(href?: string): void;
15
20
  export declare const LoaderDataContext: import("react").Context<unknown>;
16
- export declare function useLoaderData<T = unknown>(): T;
21
+ export declare function useLoaderData<L extends LoaderFunction>(loader: L): Awaited<ReturnType<L>>;
22
+ export declare function useLoaderData<T = unknown>(): LoaderData<T>;
17
23
  export {};
@@ -1,51 +1,102 @@
1
1
  import { createContext, useContext } from 'react';
2
- import { navigationEpoch } from '../navigation/navigation.js';
2
+ import { refresh as rerender } from '../navigation/navigation.js';
3
3
  const cache = new Map();
4
- const MAX_ENTRIES = 16;
4
+ const MAX_ENTRIES = 32;
5
+ export function loaderKey(pathname, search) {
6
+ return `${pathname}${search}`;
7
+ }
5
8
  async function loadRoute(route, params) {
6
9
  const mod = await route.load();
7
10
  const searchParams = new URLSearchParams(typeof window === 'undefined' ? '' : window.location.search);
8
11
  const data = mod.loader ? await mod.loader({ params, searchParams }) : undefined;
9
- return { Component: mod.default, data };
12
+ return {
13
+ data: { Component: mod.default, data },
14
+ revalidate: mod.revalidate ?? 0,
15
+ hasLoader: mod.loader != null,
16
+ };
10
17
  }
11
- function prune() {
12
- const current = `${String(navigationEpoch())}:`;
13
- for (const key of cache.keys()) {
14
- if (!key.startsWith(current))
15
- cache.delete(key);
16
- }
18
+ function isStale(entry, epoch) {
19
+ if (entry.status === 'error')
20
+ return true;
21
+ if (!entry.hasLoader)
22
+ return false;
23
+ if (entry.revalidate === false)
24
+ return false;
25
+ if (entry.revalidate === 0)
26
+ return entry.epoch !== epoch;
27
+ return Date.now() - entry.loadedAt >= entry.revalidate * 1000;
28
+ }
29
+ function startFetch(route, params, key, epoch) {
30
+ const created = {
31
+ status: 'pending',
32
+ promise: Promise.resolve(),
33
+ loadedAt: 0,
34
+ revalidate: 0,
35
+ epoch,
36
+ hasLoader: false,
37
+ };
38
+ created.promise = loadRoute(route, params).then((result) => {
39
+ created.value = result.data;
40
+ created.revalidate = result.revalidate;
41
+ created.hasLoader = result.hasLoader;
42
+ created.loadedAt = Date.now();
43
+ created.status = 'done';
44
+ }, (error) => {
45
+ created.error = error;
46
+ created.loadedAt = Date.now();
47
+ created.status = 'error';
48
+ });
49
+ cache.set(key, created);
17
50
  while (cache.size > MAX_ENTRIES) {
18
51
  const oldest = cache.keys().next().value;
19
- if (oldest === undefined)
52
+ if (oldest === undefined || oldest === key)
20
53
  break;
21
54
  cache.delete(oldest);
22
55
  }
56
+ return created;
23
57
  }
24
- export function readRouteData(route, params, key) {
58
+ export function readRouteData(route, params, key, epoch) {
25
59
  let entry = cache.get(key);
26
- if (!entry) {
27
- const created = { status: 'pending', promise: Promise.resolve() };
28
- created.promise = loadRoute(route, params).then((value) => {
29
- created.value = value;
30
- created.status = 'done';
31
- }, (error) => {
32
- created.error = error;
33
- created.status = 'error';
34
- });
35
- cache.set(key, created);
36
- prune();
37
- entry = created;
60
+ if (entry && entry.status !== 'pending' && isStale(entry, epoch)) {
61
+ entry = undefined;
38
62
  }
63
+ entry ??= startFetch(route, params, key, epoch);
39
64
  if (entry.status === 'pending')
40
65
  throw entry.promise;
41
66
  if (entry.status === 'error')
42
67
  throw entry.error;
68
+ if (!entry.value)
69
+ throw entry.promise;
43
70
  return entry.value;
44
71
  }
45
72
  export function clearLoaderData() {
46
73
  cache.clear();
47
74
  }
75
+ function keyForHref(href) {
76
+ if (typeof window === 'undefined')
77
+ return undefined;
78
+ try {
79
+ const url = new URL(href, window.location.href);
80
+ return loaderKey(url.pathname, url.search);
81
+ }
82
+ catch {
83
+ return undefined;
84
+ }
85
+ }
86
+ export function invalidateLoaderData(href) {
87
+ if (href === undefined) {
88
+ cache.clear();
89
+ return;
90
+ }
91
+ const key = keyForHref(href);
92
+ if (key !== undefined)
93
+ cache.delete(key);
94
+ }
95
+ export function revalidate(href) {
96
+ invalidateLoaderData(href);
97
+ rerender();
98
+ }
48
99
  export const LoaderDataContext = createContext(undefined);
49
- export function useLoaderData() {
100
+ export function useLoaderData(_loader) {
50
101
  return useContext(LoaderDataContext);
51
102
  }