@react-router/dev 7.7.0 → 7.7.1-pre.0

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # `@react-router/dev`
2
2
 
3
+ ## 7.7.1-pre.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Update to Prettier v3 for formatting when running `react-router reveal --no-typescript` ([#14049](https://github.com/remix-run/react-router/pull/14049))
8
+ - Updated dependencies:
9
+ - `react-router@7.7.1-pre.0`
10
+ - `@react-router/node@7.7.1-pre.0`
11
+ - `@react-router/serve@7.7.1-pre.0`
12
+
3
13
  ## 7.7.0
4
14
 
5
15
  ### Patch Changes
@@ -211,7 +221,6 @@
211
221
  ### Minor Changes
212
222
 
213
223
  - 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
224
  - By default, Lazy Route Discovery is enabled and makes manifest requests to the `/__manifest` path:
216
225
  - `routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" }`
217
226
  - You can modify the manifest path used:
@@ -410,7 +419,6 @@
410
419
  ### Minor Changes
411
420
 
412
421
  - 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
422
  - 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
423
  - 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
424
  - 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 +428,6 @@
420
428
  - `npx sirv-cli build/client --single __spa-fallback.html`
421
429
 
422
430
  - 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
431
  - `Route.HydrateFallbackProps` now also receives `loaderData`
425
432
  - This will be defined so long as the `HydrateFallback` is rendering while _children_ routes are loading
426
433
  - This will be `undefined` if the `HydrateFallback` is rendering because the route has it's own hydrating `clientLoader`
