@react-router/dev 0.0.0-experimental-d4ee0faac → 0.0.0-experimental-80dc2f07b
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.
- package/CHANGELOG.md +7 -38
- package/dist/cli/index.js +4 -4
- package/dist/config/defaults/entry.client.tsx +1 -1
- package/dist/config/defaults/entry.server.node.tsx +3 -3
- package/dist/config.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/static/{refresh-utils.cjs → refresh-utils.mjs} +14 -14
- package/dist/vite/cloudflare.js +1 -1
- package/dist/vite.js +2 -2
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
-
## 7.7.0
|
|
3
|
+
## 7.7.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
- Improve chunk error logging when a chunk cannot be found during the build ([#13799](https://github.com/remix-run/react-router/pull/13799))
|
|
13
13
|
- Fix incorrectly configured `externalConditions` which had enabled `module` condition for externals and broke builds with certain packages, like Emotion. ([#13871](https://github.com/remix-run/react-router/pull/13871))
|
|
14
14
|
- Updated dependencies:
|
|
15
|
-
- `react-router@7.7.0
|
|
16
|
-
- `@react-router/node@7.7.0
|
|
17
|
-
- `@react-router/serve@7.7.0
|
|
15
|
+
- `react-router@7.7.0`
|
|
16
|
+
- `@react-router/node@7.7.0`
|
|
17
|
+
- `@react-router/serve@7.7.0`
|
|
18
18
|
|
|
19
19
|
## 7.6.3
|
|
20
20
|
|
|
@@ -211,7 +211,6 @@
|
|
|
211
211
|
### Minor Changes
|
|
212
212
|
|
|
213
213
|
- Added a new `react-router.config.ts` `routeDiscovery` option to configure Lazy Route Discovery behavior. ([#13451](https://github.com/remix-run/react-router/pull/13451))
|
|
214
|
-
|
|
215
214
|
- By default, Lazy Route Discovery is enabled and makes manifest requests to the `/__manifest` path:
|
|
216
215
|
- `routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }`
|
|
217
216
|
- You can modify the manifest path used:
|
|
@@ -410,7 +409,6 @@
|
|
|
410
409
|
### Minor Changes
|
|
411
410
|
|
|
412
411
|
- Generate a "SPA fallback" HTML file for scenarios where applications are prerendering the `/` route with `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
|
|
413
|
-
|
|
414
412
|
- If you specify `ssr:false` without a `prerender` config, this is considered "SPA Mode" and the generated `index.html` file will only render down to the root route and will be able to hydrate for any valid application path
|
|
415
413
|
- If you specify `ssr:false` with a `prerender` config but _do not_ include the `/` path (i.e., `prerender: ['/blog/post']`), then we still generate a "SPA Mode" `index.html` file that can hydrate for any path in the application
|
|
416
414
|
- However, previously if you specified `ssr:false` and included the `/` path in your `prerender` config, we would prerender the `/` route into `index.html` as a non-SPA page
|
|
@@ -420,7 +418,6 @@
|
|
|
420
418
|
- `npx sirv-cli build/client --single __spa-fallback.html`
|
|
421
419
|
|
|
422
420
|
- Allow a `loader` in the root route in SPA mode because it can be called/server-rendered at build time ([#12948](https://github.com/remix-run/react-router/pull/12948))
|
|
423
|
-
|
|
424
421
|
- `Route.HydrateFallbackProps` now also receives `loaderData`
|
|
425
422
|
- This will be defined so long as the `HydrateFallback` is rendering while _children_ routes are loading
|
|
426
423
|
- This will be `undefined` if the `HydrateFallback` is rendering because the route has it's own hydrating `clientLoader`
|
|
@@ -465,7 +462,6 @@
|
|
|
465
462
|
- Skip action-only resource routes when using `prerender:true` ([#13004](https://github.com/remix-run/react-router/pull/13004))
|
|
466
463
|
|
|
467
464
|
- Enhance invalid export detection when using `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
|
|
468
|
-
|
|
469
465
|
- `headers`/`action` are prohibited in all routes with `ssr:false` because there will be no runtime server on which to run them
|
|
470
466
|
- `loader` functions are more nuanced and depend on whether a given route is prerendered
|
|
471
467
|
- When using `ssr:false` without a `prerender` config, only the `root` route can have a `loader`
|
|
@@ -482,7 +478,6 @@
|
|
|
482
478
|
- Add `future.unstable_viteEnvironmentApi` flag to enable experimental Vite Environment API support ([#12936](https://github.com/remix-run/react-router/pull/12936))
|
|
483
479
|
|
|
484
480
|
- Disable Lazy Route Discovery for all `ssr:false` apps and not just "SPA Mode" because there is no runtime server to serve the search-param-configured `__manifest` requests ([#12894](https://github.com/remix-run/react-router/pull/12894))
|
|
485
|
-
|
|
486
481
|
- We previously only disabled this for "SPA Mode" which is `ssr:false` and no `prerender` config but we realized it should apply to all `ssr:false` apps, including those prerendering multiple pages
|
|
487
482
|
- In those `prerender` scenarios we would prerender the `/__manifest` file assuming the static file server would serve it but that makes some unneccesary assumptions about the static file server behaviors
|
|
488
483
|
|
|
@@ -555,7 +550,6 @@
|
|
|
555
550
|
- Properly initialize `NODE_ENV` if not already set for compatibility with React 19 ([#12578](https://github.com/remix-run/react-router/pull/12578))
|
|
556
551
|
|
|
557
552
|
- Remove the leftover/unused `abortDelay` prop from `ServerRouter` and update the default `entry.server.tsx` to use the new `streamTimeout` value for Single Fetch ([#12478](https://github.com/remix-run/react-router/pull/12478))
|
|
558
|
-
|
|
559
553
|
- The `abortDelay` functionality was removed in v7 as it was coupled to the `defer` implementation from Remix v2, but this removal of this prop was missed
|
|
560
554
|
- If you were still using this prop in your `entry.server` file, it's likely your app is not aborting streams as you would expect and you will need to adopt the new [`streamTimeout`](https://reactrouter.com/explanation/special-files#streamtimeout) value introduced with Single Fetch
|
|
561
555
|
|
|
@@ -634,14 +628,13 @@
|
|
|
634
628
|
await writeFile(
|
|
635
629
|
"build/manifest.json",
|
|
636
630
|
JSON.stringify(buildManifest, null, 2),
|
|
637
|
-
"utf-8"
|
|
631
|
+
"utf-8",
|
|
638
632
|
);
|
|
639
633
|
},
|
|
640
634
|
} satisfies Config;
|
|
641
635
|
```
|
|
642
636
|
|
|
643
637
|
- Consolidate types previously duplicated across `@remix-run/router`, `@remix-run/server-runtime`, and `@remix-run/react` now that they all live in `react-router` ([#12177](https://github.com/remix-run/react-router/pull/12177))
|
|
644
|
-
|
|
645
638
|
- Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
|
|
646
639
|
- The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
|
|
647
640
|
- `Record<string, Route> -> Record<string, Route | undefined>`
|
|
@@ -649,7 +642,6 @@
|
|
|
649
642
|
- Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
|
|
650
643
|
|
|
651
644
|
- Update default `isbot` version to v5 and drop support for `isbot@3` ([#11770](https://github.com/remix-run/react-router/pull/11770))
|
|
652
|
-
|
|
653
645
|
- If you have `isbot@4` or `isbot@5` in your `package.json`:
|
|
654
646
|
- You do not need to make any changes
|
|
655
647
|
- If you have `isbot@3` in your `package.json` and you have your own `entry.server.tsx` file in your repo
|
|
@@ -659,7 +651,6 @@
|
|
|
659
651
|
- You are using the internal default entry provided by React Router v7 and you will need to upgrade to `isbot@5` in your `package.json`
|
|
660
652
|
|
|
661
653
|
- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
|
|
662
|
-
|
|
663
654
|
- Remove `installGlobals()` as this should no longer be necessary
|
|
664
655
|
|
|
665
656
|
- For Remix consumers migrating to React Router, Vite manifests (i.e. `.vite/manifest.json`) are now written within each build subdirectory, e.g. `build/client/.vite/manifest.json` and `build/server/.vite/manifest.json` instead of `build/.vite/client-manifest.json` and `build/.vite/server-manifest.json`. This means that the build output is now much closer to what you'd expect from a typical Vite project. ([#11573](https://github.com/remix-run/react-router/pull/11573))
|
|
@@ -697,7 +688,6 @@
|
|
|
697
688
|
```
|
|
698
689
|
|
|
699
690
|
This initial implementation targets type inference for:
|
|
700
|
-
|
|
701
691
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
702
692
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
703
693
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -712,7 +702,6 @@
|
|
|
712
702
|
```
|
|
713
703
|
|
|
714
704
|
Check out our docs for more:
|
|
715
|
-
|
|
716
705
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
717
706
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
718
707
|
|
|
@@ -735,7 +724,6 @@
|
|
|
735
724
|
### Minor Changes
|
|
736
725
|
|
|
737
726
|
- New `future.unstable_singleFetch` flag ([#8773](https://github.com/remix-run/remix/pull/8773))
|
|
738
|
-
|
|
739
727
|
- Naked objects returned from loaders/actions are no longer automatically converted to JSON responses. They'll be streamed as-is via `turbo-stream` so `Date`'s will become `Date` through `useLoaderData()`
|
|
740
728
|
- You can return naked objects with `Promise`'s without needing to use `defer()` - including nested `Promise`'s
|
|
741
729
|
- If you need to return a custom status code or custom response headers, you can still use the `defer` utility
|
|
@@ -882,11 +870,9 @@
|
|
|
882
870
|
- Always ignore route files starting with `.` ([#8801](https://github.com/remix-run/remix/pull/8801))
|
|
883
871
|
|
|
884
872
|
- Vite: Enable use of [`vite preview`](https://main.vitejs.dev/guide/static-deploy.html#deploying-a-static-site) to preview Remix SPA applications ([#8624](https://github.com/remix-run/remix/pull/8624))
|
|
885
|
-
|
|
886
873
|
- In the SPA template, `npm run start` has been renamed to `npm run preview` which uses `vite preview` instead of a standalone HTTP server such as `http-server` or `serv-cli`
|
|
887
874
|
|
|
888
875
|
- Vite: Remove the ability to pass `publicPath` as an option to the Remix vite plugin ([#8145](https://github.com/remix-run/remix/pull/8145))
|
|
889
|
-
|
|
890
876
|
- ⚠️ **This is a breaking change for projects using the unstable Vite plugin with a `publicPath`**
|
|
891
877
|
- This is already handled in Vite via the [`base`](https://vitejs.dev/guide/build.html#public-base-path) config so we now set the Remix `publicPath` from the Vite `base` config
|
|
892
878
|
|
|
@@ -915,7 +901,6 @@
|
|
|
915
901
|
- Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654))
|
|
916
902
|
|
|
917
903
|
- Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613))
|
|
918
|
-
|
|
919
904
|
- `--sourcemapClient`
|
|
920
905
|
|
|
921
906
|
- `--sourcemapClient=inline`
|
|
@@ -1142,7 +1127,7 @@
|
|
|
1142
1127
|
remix({
|
|
1143
1128
|
unstable_serverBundles: ({ branch }) => {
|
|
1144
1129
|
const isAuthenticatedRoute = branch.some(
|
|
1145
|
-
(route) => route.id === "routes/_authenticated"
|
|
1130
|
+
(route) => route.id === "routes/_authenticated",
|
|
1146
1131
|
);
|
|
1147
1132
|
|
|
1148
1133
|
return isAuthenticatedRoute ? "authenticated" : "unauthenticated";
|
|
@@ -1155,7 +1140,6 @@
|
|
|
1155
1140
|
### Patch Changes
|
|
1156
1141
|
|
|
1157
1142
|
- Fix issue with `isbot` v4 released on 1/1/2024 ([#8415](https://github.com/remix-run/remix/pull/8415))
|
|
1158
|
-
|
|
1159
1143
|
- `remix dev` will now add `"isbot": "^4"` to `package.json` instead of using `latest`
|
|
1160
1144
|
- Update built-in `entry.server` files to work with both `isbot@3` and `isbot@4` for backwards-compatibility with Remix apps that have pinned `isbot` to v3
|
|
1161
1145
|
- Templates are updated to use `isbot@4` moving forward via `create-remix`
|
|
@@ -1177,7 +1161,6 @@
|
|
|
1177
1161
|
### Patch Changes
|
|
1178
1162
|
|
|
1179
1163
|
- Vite: Error messages when `.server` files are referenced by client ([#8267](https://github.com/remix-run/remix/pull/8267))
|
|
1180
|
-
|
|
1181
1164
|
- Previously, referencing a `.server` module from client code resulted in an error message like:
|
|
1182
1165
|
- `The requested module '/app/models/answer.server.ts' does not provide an export named 'isDateType'`
|
|
1183
1166
|
- This was confusing because `answer.server.ts` _does_ provide the `isDateType` export, but Remix was replacing `.server` modules with empty modules (`export {}`) for the client build
|
|
@@ -1254,7 +1237,6 @@
|
|
|
1254
1237
|
- Add support for `clientLoader`/`clientAction`/`HydrateFallback` route exports ([RFC](https://github.com/remix-run/remix/discussions/7634)) ([#8173](https://github.com/remix-run/remix/pull/8173))
|
|
1255
1238
|
|
|
1256
1239
|
Remix now supports loaders/actions that run on the client (in addition to, or instead of the loader/action that runs on the server). While we still recommend server loaders/actions for the majority of your data needs in a Remix app - these provide some levers you can pull for more advanced use-cases such as:
|
|
1257
|
-
|
|
1258
1240
|
- Leveraging a data source local to the browser (i.e., `localStorage`)
|
|
1259
1241
|
- Managing a client-side cache of server data (like `IndexedDB`)
|
|
1260
1242
|
- Bypassing the Remix server in a BFF setup and hitting your API directly from the browser
|
|
@@ -1363,7 +1345,6 @@
|
|
|
1363
1345
|
- Add `@remix-run/node` to Vite's `optimizeDeps.include` array ([#8177](https://github.com/remix-run/remix/pull/8177))
|
|
1364
1346
|
|
|
1365
1347
|
- Improve Vite plugin performance ([#8121](https://github.com/remix-run/remix/pull/8121))
|
|
1366
|
-
|
|
1367
1348
|
- Parallelize detection of route module exports
|
|
1368
1349
|
- Disable `server.preTransformRequests` in Vite child compiler since it's only used to process route modules
|
|
1369
1350
|
|
|
@@ -1533,7 +1514,6 @@
|
|
|
1533
1514
|
- Additionally, all runtimes (including non-Node runtimes) can use `build.mode` to determine if HMR should be performed
|
|
1534
1515
|
- Support `bun` package manager ([#7074](https://github.com/remix-run/remix/pull/7074))
|
|
1535
1516
|
- The `serverNodeBuiltinsPolyfill` option (along with the newly added `browserNodeBuiltinsPolyfill`) now supports defining global polyfills in addition to module polyfills ([#7269](https://github.com/remix-run/remix/pull/7269))
|
|
1536
|
-
|
|
1537
1517
|
- For example, to polyfill Node's `Buffer` global:
|
|
1538
1518
|
|
|
1539
1519
|
```js
|
|
@@ -1556,7 +1536,6 @@
|
|
|
1556
1536
|
- Fix importing of PNGs, SVGs, and other assets from packages in `node_modules` ([#6813](https://github.com/remix-run/remix/pull/6813), [#7182](https://github.com/remix-run/remix/pull/7182))
|
|
1557
1537
|
|
|
1558
1538
|
- Decouple the `@remix-run/dev` package from the contents of the `@remix-run/css-bundle` package. ([#6982](https://github.com/remix-run/remix/pull/6982))
|
|
1559
|
-
|
|
1560
1539
|
- The contents of the `@remix-run/css-bundle` package are now entirely managed by the Remix compiler
|
|
1561
1540
|
- Even though it's still recommended that your Remix dependencies all share the same version, this change ensures that there are no runtime errors when upgrading `@remix-run/dev` without upgrading `@remix-run/css-bundle`
|
|
1562
1541
|
|
|
@@ -1565,7 +1544,6 @@
|
|
|
1565
1544
|
- Stop `remix dev` when `esbuild` is not running ([#7158](https://github.com/remix-run/remix/pull/7158))
|
|
1566
1545
|
|
|
1567
1546
|
- Do not interpret JSX in `.ts` files ([#7306](https://github.com/remix-run/remix/pull/7306))
|
|
1568
|
-
|
|
1569
1547
|
- While JSX is supported in `.js` files for compatibility with existing apps and libraries,
|
|
1570
1548
|
`.ts` files should not contain JSX. By not interpreting `.ts` files as JSX, `.ts` files
|
|
1571
1549
|
can contain single-argument type generics without needing a comma to disambiguate from JSX:
|
|
@@ -1599,7 +1577,6 @@
|
|
|
1599
1577
|
- Kill app server when remix dev terminates ([#7280](https://github.com/remix-run/remix/pull/7280))
|
|
1600
1578
|
|
|
1601
1579
|
- Support dependencies that import polyfill packages for Node built-ins via a trailing slash (e.g. importing the `buffer` package with `var Buffer = require('buffer/').Buffer` as recommended in their README) ([#7198](https://github.com/remix-run/remix/pull/7198))
|
|
1602
|
-
|
|
1603
1580
|
- These imports were previously marked as external
|
|
1604
1581
|
- This meant that they were left as dynamic imports in the client bundle and would throw a runtime error in the browser (e.g. `Dynamic require of "buffer/" is not supported`)
|
|
1605
1582
|
|
|
@@ -1608,14 +1585,12 @@
|
|
|
1608
1585
|
- Restart dev server when Remix config changes ([#7269](https://github.com/remix-run/remix/pull/7269))
|
|
1609
1586
|
|
|
1610
1587
|
- Remove outdated ESM import warnings ([#6916](https://github.com/remix-run/remix/pull/6916))
|
|
1611
|
-
|
|
1612
1588
|
- Most of the time these warnings were false positives.
|
|
1613
1589
|
- Instead, we now rely on built-in Node warnings for ESM imports.
|
|
1614
1590
|
|
|
1615
1591
|
- Do not trigger rebuilds when `.DS_Store` changes ([#7172](https://github.com/remix-run/remix/pull/7172))
|
|
1616
1592
|
|
|
1617
1593
|
- Remove warnings for stabilized flags: ([#6905](https://github.com/remix-run/remix/pull/6905))
|
|
1618
|
-
|
|
1619
1594
|
- `unstable_cssSideEffectImports`
|
|
1620
1595
|
- `unstable_cssModules`
|
|
1621
1596
|
- `unstable_vanillaExtract`
|
|
@@ -1665,7 +1640,6 @@
|
|
|
1665
1640
|
- Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772))
|
|
1666
1641
|
|
|
1667
1642
|
Written to server build directory (`build/` by default):
|
|
1668
|
-
|
|
1669
1643
|
- `metafile.css.json`
|
|
1670
1644
|
- `metafile.js.json` (browser JS)
|
|
1671
1645
|
- `metafile.server.json` (server JS)
|
|
@@ -1763,7 +1737,6 @@
|
|
|
1763
1737
|
- built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483))
|
|
1764
1738
|
|
|
1765
1739
|
New options:
|
|
1766
|
-
|
|
1767
1740
|
- `--tls-key` / `tlsKey`: TLS key
|
|
1768
1741
|
- `--tls-cert` / `tlsCert`: TLS Certificate
|
|
1769
1742
|
|
|
@@ -1834,7 +1807,7 @@
|
|
|
1834
1807
|
key: fs.readFileSync("key.pem"),
|
|
1835
1808
|
cert: fs.readFileSync("cert.pem"),
|
|
1836
1809
|
},
|
|
1837
|
-
app
|
|
1810
|
+
app,
|
|
1838
1811
|
);
|
|
1839
1812
|
|
|
1840
1813
|
appServer.listen(3000, () => {
|
|
@@ -1897,7 +1870,6 @@
|
|
|
1897
1870
|
- restore color for app server output ([#6485](https://github.com/remix-run/remix/pull/6485))
|
|
1898
1871
|
|
|
1899
1872
|
- Fix route ranking bug with pathless layout route next to a sibling index route ([#4421](https://github.com/remix-run/remix/pull/4421))
|
|
1900
|
-
|
|
1901
1873
|
- Under the hood this is done by removing the trailing slash from all generated `path` values since the number of slash-delimited segments counts towards route ranking so the trailing slash incorrectly increases the score for routes
|
|
1902
1874
|
|
|
1903
1875
|
- Support sibling pathless layout routes by removing pathless layout routes from the unique route path checks in conventional route generation since they inherently trigger duplicate paths ([#4421](https://github.com/remix-run/remix/pull/4421))
|
|
@@ -2035,7 +2007,6 @@
|
|
|
2035
2007
|
```
|
|
2036
2008
|
|
|
2037
2009
|
The dev server will:
|
|
2038
|
-
|
|
2039
2010
|
- force `NODE_ENV=development` and warn you if it was previously set to something else
|
|
2040
2011
|
- rebuild your app whenever your Remix app code changes
|
|
2041
2012
|
- restart your app server whenever rebuilds succeed
|
|
@@ -2165,7 +2136,6 @@
|
|
|
2165
2136
|
- Added deprecation warning for `v2_normalizeFormMethod` ([#5863](https://github.com/remix-run/remix/pull/5863))
|
|
2166
2137
|
|
|
2167
2138
|
- Added a new `future.v2_normalizeFormMethod` flag to normalize the exposed `useNavigation().formMethod` as an uppercase HTTP method to align with the previous `useTransition` behavior as well as the `fetch()` behavior of normalizing to uppercase HTTP methods. ([#5815](https://github.com/remix-run/remix/pull/5815))
|
|
2168
|
-
|
|
2169
2139
|
- When `future.v2_normalizeFormMethod === false`,
|
|
2170
2140
|
- `useNavigation().formMethod` is lowercase
|
|
2171
2141
|
- `useFetcher().formMethod` is uppercase
|
|
@@ -2240,7 +2210,6 @@
|
|
|
2240
2210
|
### Patch Changes
|
|
2241
2211
|
|
|
2242
2212
|
- Fixes flat route inconsistencies where `route.{ext}` wasn't always being treated like `index.{ext}` when used in a folder ([#5459](https://github.com/remix-run/remix/pull/5459))
|
|
2243
|
-
|
|
2244
2213
|
- Route conflict no longer throw errors and instead display a helpful warning that we're using the first one we found.
|
|
2245
2214
|
|
|
2246
2215
|
```log
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @react-router/dev v0.0.0-experimental-
|
|
3
|
+
* @react-router/dev v0.0.0-experimental-80dc2f07b
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) Remix Software Inc.
|
|
6
6
|
*
|
|
@@ -2066,7 +2066,7 @@ var babel = __toESM(require("@babel/core"));
|
|
|
2066
2066
|
var import_plugin_syntax_jsx = __toESM(require("@babel/plugin-syntax-jsx"));
|
|
2067
2067
|
var import_preset_typescript = __toESM(require("@babel/preset-typescript"));
|
|
2068
2068
|
var import_prettier = __toESM(require("prettier"));
|
|
2069
|
-
function transpile(tsx, options = {}) {
|
|
2069
|
+
async function transpile(tsx, options = {}) {
|
|
2070
2070
|
let mjs = babel.transformSync(tsx, {
|
|
2071
2071
|
compact: false,
|
|
2072
2072
|
cwd: options.cwd,
|
|
@@ -2076,7 +2076,7 @@ function transpile(tsx, options = {}) {
|
|
|
2076
2076
|
retainLines: true
|
|
2077
2077
|
});
|
|
2078
2078
|
if (!mjs || !mjs.code) throw new Error("Could not parse TypeScript");
|
|
2079
|
-
return import_prettier.default.format(mjs.code, { parser: "babel" });
|
|
2079
|
+
return await import_prettier.default.format(mjs.code, { parser: "babel" });
|
|
2080
2080
|
}
|
|
2081
2081
|
|
|
2082
2082
|
// cli/commands.ts
|
|
@@ -2174,7 +2174,7 @@ async function generateEntry(entry, rootDirectory, flags = {}) {
|
|
|
2174
2174
|
let outputEntry = `${entry}.${outputExtension}`;
|
|
2175
2175
|
let outputFile = path7.resolve(appDirectory, outputEntry);
|
|
2176
2176
|
if (!useTypeScript) {
|
|
2177
|
-
let javascript = transpile(contents, {
|
|
2177
|
+
let javascript = await transpile(contents, {
|
|
2178
2178
|
cwd: rootDirectory,
|
|
2179
2179
|
filename: isServerEntry ? defaultEntryServer : defaultEntryClient
|
|
2180
2180
|
});
|
|
@@ -14,7 +14,7 @@ export default function handleRequest(
|
|
|
14
14
|
responseStatusCode: number,
|
|
15
15
|
responseHeaders: Headers,
|
|
16
16
|
routerContext: EntryContext,
|
|
17
|
-
loadContext: AppLoadContext
|
|
17
|
+
loadContext: AppLoadContext,
|
|
18
18
|
// If you have middleware enabled:
|
|
19
19
|
// loadContext: unstable_RouterContextProvider
|
|
20
20
|
) {
|
|
@@ -43,7 +43,7 @@ export default function handleRequest(
|
|
|
43
43
|
new Response(stream, {
|
|
44
44
|
headers: responseHeaders,
|
|
45
45
|
status: responseStatusCode,
|
|
46
|
-
})
|
|
46
|
+
}),
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
pipe(body);
|
|
@@ -60,7 +60,7 @@ export default function handleRequest(
|
|
|
60
60
|
console.error(error);
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
-
}
|
|
63
|
+
},
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
// Abort the rendering stream after the `streamTimeout` so it has time to
|
package/dist/config.js
CHANGED
package/dist/routes.js
CHANGED
|
@@ -20,7 +20,7 @@ const enqueueUpdate = debounce(async () => {
|
|
|
20
20
|
let imported = window.__reactRouterRouteModuleUpdates.get(route.id);
|
|
21
21
|
if (!imported) {
|
|
22
22
|
throw Error(
|
|
23
|
-
`[react-router:hmr] No module update found for route ${route.id}
|
|
23
|
+
`[react-router:hmr] No module update found for route ${route.id}`,
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
let routeModule = {
|
|
@@ -28,16 +28,16 @@ const enqueueUpdate = debounce(async () => {
|
|
|
28
28
|
// react-refresh takes care of updating these in-place,
|
|
29
29
|
// if we don't preserve existing values we'll loose state.
|
|
30
30
|
default: imported.default
|
|
31
|
-
? window.__reactRouterRouteModules[route.id]?.default ??
|
|
32
|
-
imported.default
|
|
31
|
+
? (window.__reactRouterRouteModules[route.id]?.default ??
|
|
32
|
+
imported.default)
|
|
33
33
|
: imported.default,
|
|
34
34
|
ErrorBoundary: imported.ErrorBoundary
|
|
35
|
-
? window.__reactRouterRouteModules[route.id]?.ErrorBoundary ??
|
|
36
|
-
imported.ErrorBoundary
|
|
35
|
+
? (window.__reactRouterRouteModules[route.id]?.ErrorBoundary ??
|
|
36
|
+
imported.ErrorBoundary)
|
|
37
37
|
: imported.ErrorBoundary,
|
|
38
38
|
HydrateFallback: imported.HydrateFallback
|
|
39
|
-
? window.__reactRouterRouteModules[route.id]?.HydrateFallback ??
|
|
40
|
-
imported.HydrateFallback
|
|
39
|
+
? (window.__reactRouterRouteModules[route.id]?.HydrateFallback ??
|
|
40
|
+
imported.HydrateFallback)
|
|
41
41
|
: imported.HydrateFallback,
|
|
42
42
|
};
|
|
43
43
|
window.__reactRouterRouteModules[route.id] = routeModule;
|
|
@@ -49,9 +49,9 @@ const enqueueUpdate = debounce(async () => {
|
|
|
49
49
|
(route) =>
|
|
50
50
|
route.hasLoader ||
|
|
51
51
|
route.hasClientLoader ||
|
|
52
|
-
route.hasClientMiddleware
|
|
52
|
+
route.hasClientMiddleware,
|
|
53
53
|
)
|
|
54
|
-
.map((route) => route.id)
|
|
54
|
+
.map((route) => route.id),
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
let routes = __reactRouterDataRouter.createRoutesForHMR(
|
|
@@ -59,7 +59,7 @@ const enqueueUpdate = debounce(async () => {
|
|
|
59
59
|
manifest.routes,
|
|
60
60
|
window.__reactRouterRouteModules,
|
|
61
61
|
window.__reactRouterContext.ssr,
|
|
62
|
-
window.__reactRouterContext.isSpaMode
|
|
62
|
+
window.__reactRouterContext.isSpaMode,
|
|
63
63
|
);
|
|
64
64
|
__reactRouterDataRouter._internalSetRoutes(routes);
|
|
65
65
|
routeUpdates.clear();
|
|
@@ -99,12 +99,12 @@ function validateRefreshBoundaryAndEnqueueUpdate(
|
|
|
99
99
|
prevExports,
|
|
100
100
|
nextExports,
|
|
101
101
|
// non-component exports that are handled by the framework (e.g. `meta` and `links` for route modules)
|
|
102
|
-
acceptExports = []
|
|
102
|
+
acceptExports = [],
|
|
103
103
|
) {
|
|
104
104
|
if (
|
|
105
105
|
!predicateOnExport(
|
|
106
106
|
prevExports,
|
|
107
|
-
(key) => key in nextExports || acceptExports.includes(key)
|
|
107
|
+
(key) => key in nextExports || acceptExports.includes(key),
|
|
108
108
|
)
|
|
109
109
|
) {
|
|
110
110
|
return "Could not Fast Refresh (export removed)";
|
|
@@ -112,7 +112,7 @@ function validateRefreshBoundaryAndEnqueueUpdate(
|
|
|
112
112
|
if (
|
|
113
113
|
!predicateOnExport(
|
|
114
114
|
nextExports,
|
|
115
|
-
(key) => key in prevExports || acceptExports.includes(key)
|
|
115
|
+
(key) => key in prevExports || acceptExports.includes(key),
|
|
116
116
|
)
|
|
117
117
|
) {
|
|
118
118
|
return "Could not Fast Refresh (new export)";
|
|
@@ -129,7 +129,7 @@ function validateRefreshBoundaryAndEnqueueUpdate(
|
|
|
129
129
|
if (exports.isLikelyComponentType(value)) return true;
|
|
130
130
|
// Unchanged exports are implicitly handled
|
|
131
131
|
return prevExports[key] === nextExports[key];
|
|
132
|
-
}
|
|
132
|
+
},
|
|
133
133
|
);
|
|
134
134
|
if (hasExports && allExportsAreHandledOrUnchanged) {
|
|
135
135
|
enqueueUpdate();
|
package/dist/vite/cloudflare.js
CHANGED
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-80dc2f07b
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -3819,7 +3819,7 @@ var reactRouterVitePlugin = () => {
|
|
|
3819
3819
|
return [
|
|
3820
3820
|
"const exports = {}",
|
|
3821
3821
|
await (0, import_promises2.readFile)(reactRefreshRuntimePath, "utf8"),
|
|
3822
|
-
await (0, import_promises2.readFile)(require.resolve("./static/refresh-utils.
|
|
3822
|
+
await (0, import_promises2.readFile)(require.resolve("./static/refresh-utils.mjs"), "utf8"),
|
|
3823
3823
|
"export default exports"
|
|
3824
3824
|
].join("\n");
|
|
3825
3825
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-router/dev",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-80dc2f07b",
|
|
4
4
|
"description": "Dev tools and CLI for React Router",
|
|
5
5
|
"homepage": "https://reactrouter.com",
|
|
6
6
|
"bugs": {
|
|
@@ -79,14 +79,14 @@
|
|
|
79
79
|
"lodash": "^4.17.21",
|
|
80
80
|
"pathe": "^1.1.2",
|
|
81
81
|
"picocolors": "^1.1.1",
|
|
82
|
-
"prettier": "^
|
|
82
|
+
"prettier": "^3.6.2",
|
|
83
83
|
"react-refresh": "^0.14.0",
|
|
84
84
|
"semver": "^7.3.7",
|
|
85
85
|
"set-cookie-parser": "^2.6.0",
|
|
86
86
|
"tinyglobby": "^0.2.14",
|
|
87
87
|
"valibot": "^0.41.0",
|
|
88
88
|
"vite-node": "^3.2.2",
|
|
89
|
-
"@react-router/node": "0.0.0-experimental-
|
|
89
|
+
"@react-router/node": "0.0.0-experimental-80dc2f07b"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/babel__core": "^7.20.5",
|
|
@@ -98,7 +98,6 @@
|
|
|
98
98
|
"@types/lodash": "^4.14.182",
|
|
99
99
|
"@types/node": "^20.0.0",
|
|
100
100
|
"@types/npmcli__package-json": "^4.0.0",
|
|
101
|
-
"@types/prettier": "^2.7.3",
|
|
102
101
|
"@types/set-cookie-parser": "^2.4.1",
|
|
103
102
|
"@types/semver": "^7.7.0",
|
|
104
103
|
"esbuild-register": "^3.6.0",
|
|
@@ -110,15 +109,15 @@
|
|
|
110
109
|
"vite": "^6.1.0",
|
|
111
110
|
"wireit": "0.14.9",
|
|
112
111
|
"wrangler": "^4.23.0",
|
|
113
|
-
"@react-router/serve": "0.0.0-experimental-
|
|
114
|
-
"react-router": "^0.0.0-experimental-
|
|
112
|
+
"@react-router/serve": "0.0.0-experimental-80dc2f07b",
|
|
113
|
+
"react-router": "^0.0.0-experimental-80dc2f07b"
|
|
115
114
|
},
|
|
116
115
|
"peerDependencies": {
|
|
117
116
|
"typescript": "^5.1.0",
|
|
118
117
|
"vite": "^5.1.0 || ^6.0.0 || ^7.0.0",
|
|
119
118
|
"wrangler": "^3.28.2 || ^4.0.0",
|
|
120
|
-
"react-router": "^0.0.0-experimental-
|
|
121
|
-
"
|
|
119
|
+
"@react-router/serve": "^0.0.0-experimental-80dc2f07b",
|
|
120
|
+
"react-router": "^0.0.0-experimental-80dc2f07b"
|
|
122
121
|
},
|
|
123
122
|
"peerDependenciesMeta": {
|
|
124
123
|
"@react-router/serve": {
|