@react-router/dev 0.0.0-experimental-b3337fc38 → 0.0.0-experimental-909c02f10
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 +19 -34
- 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,5 +1,21 @@
|
|
|
1
1
|
# `@react-router/dev`
|
|
2
2
|
|
|
3
|
+
## 7.7.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update `vite-node` to `^3.2.2` to support Vite 7 ([#13781](https://github.com/remix-run/react-router/pull/13781))
|
|
8
|
+
- Properly handle `https` protocol in dev mode ([#13746](https://github.com/remix-run/react-router/pull/13746))
|
|
9
|
+
- Fix missing styles when Vite's `build.cssCodeSplit` option is disabled ([#13943](https://github.com/remix-run/react-router/pull/13943))
|
|
10
|
+
- Allow `.mts` and `.mjs` extensions for route config file ([#13931](https://github.com/remix-run/react-router/pull/13931))
|
|
11
|
+
- Fix prerender file locations when `cwd` differs from project root ([#13824](https://github.com/remix-run/react-router/pull/13824))
|
|
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
|
+
- 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
|
+
- Updated dependencies:
|
|
15
|
+
- `react-router@7.7.0`
|
|
16
|
+
- `@react-router/node@7.7.0`
|
|
17
|
+
- `@react-router/serve@7.7.0`
|
|
18
|
+
|
|
3
19
|
## 7.6.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -195,7 +211,6 @@
|
|
|
195
211
|
### Minor Changes
|
|
196
212
|
|
|
197
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))
|
|
198
|
-
|
|
199
214
|
- By default, Lazy Route Discovery is enabled and makes manifest requests to the `/__manifest` path:
|
|
200
215
|
- `routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }`
|
|
201
216
|
- You can modify the manifest path used:
|
|
@@ -394,7 +409,6 @@
|
|
|
394
409
|
### Minor Changes
|
|
395
410
|
|
|
396
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))
|
|
397
|
-
|
|
398
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
|
|
399
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
|
|
400
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
|
|
@@ -404,7 +418,6 @@
|
|
|
404
418
|
- `npx sirv-cli build/client --single __spa-fallback.html`
|
|
405
419
|
|
|
406
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))
|
|
407
|
-
|
|
408
421
|
- `Route.HydrateFallbackProps` now also receives `loaderData`
|
|
409
422
|
- This will be defined so long as the `HydrateFallback` is rendering while _children_ routes are loading
|
|
410
423
|
- This will be `undefined` if the `HydrateFallback` is rendering because the route has it's own hydrating `clientLoader`
|
|
@@ -449,7 +462,6 @@
|
|
|
449
462
|
- Skip action-only resource routes when using `prerender:true` ([#13004](https://github.com/remix-run/react-router/pull/13004))
|
|
450
463
|
|
|
451
464
|
- Enhance invalid export detection when using `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
|
|
452
|
-
|
|
453
465
|
- `headers`/`action` are prohibited in all routes with `ssr:false` because there will be no runtime server on which to run them
|
|
454
466
|
- `loader` functions are more nuanced and depend on whether a given route is prerendered
|
|
455
467
|
- When using `ssr:false` without a `prerender` config, only the `root` route can have a `loader`
|
|
@@ -466,7 +478,6 @@
|
|
|
466
478
|
- Add `future.unstable_viteEnvironmentApi` flag to enable experimental Vite Environment API support ([#12936](https://github.com/remix-run/react-router/pull/12936))
|
|
467
479
|
|
|
468
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))
|
|
469
|
-
|
|
470
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
|
|
471
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
|
|
472
483
|
|
|
@@ -539,7 +550,6 @@
|
|
|
539
550
|
- Properly initialize `NODE_ENV` if not already set for compatibility with React 19 ([#12578](https://github.com/remix-run/react-router/pull/12578))
|
|
540
551
|
|
|
541
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))
|
|
542
|
-
|
|
543
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
|
|
544
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
|
|
545
555
|
|
|
@@ -618,14 +628,13 @@
|
|
|
618
628
|
await writeFile(
|
|
619
629
|
"build/manifest.json",
|
|
620
630
|
JSON.stringify(buildManifest, null, 2),
|
|
621
|
-
"utf-8"
|
|
631
|
+
"utf-8",
|
|
622
632
|
);
|
|
623
633
|
},
|
|
624
634
|
} satisfies Config;
|
|
625
635
|
```
|
|
626
636
|
|
|
627
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))
|
|
628
|
-
|
|
629
638
|
- Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
|
|
630
639
|
- The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
|
|
631
640
|
- `Record<string, Route> -> Record<string, Route | undefined>`
|
|
@@ -633,7 +642,6 @@
|
|
|
633
642
|
- Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
|
|
634
643
|
|
|
635
644
|
- Update default `isbot` version to v5 and drop support for `isbot@3` ([#11770](https://github.com/remix-run/react-router/pull/11770))
|
|
636
|
-
|
|
637
645
|
- If you have `isbot@4` or `isbot@5` in your `package.json`:
|
|
638
646
|
- You do not need to make any changes
|
|
639
647
|
- If you have `isbot@3` in your `package.json` and you have your own `entry.server.tsx` file in your repo
|
|
@@ -643,7 +651,6 @@
|
|
|
643
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`
|
|
644
652
|
|
|
645
653
|
- Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
|
|
646
|
-
|
|
647
654
|
- Remove `installGlobals()` as this should no longer be necessary
|
|
648
655
|
|
|
649
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))
|
|
@@ -681,7 +688,6 @@
|
|
|
681
688
|
```
|
|
682
689
|
|
|
683
690
|
This initial implementation targets type inference for:
|
|
684
|
-
|
|
685
691
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
686
692
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
687
693
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -696,7 +702,6 @@
|
|
|
696
702
|
```
|
|
697
703
|
|
|
698
704
|
Check out our docs for more:
|
|
699
|
-
|
|
700
705
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
701
706
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
702
707
|
|
|
@@ -719,7 +724,6 @@
|
|
|
719
724
|
### Minor Changes
|
|
720
725
|
|
|
721
726
|
- New `future.unstable_singleFetch` flag ([#8773](https://github.com/remix-run/remix/pull/8773))
|
|
722
|
-
|
|
723
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()`
|
|
724
728
|
- You can return naked objects with `Promise`'s without needing to use `defer()` - including nested `Promise`'s
|
|
725
729
|
- If you need to return a custom status code or custom response headers, you can still use the `defer` utility
|
|
@@ -866,11 +870,9 @@
|
|
|
866
870
|
- Always ignore route files starting with `.` ([#8801](https://github.com/remix-run/remix/pull/8801))
|
|
867
871
|
|
|
868
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))
|
|
869
|
-
|
|
870
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`
|
|
871
874
|
|
|
872
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))
|
|
873
|
-
|
|
874
876
|
- ⚠️ **This is a breaking change for projects using the unstable Vite plugin with a `publicPath`**
|
|
875
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
|
|
876
878
|
|
|
@@ -899,7 +901,6 @@
|
|
|
899
901
|
- Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654))
|
|
900
902
|
|
|
901
903
|
- Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613))
|
|
902
|
-
|
|
903
904
|
- `--sourcemapClient`
|
|
904
905
|
|
|
905
906
|
- `--sourcemapClient=inline`
|
|
@@ -1126,7 +1127,7 @@
|
|
|
1126
1127
|
remix({
|
|
1127
1128
|
unstable_serverBundles: ({ branch }) => {
|
|
1128
1129
|
const isAuthenticatedRoute = branch.some(
|
|
1129
|
-
(route) => route.id === "routes/_authenticated"
|
|
1130
|
+
(route) => route.id === "routes/_authenticated",
|
|
1130
1131
|
);
|
|
1131
1132
|
|
|
1132
1133
|
return isAuthenticatedRoute ? "authenticated" : "unauthenticated";
|
|
@@ -1139,7 +1140,6 @@
|
|
|
1139
1140
|
### Patch Changes
|
|
1140
1141
|
|
|
1141
1142
|
- Fix issue with `isbot` v4 released on 1/1/2024 ([#8415](https://github.com/remix-run/remix/pull/8415))
|
|
1142
|
-
|
|
1143
1143
|
- `remix dev` will now add `"isbot": "^4"` to `package.json` instead of using `latest`
|
|
1144
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
|
|
1145
1145
|
- Templates are updated to use `isbot@4` moving forward via `create-remix`
|
|
@@ -1161,7 +1161,6 @@
|
|
|
1161
1161
|
### Patch Changes
|
|
1162
1162
|
|
|
1163
1163
|
- Vite: Error messages when `.server` files are referenced by client ([#8267](https://github.com/remix-run/remix/pull/8267))
|
|
1164
|
-
|
|
1165
1164
|
- Previously, referencing a `.server` module from client code resulted in an error message like:
|
|
1166
1165
|
- `The requested module '/app/models/answer.server.ts' does not provide an export named 'isDateType'`
|
|
1167
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
|
|
@@ -1238,7 +1237,6 @@
|
|
|
1238
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))
|
|
1239
1238
|
|
|
1240
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:
|
|
1241
|
-
|
|
1242
1240
|
- Leveraging a data source local to the browser (i.e., `localStorage`)
|
|
1243
1241
|
- Managing a client-side cache of server data (like `IndexedDB`)
|
|
1244
1242
|
- Bypassing the Remix server in a BFF setup and hitting your API directly from the browser
|
|
@@ -1347,7 +1345,6 @@
|
|
|
1347
1345
|
- Add `@remix-run/node` to Vite's `optimizeDeps.include` array ([#8177](https://github.com/remix-run/remix/pull/8177))
|
|
1348
1346
|
|
|
1349
1347
|
- Improve Vite plugin performance ([#8121](https://github.com/remix-run/remix/pull/8121))
|
|
1350
|
-
|
|
1351
1348
|
- Parallelize detection of route module exports
|
|
1352
1349
|
- Disable `server.preTransformRequests` in Vite child compiler since it's only used to process route modules
|
|
1353
1350
|
|
|
@@ -1517,7 +1514,6 @@
|
|
|
1517
1514
|
- Additionally, all runtimes (including non-Node runtimes) can use `build.mode` to determine if HMR should be performed
|
|
1518
1515
|
- Support `bun` package manager ([#7074](https://github.com/remix-run/remix/pull/7074))
|
|
1519
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))
|
|
1520
|
-
|
|
1521
1517
|
- For example, to polyfill Node's `Buffer` global:
|
|
1522
1518
|
|
|
1523
1519
|
```js
|
|
@@ -1540,7 +1536,6 @@
|
|
|
1540
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))
|
|
1541
1537
|
|
|
1542
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))
|
|
1543
|
-
|
|
1544
1539
|
- The contents of the `@remix-run/css-bundle` package are now entirely managed by the Remix compiler
|
|
1545
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`
|
|
1546
1541
|
|
|
@@ -1549,7 +1544,6 @@
|
|
|
1549
1544
|
- Stop `remix dev` when `esbuild` is not running ([#7158](https://github.com/remix-run/remix/pull/7158))
|
|
1550
1545
|
|
|
1551
1546
|
- Do not interpret JSX in `.ts` files ([#7306](https://github.com/remix-run/remix/pull/7306))
|
|
1552
|
-
|
|
1553
1547
|
- While JSX is supported in `.js` files for compatibility with existing apps and libraries,
|
|
1554
1548
|
`.ts` files should not contain JSX. By not interpreting `.ts` files as JSX, `.ts` files
|
|
1555
1549
|
can contain single-argument type generics without needing a comma to disambiguate from JSX:
|
|
@@ -1583,7 +1577,6 @@
|
|
|
1583
1577
|
- Kill app server when remix dev terminates ([#7280](https://github.com/remix-run/remix/pull/7280))
|
|
1584
1578
|
|
|
1585
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))
|
|
1586
|
-
|
|
1587
1580
|
- These imports were previously marked as external
|
|
1588
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`)
|
|
1589
1582
|
|
|
@@ -1592,14 +1585,12 @@
|
|
|
1592
1585
|
- Restart dev server when Remix config changes ([#7269](https://github.com/remix-run/remix/pull/7269))
|
|
1593
1586
|
|
|
1594
1587
|
- Remove outdated ESM import warnings ([#6916](https://github.com/remix-run/remix/pull/6916))
|
|
1595
|
-
|
|
1596
1588
|
- Most of the time these warnings were false positives.
|
|
1597
1589
|
- Instead, we now rely on built-in Node warnings for ESM imports.
|
|
1598
1590
|
|
|
1599
1591
|
- Do not trigger rebuilds when `.DS_Store` changes ([#7172](https://github.com/remix-run/remix/pull/7172))
|
|
1600
1592
|
|
|
1601
1593
|
- Remove warnings for stabilized flags: ([#6905](https://github.com/remix-run/remix/pull/6905))
|
|
1602
|
-
|
|
1603
1594
|
- `unstable_cssSideEffectImports`
|
|
1604
1595
|
- `unstable_cssModules`
|
|
1605
1596
|
- `unstable_vanillaExtract`
|
|
@@ -1649,7 +1640,6 @@
|
|
|
1649
1640
|
- Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772))
|
|
1650
1641
|
|
|
1651
1642
|
Written to server build directory (`build/` by default):
|
|
1652
|
-
|
|
1653
1643
|
- `metafile.css.json`
|
|
1654
1644
|
- `metafile.js.json` (browser JS)
|
|
1655
1645
|
- `metafile.server.json` (server JS)
|
|
@@ -1747,7 +1737,6 @@
|
|
|
1747
1737
|
- built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483))
|
|
1748
1738
|
|
|
1749
1739
|
New options:
|
|
1750
|
-
|
|
1751
1740
|
- `--tls-key` / `tlsKey`: TLS key
|
|
1752
1741
|
- `--tls-cert` / `tlsCert`: TLS Certificate
|
|
1753
1742
|
|
|
@@ -1818,7 +1807,7 @@
|
|
|
1818
1807
|
key: fs.readFileSync("key.pem"),
|
|
1819
1808
|
cert: fs.readFileSync("cert.pem"),
|
|
1820
1809
|
},
|
|
1821
|
-
app
|
|
1810
|
+
app,
|
|
1822
1811
|
);
|
|
1823
1812
|
|
|
1824
1813
|
appServer.listen(3000, () => {
|
|
@@ -1881,7 +1870,6 @@
|
|
|
1881
1870
|
- restore color for app server output ([#6485](https://github.com/remix-run/remix/pull/6485))
|
|
1882
1871
|
|
|
1883
1872
|
- Fix route ranking bug with pathless layout route next to a sibling index route ([#4421](https://github.com/remix-run/remix/pull/4421))
|
|
1884
|
-
|
|
1885
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
|
|
1886
1874
|
|
|
1887
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))
|
|
@@ -2019,7 +2007,6 @@
|
|
|
2019
2007
|
```
|
|
2020
2008
|
|
|
2021
2009
|
The dev server will:
|
|
2022
|
-
|
|
2023
2010
|
- force `NODE_ENV=development` and warn you if it was previously set to something else
|
|
2024
2011
|
- rebuild your app whenever your Remix app code changes
|
|
2025
2012
|
- restart your app server whenever rebuilds succeed
|
|
@@ -2149,7 +2136,6 @@
|
|
|
2149
2136
|
- Added deprecation warning for `v2_normalizeFormMethod` ([#5863](https://github.com/remix-run/remix/pull/5863))
|
|
2150
2137
|
|
|
2151
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))
|
|
2152
|
-
|
|
2153
2139
|
- When `future.v2_normalizeFormMethod === false`,
|
|
2154
2140
|
- `useNavigation().formMethod` is lowercase
|
|
2155
2141
|
- `useFetcher().formMethod` is uppercase
|
|
@@ -2224,7 +2210,6 @@
|
|
|
2224
2210
|
### Patch Changes
|
|
2225
2211
|
|
|
2226
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))
|
|
2227
|
-
|
|
2228
2213
|
- Route conflict no longer throw errors and instead display a helpful warning that we're using the first one we found.
|
|
2229
2214
|
|
|
2230
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-909c02f10
|
|
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-909c02f10
|
|
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-909c02f10",
|
|
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-909c02f10"
|
|
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-909c02f10",
|
|
113
|
+
"react-router": "^0.0.0-experimental-909c02f10"
|
|
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/serve": "^0.0.0-experimental-
|
|
121
|
-
"react-router": "^0.0.0-experimental-
|
|
119
|
+
"@react-router/serve": "^0.0.0-experimental-909c02f10",
|
|
120
|
+
"react-router": "^0.0.0-experimental-909c02f10"
|
|
122
121
|
},
|
|
123
122
|
"peerDependenciesMeta": {
|
|
124
123
|
"@react-router/serve": {
|