@remix-run/eslint-config
This package includes a shareable ESLint config for Remix projects.
If you create your app with create-remix
no additional configuration is necessary.
Installation
First, install this package along with ESLint in your project. This package requires at least version 8.1 of ESLint
npm install -D eslint @remix-run/eslint-config
Then create a file named .eslintrc.js
in the root of your project:
module.exports = {
extends: "@remix-run/eslint-config",
};
Jest + Testing Library
This packages also ships with optional configuration options for projects that use Jest with Testing Library. To enable these rules, add the following to your .eslintrc
:
module.exports = {
extends: [
"@remix-run/eslint-config",
"@remix-run/eslint-config/jest-testing-library",
],
};
Please note that because this ruleset is optional, we do not include the core libraries as peer dependencies for this package. If you use these rules, be sure that you have the following dependencies installed in your project:
{
"dependencies": {
"@testing-library/jest-dom": ">=5.16.0",
"@testing-library/react": ">=12.0.0",
"jest": ">=28.0.0"
}
}
v2.5.0
Date: 2024-01-11
What's Changed
SPA Mode (unstable)
SPA Mode (RFC) allows you to generate your Remix app as a standalone SPA served from a static index.html
file. You can opt into SPA Mode by setting unstable_ssr: false
in your Remix Vite plugin config:
// vite.config.ts
import { unstable_vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [remix({ unstable_ssr: false })],
});
Development in SPA Mode is just like a normal Remix app, and still uses the Remix dev server for HMR/HDR:
remix vite:dev
Building in SPA Mode will generate an index.html
file in your client assets directory:
remix vite:build
To run your SPA, you serve your client assets directory via an HTTP server:
npx http-server build/client
For more information, please refer to the SPA Mode docs.
Server Bundles (unstable)
This is an advanced feature designed for hosting provider integrations where you may want to split server code into multiple request handlers. 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.
You can control the server bundles generated by your Remix Vite build by setting the unstable_serverBundles
option in your vite config:
import { unstable_vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
remix({
unstable_serverBundles: ({ branch }) => {
const isAuthenticatedRoute = branch.some(
(route) => route.id === "routes/_authenticated"
);
return isAuthenticatedRoute ? "authenticated" : "unauthenticated";
},
}),
],
});
Minor Changes
- Add unstable support for "SPA Mode" (#8457)
- Add
unstable_serverBundles
option to Vite plugin to support splitting server code into multiple request handlers (#8332)
Patch Changes
create-remix
: Only update *
versions for Remix dependencies (#8458)
remix-serve
: Don't try to load sourcemaps if they don't exist on disk (#8446)
@remix-run/dev
: Fix issue with isbot@4
released on 1/1/2024 (#8415)
remix dev
will now add "isbot": "^4"
to package.json
instead of using latest
- 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@3
- Templates are updated to use
isbot@4
moving forward via create-remix
@remix-run/dev
: Vite - Fix HMR issues when altering exports for non-rendered routes (#8157)
@remix-run/dev
: Vite - Default NODE_ENV
to "production"
when running remix vite:build
command (#8405)
@remix-run/dev
: Vite - Remove Vite plugin config option serverBuildPath
in favor of separate serverBuildDirectory
and serverBuildFile
options (#8332)
@remix-run/dev
: Vite - Loosen strict route exports restriction, reinstating support for non-Remix route exports (#8420)
@remix-run/react
: Vite - Fix type conflict with import.meta.hot
from the existing Remix compiler (#8459)
@remix-run/server-runtime
: Updated cookie
dependency to 0.6.0
to inherit support for the Partitioned
attribute (#8375)
Updated Dependencies
Changes by Package
Full Changelog: v2.4.1...v2.5.0