@@ -465,7 +472,6 @@
465
472
  - Skip action-only resource routes when using `prerender:true` ([#13004](https://github.com/remix-run/react-router/pull/13004))
466
473
 
467
474
  - Enhance invalid export detection when using `ssr:false` ([#12948](https://github.com/remix-run/react-router/pull/12948))
468
-
469
475
  - `headers`/`action` are prohibited in all routes with `ssr:false` because there will be no runtime server on which to run them
470
476
  - `loader` functions are more nuanced and depend on whether a given route is prerendered
471
477
  - When using `ssr:false` without a `prerender` config, only the `root` route can have a `loader`
@@ -482,7 +488,6 @@
482
488
  - Add `future.unstable_viteEnvironmentApi` flag to enable experimental Vite Environment API support ([#12936](https://github.com/remix-run/react-router/pull/12936))
483
489
 
484
490
  - 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
491
  - 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
492
  - 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
493
 
@@ -555,7 +560,6 @@
555
560
  - Properly initialize `NODE_ENV` if not already set for compatibility with React 19 ([#12578](https://github.com/remix-run/react-router/pull/12578))
556
561
 
557
562
  - 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
563
  - 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
564
  - 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
565
 
@@ -634,14 +638,13 @@
634
638
  await writeFile(
635
639
  "build/manifest.json",
636
640
  JSON.stringify(buildManifest, null, 2),
637
- "utf-8"
641
+ "utf-8",
638
642
  );
639
643
  },
640
644
  } satisfies Config;
641
645
  ```
642
646
 
643
647
  - 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
648
  - Examples: `LoaderFunction`, `LoaderFunctionArgs`, `ActionFunction`, `ActionFunctionArgs`, `DataFunctionArgs`, `RouteManifest`, `LinksFunction`, `Route`, `EntryRoute`
646
649
  - The `RouteManifest` type used by the "remix" code is now slightly stricter because it is using the former `@remix-run/router` `RouteManifest`
647
650
  - `Record<string, Route> -> Record<string, Route | undefined>`
@@ -649,7 +652,6 @@
649
652
  - Removed `ServerRuntimeMeta*` types in favor of the `Meta*` types they were duplicated from
650
653
 
651
654
  - Update default `isbot` version to v5 and drop support for `isbot@3` ([#11770](https://github.com/remix-run/react-router/pull/11770))
652
-
653
655
  - If you have `isbot@4` or `isbot@5` in your `package.json`:
654
656
  - You do not need to make any changes
655
657
  - If you have `isbot@3` in your `package.json` and you have your own `entry.server.tsx` file in your repo
@@ -659,7 +661,6 @@
659
661
  - 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
662
 
661
663
  - Drop support for Node 18, update minimum Node vestion to 20 ([#12171](https://github.com/remix-run/react-router/pull/12171))
662
-
663
664
  - Remove `installGlobals()` as this should no longer be necessary
664
665
 
665
666
  - 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 +698,6 @@
697
698
  ```
698
699
 
699
700
  This initial implementation targets type inference for:
700
-
701
701
  - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
702
702
  - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
703
703
  - `ActionData` : Action data from `action` and/or `clientAction` within your route module
@@ -712,7 +712,6 @@
712
712
  ```
713
713
 
714
714
  Check out our docs for more:
715
-
716
715
  - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
717
716
  - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
718
717
 
@@ -735,7 +734,6 @@
735
734
  ### Minor Changes
736
735
 
737
736
  - New `future.unstable_singleFetch` flag ([#8773](https://github.com/remix-run/remix/pull/8773))
738
-
739
737
  - 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
738
  - You can return naked objects with `Promise`'s without needing to use `defer()` - including nested `Promise`'s
741
739
  - If you need to return a custom status code or custom response headers, you can still use the `defer` utility
@@ -882,11 +880,9 @@
882
880
  - Always ignore route files starting with `.` ([#8801](https://github.com/remix-run/remix/pull/8801))
883
881
 
884
882
  - 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
883
  - 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
884
 
888
885
  - 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
886
  - ⚠️ **This is a breaking change for projects using the unstable Vite plugin with a `publicPath`**
891
887
  - 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
888
 
@@ -915,7 +911,6 @@
915
911
  - Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654))
916
912
 
917
913
  - Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613))
918
-
919
914
  - `--sourcemapClient`
920
915
 
921
916
  - `--sourcemapClient=inline`
@@ -1142,7 +1137,7 @@
1142
1137
  remix({
1143
1138
  unstable_serverBundles: ({ branch }) => {
1144
1139
  const isAuthenticatedRoute = branch.some(
1145
- (route) => route.id === "routes/_authenticated"
1140
+ (route) => route.id === "routes/_authenticated",
1146
1141
  );
1147
1142
 
1148
1143
  return isAuthenticatedRoute ? "authenticated" : "unauthenticated";
@@ -1155,7 +1150,6 @@
1155
1150
  ### Patch Changes
1156
1151
 
1157
1152
  - Fix issue with `isbot` v4 released on 1/1/2024 ([#8415](https://github.com/remix-run/remix/pull/8415))
1158
-
1159
1153
  - `remix dev` will now add `"isbot": "^4"` to `package.json` instead of using `latest`
1160
1154
  - 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
1155
  - Templates are updated to use `isbot@4` moving forward via `create-remix`
@@ -1177,7 +1171,6 @@
1177
1171
  ### Patch Changes
1178
1172
 
1179
1173
  - Vite: Error messages when `.server` files are referenced by client ([#8267](https://github.com/remix-run/remix/pull/8267))
1180
-
1181
1174
  - Previously, referencing a `.server` module from client code resulted in an error message like:
1182
1175
  - `The requested module '/app/models/answer.server.ts' does not provide an export named 'isDateType'`
1183
1176
  - 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 +1247,6 @@
1254
1247
  - 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
1248
 
1256
1249
  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
1250
  - Leveraging a data source local to the browser (i.e., `localStorage`)
1259
1251
  - Managing a client-side cache of server data (like `IndexedDB`)
1260
1252
  - Bypassing the Remix server in a BFF setup and hitting your API directly from the browser
@@ -1363,7 +1355,6 @@
1363
1355
  - Add `@remix-run/node` to Vite's `optimizeDeps.include` array ([#8177](https://github.com/remix-run/remix/pull/8177))
1364
1356
 
1365
1357
  - Improve Vite plugin performance ([#8121](https://github.com/remix-run/remix/pull/8121))
1366
-
1367
1358
  - Parallelize detection of route module exports
1368
1359
  - Disable `server.preTransformRequests` in Vite child compiler since it's only used to process route modules
1369
1360
 
@@ -1533,7 +1524,6 @@
1533
1524
  - Additionally, all runtimes (including non-Node runtimes) can use `build.mode` to determine if HMR should be performed
1534
1525
  - Support `bun` package manager ([#7074](https://github.com/remix-run/remix/pull/7074))
1535
1526
  - 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
1527
  - For example, to polyfill Node's `Buffer` global:
1538
1528
 
1539
1529
  ```js
@@ -1556,7 +1546,6 @@
1556
1546
  - 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
1547
 
1558
1548
  - 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
1549
  - The contents of the `@remix-run/css-bundle` package are now entirely managed by the Remix compiler
1561
1550
  - 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
1551
 
@@ -1565,7 +1554,6 @@
1565
1554
  - Stop `remix dev` when `esbuild` is not running ([#7158](https://github.com/remix-run/remix/pull/7158))
1566
1555
 
1567
1556
  - Do not interpret JSX in `.ts` files ([#7306](https://github.com/remix-run/remix/pull/7306))
1568
-
1569
1557
  - While JSX is supported in `.js` files for compatibility with existing apps and libraries,
1570
1558
  `.ts` files should not contain JSX. By not interpreting `.ts` files as JSX, `.ts` files
1571
1559
  can contain single-argument type generics without needing a comma to disambiguate from JSX:
@@ -1599,7 +1587,6 @@
1599
1587
  - Kill app server when remix dev terminates ([#7280](https://github.com/remix-run/remix/pull/7280))
1600
1588
 
1601
1589
  - 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
1590
  - These imports were previously marked as external
1604
1591
  - 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
1592
 
@@ -1608,14 +1595,12 @@
1608
1595
  - Restart dev server when Remix config changes ([#7269](https://github.com/remix-run/remix/pull/7269))
1609
1596
 
1610
1597
  - Remove outdated ESM import warnings ([#6916](https://github.com/remix-run/remix/pull/6916))
1611
-
1612
1598
  - Most of the time these warnings were false positives.
1613
1599
  - Instead, we now rely on built-in Node warnings for ESM imports.
1614
1600
 
1615
1601
  - Do not trigger rebuilds when `.DS_Store` changes ([#7172](https://github.com/remix-run/remix/pull/7172))
1616
1602
 
1617
1603
  - Remove warnings for stabilized flags: ([#6905](https://github.com/remix-run/remix/pull/6905))
1618
-
1619
1604
  - `unstable_cssSideEffectImports`
1620
1605
  - `unstable_cssModules`
1621
1606
  - `unstable_vanillaExtract`
@@ -1665,7 +1650,6 @@
1665
1650
  - Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772))
1666
1651
 
1667
1652
  Written to server build directory (`build/` by default):
1668
-
1669
1653
  - `metafile.css.json`
1670
1654
  - `metafile.js.json` (browser JS)
1671
1655
  - `metafile.server.json` (server JS)
@@ -1763,7 +1747,6 @@
1763
1747
  - built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483))
1764
1748
 
1765
1749
  New options:
1766
-
1767
1750
  - `--tls-key` / `tlsKey`: TLS key
1768
1751
  - `--tls-cert` / `tlsCert`: TLS Certificate
1769
1752
 
@@ -1834,7 +1817,7 @@
1834
1817
  key: fs.readFileSync("key.pem"),
1835
1818
  cert: fs.readFileSync("cert.pem"),
1836
1819
  },
1837
- app
1820
+ app,
1838
1821
  );
1839
1822
 
1840
1823
  appServer.listen(3000, () => {
@@ -1897,7 +1880,6 @@
1897
1880
  - restore color for app server output ([#6485](https://github.com/remix-run/remix/pull/6485))
1898
1881
 
1899
1882
  - 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
1883
  - 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
1884
 
1903
1885
  - 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 +2017,6 @@
2035
2017
  ```
2036
2018
 
2037
2019
  The dev server will:
2038
-
2039
2020
  - force `NODE_ENV=development` and warn you if it was previously set to something else
2040
2021
  - rebuild your app whenever your Remix app code changes
2041
2022
  - restart your app server whenever rebuilds succeed
@@ -2165,7 +2146,6 @@
2165
2146
  - Added deprecation warning for `v2_normalizeFormMethod` ([#5863](https://github.com/remix-run/remix/pull/5863))
2166
2147
 
2167
2148
  - 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
2149
  - When `future.v2_normalizeFormMethod === false`,
2170
2150
  - `useNavigation().formMethod` is lowercase
2171
2151
  - `useFetcher().formMethod` is uppercase
@@ -2240,7 +2220,6 @@
2240
2220
  ### Patch Changes
2241
2221
 
2242
2222
  - 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
2223
  - Route conflict no longer throw errors and instead display a helpful warning that we're using the first one we found.
2245
2224
 
2246
2225
  ```log
package/dist/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @react-router/dev v7.7.0
3
+ * @react-router/dev v7.7.1-pre.0
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
  });
@@ -7,6 +7,6 @@ startTransition(() => {
7
7
  document,
8
8
  <StrictMode>
9
9
  <HydratedRouter />
10
- </StrictMode>
10
+ </StrictMode>,
11
11
  );
12
12
  });
@@ -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
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.7.0
2
+ * @react-router/dev v7.7.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/routes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.7.0
2
+ * @react-router/dev v7.7.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -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();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.7.0
2
+ * @react-router/dev v7.7.1-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.7.0
2
+ * @react-router/dev v7.7.1-pre.0
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.cjs"), "utf8"),
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": "7.7.0",
3
+ "version": "7.7.1-pre.0",
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": "^2.7.1",
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": "7.7.0"
89
+ "@react-router/node": "7.7.1-pre.0"
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": "7.7.0",
114
- "react-router": "^7.7.0"
112
+ "@react-router/serve": "7.7.1-pre.0",
113
+ "react-router": "^7.7.1-pre.0"
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": "^7.7.0",
121
- "react-router": "^7.7.0"
119
+ "@react-router/serve": "^7.7.1-pre.0",
120
+ "react-router": "^7.7.1-pre.0"
122
121
  },
123
122
  "peerDependenciesMeta": {
124
123
  "@react-router/serve": {