|
1 | 1 | # `@remix-run/dev` |
2 | 2 |
|
| 3 | +## 2.5.0-pre.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- Add `unstable_serverBundles` option to Vite plugin to support splitting server code into multiple request handlers. ([#8332](https://github.com/remix-run/remix/pull/8332)) |
| 8 | + |
| 9 | + This is an advanced feature designed for hosting provider integrations. When compiling your app into multiple server bundles, there will need to be a custom routing layer in front of your app directing requests to the correct bundle. This feature is currently unstable and only designed to gather early feedback. |
| 10 | + |
| 11 | + **Example usage:** |
| 12 | + |
| 13 | + ```ts |
| 14 | + import { unstable_vitePlugin as remix } from "@remix-run/dev"; |
| 15 | + import { defineConfig } from "vite"; |
| 16 | + |
| 17 | + export default defineConfig({ |
| 18 | + plugins: [ |
| 19 | + remix({ |
| 20 | + unstable_serverBundles: ({ branch }) => { |
| 21 | + const isAuthenticatedRoute = branch.some( |
| 22 | + (route) => route.id === "routes/_authenticated" |
| 23 | + ); |
| 24 | + |
| 25 | + return isAuthenticatedRoute ? "authenticated" : "unauthenticated"; |
| 26 | + }, |
| 27 | + }), |
| 28 | + ], |
| 29 | + }); |
| 30 | + ``` |
| 31 | + |
| 32 | +- Add unstable support for "SPA Mode" ([#8457](https://github.com/remix-run/remix/pull/8457)) |
| 33 | + |
| 34 | + You can opt into SPA Mode by setting `unstable_ssr: false` in your Remix Vite plugin config: |
| 35 | + |
| 36 | + ```js |
| 37 | + // vite.config.ts |
| 38 | + import { unstable_vitePlugin as remix } from "@remix-run/dev"; |
| 39 | + import { defineConfig } from "vite"; |
| 40 | + |
| 41 | + export default defineConfig({ |
| 42 | + plugins: [remix({ unstable_ssr: false })], |
| 43 | + }); |
| 44 | + ``` |
| 45 | + |
| 46 | + Development in SPA Mode is just like a normal Remix app, and still uses the Remix dev server for HMR/HDR: |
| 47 | + |
| 48 | + ```sh |
| 49 | + remix vite:dev |
| 50 | + ``` |
| 51 | + |
| 52 | + Building in SPA Mode will generate an `index.html` file in your client assets directory: |
| 53 | + |
| 54 | + ```sh |
| 55 | + remix vite:build |
| 56 | + ``` |
| 57 | + |
| 58 | + To run your SPA, you serve your client assets directory via an HTTP server: |
| 59 | + |
| 60 | + ```sh |
| 61 | + npx http-server build/client |
| 62 | + ``` |
| 63 | + |
| 64 | + For more information, please refer to the [SPA Mode docs][https://reactrouter.com/en/main/guides/spa-mode]. |
| 65 | + |
| 66 | +### Patch Changes |
| 67 | + |
| 68 | +- Vite: Fix HMR issues when altering exports for non-rendered routes ([#8157](https://github.com/remix-run/remix/pull/8157)) |
| 69 | +- Vite: Default `NODE_ENV` to `"production"` when running `remix vite:build` command ([#8405](https://github.com/remix-run/remix/pull/8405)) |
| 70 | +- Remove Vite plugin config option `serverBuildPath` in favor of separate `serverBuildDirectory` and `serverBuildFile` options ([#8332](https://github.com/remix-run/remix/pull/8332)) |
| 71 | +- Vite: Loosen strict route exports restriction, reinstating support for non-Remix route exports ([#8420](https://github.com/remix-run/remix/pull/8420)) |
| 72 | +- Fix issue with `isbot` v4 released on 1/1/2024 ([#8415](https://github.com/remix-run/remix/pull/8415)) |
| 73 | + |
| 74 | + - `remix dev` wil now add `"isbot": "^4"` to `package.json` instead of using `latest` |
| 75 | + - 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 |
| 76 | + - Templates are updated to use `isbot@4` moving forward via `create-remix` |
| 77 | + |
| 78 | +- Updated dependencies: |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
3 | 83 | ## 2.4.1 |
4 | 84 |
|
5 | 85 | ### Patch Changes |
|
0 commit comments