- Removed
useRouteData
in favor ofuseLoaderData
- Removed
usePendingLocation
in favor ofuseTransition().location
- Removed
usePendingFormSubmit
in favor ofuseTransition().submission
- Removed
*.json
module type to allow TS to auto-type.json
imports
- Several users felt that the
remix dev
command did not behave as expected. The CLI commandremix dev
has been changed toremix watch
, andremix run
has been changed toremix dev
to hopefully make the CLI a bit more intuitive. Please note thatremix dev
requires that@remix-run/serve
is installed as a dependency, just asremix run
did before.
- Added CatchBoundary export to route modules. This is the codepath taken when a loader or action throws a Response instance
- Removed routes/404 file in favor of root CatchBoudnary export
- CLI no longer crashes on syntax errors and reports errors with location
- Dynamic imports no longer blows up build
- Renamed @remix-run/node to @remix-run/server-runtime and abstracted node specific functionality back to the repurposed @remix-run/node
- Moved fileStorage session to remix-node this removes the last node specific platform modules from remix-server-runtime as far as I'm aware
- Made cookie parse and serialize methods async to support web crypto API
- Moved to webcrypto instead of "crypto" to support more platforms
- Updated .npmrc to minimum required version for webcrypto API (v15)
- Abstracted req and res types through the platform
- Add base64 encoding primitives to node globals (atob and btoa)
- Adds and improves testing around node adapters
- Fixes the ability to set multiple Set-Cookie headers
- Adds a Netlify adapter and starter template
This is a history of changes to Remix.
- Fixed
npm init remix
using npm 6
- Added dynamic install support for
@remix-run/node
and@remix-run/react
to theremix
package, so it is updated when they are installed - Moved templates from
create-remix
package into@remix-run/init
so they can be versioned and published along with all other Remix packages
- Added a new
remix
package for all app code imports
- Removed the old compiler, streamlined
remix
CLI commands - Use
<LiveReload>
elemente instead ofuseLiveReload()
hook
- Added
.client.js
support to the new compiler for keeping browser-specific code out of the server build
- Fixed some uses of
.server.js
when esbuild is not able to prune theimport
for some reason (still need to figure out why). Instead of marking.server.js
modules as "external", they are now substituted with an empty module instead.
- Added
.server.js
support to the new compiler as an escape hatch for server-only code that should not end up in the browser bundles
- Fix external module detection on Windows
- Introduced new compiler based on esbuild
- Removed
@remix-run/data
package. Use@remix-run/node
package instead - Rename
@remix-run/core
=>@remix-run/node
- Always use
.css
extension on output files forcss:
imports - Avoid an infinite loop when importing files w/out
url:
hint
- Streamlined production builds and deploy requirements
- No more deploying app source code (
remix.config.js
and/or theapp
directory) to production - No more including Remix dev-only dependencies in production deploys
- No more deploying app source code (
- Eliminated dynamic requires from production builds
- Added
config.cacheDirectory
for caching compiler build output
- Don't replace
process.env.NODE_ENV
in (node) server builds
- Removed
@remix-run/cli
package, use@remix-run/dev
instead
- Fixed ignoring
*.client.js
and*.server.js
files in server/browser builds (respectively) when the.js
extension is missing from theimport
- Allow dependencies (
node_modules
) to have side effects
- Fixed manual catchall (*) routes
- Added
@remix-run/dev
package for all dev-specific functions
- Removed
@remix-run/cli
package. Use@remix-run/dev
instead
- Added
css:
import type
- Renamed
entry-browser.js
toentry.client.js
andentry-server.js
toentry.server.js
- Added support for excluding
*.client.js
files from the server bundles and*.server.js
files from the browser bundles - Added
css:
imports with postcss processing - Added
useMatches()
hook to get access to the layout's route matches and data - Added Route Module
handle
export to create application layout conventions - Added
action
tousePendingFormSubmit()
- Fixed 404 pages
- Fixed using non-HTML elements (e.g.
FormData
,URLSearchParams
) withuseSubmit
- Fixed using Open Graph tags with route
meta
function
- Added
url:
import assertion to import, hash, and emit static files to the browser build directory. - Added route module
links
export and<Links>
component to add<link>
elements to the the document for specific routes - Added @remix-run/react
block
to block asset links on script transitions - Added
{ page: pathname }
links to prefetch assets to other pages the user might visit - Added automatic stylesheet link blocking on script transitions to follow normal browser behavior on document transitions
- JavaScript modules no longer cause waterfall of import requests, all scripts are fetched in parallel with
modulepreload
- Stylesheet links are automatically added as "preload" to give higher priority to speed up initial render while JavaScript modules continue to download
- Removed manifest request on every transition
- Added
useSubmit
anduseFormAction
hooks - Added support for
<button formAction>
and<input formAction>
as well asformMethod
andformEnctype
- Automatically pass
Set-Cookie
headers from loaders and parent routes through to entry on document requests - Accept
null
as argument tocookie.parse()
- Leaf route determines headers on document requests instead of aggregating headers from all routes
- Removed conventional route css files and global.css in lieu of
links
API
- Added
HeadersFunction
andMetaFunction
exports to@remix-run/data
to allow typing of routeheaders()
andmeta()
functions
- Added
@types/cookie
as a regular dependency sincecreateCookie
andcreateSessionStorage
rely on it - Fixed
redirect()
default status code when headers are used as the 2nd arg
- Added
SessionStorage
interface for managing sessions at the route level instead of globally using some cloud provider middleware - Added several built-in
SessionStorage
providers including:createCookieSessionStorage
createFileSessionStorage
createMemorySessionStorage
- Added
createSessionStorage
for easily implementing theSessionStorage
interface usingSessionIdStorageStrategy
using any database - Added
Cookie
interface andcreateCookie
API for handling cookies, including support for signed cookies - Added
session.has(name)
- Removed
session.destroy()
method, usestorage.destroySession(session)
instead - Removed
session
arg from routeloader
s andaction
s - Removed
enableSessions
arg fromcreateRequestHandler
. Sessions are now handled at the route level instead of in platform middleware.
- Fixed Vercel starter deployments
- Fixed srcset return string
- Fixed layout file names on windows
- Consolidated multiple layout APIs into one:
root.ts
- Added response init support to
redirect()
helper - Added easier status support to
json()
helper - Added
img:
imports to import and process images
- Fixed nested loader errors server rendering in a parent error boundary instead of it's own
- Removed
global-loader
, changed to a normalexport function loader(){}
onroot.ts
route. - Removed
<Remix ErrorBoundary>
, changed to a normalexport function ErrorBoundary(){}
onroot.ts
route. - Removed
<Remix children={<App/>}>
, renameApp.ts
toapp/root.ts
- Removed
useGlobalData
hook, useuseRouteData
inroot.ts
. - Removed
<Routes />
, use React Router<Outlet/>
inroot.ts
- Removed
parseFormBody
helper. Usenew URLSearchParams(await request.text())
or (future)await request.formData()
instead.
- Added a fix for deleting/renaming routes in dev mode
- Added error handling for both render and loader errors
- Adds
loader
andaction
exports to route modules - Assets are now served from the app server in development, instead of a separate asset server
- Removes
data
directory (anddataDirectory
fromremix.config.js
) - Renames
data/global.js
toapp/global-data.js
- fixed
<Form>
on Vercel
- Stopped hashing server bundle files so deployments work on Vercel
- Added @remix-run/vercel adapter to deploy to Vercel
- Added @remix-run/architect adapter to deploy to AWS with Architect
- Added React 17 and new JSX transform support
- Can pass
ref
to<Form/>
- Browser module names no longer cause problems for hosts (no longer write to
public/_shared/node_modules
) - Fixed
Loader
andAction
types for data modules - Fixed dependency declarations so apps can use different React versions (16.8+, 17.x+)
- Adds a
<Form>
component andusePendingFormSubmit()
hook to@remix-run/react
for data mutations - Adds support for form actions in loaders. Loaders now have two possible
exports:
loader
andaction
.loader
is used onGET
requests.action
is called onPOST
,PUT
,PATCH
, andDELETE
mutations. - Adds
usePendingLocation
- Adds
usePendingFormSubmit
- Adds
parseFormBody(request)
- Adds
request
property passed to loaders and actions - Adds
{ session }
property to data loaders and actions - Adds support for importing
.json
files. - Ignore node built-ins when building browser bundles. Use
browser
field in package.json for packages that publish browser-ready shims. - Adds support for
.ts
and.tsx
extensions onroutes/404
androutes/500
- Fixed error when rendering 500 pages
- Removed unused
rollup-plugin-postcss
- Fixed browser transitions not sending search params to the loader
- redirects don't follow the redirects in the browser anymore, avoiding extra requests
- removes
useLocationPending
removed in favor ofusePendingLocation
- loader
url
property removed in favor ofrequest
- Renamed the
loaders
directory todata
. Also,loadersDirectory
is nowdataDirectory
inremix.config.js
. - Removed support for default exports in data loaders. They should all export
loader
and/oraction
functions now. - Removed
notFound
helper from@remix-run/loader
because it was confusing. Usejson(null, { status: 404 })
(or something other thannull
, depending on what you want for data) instead.
- Treat data loader redirects the same in client-side transitions as we do in HTML requests.
- Added ability to pass a function into
remix.config.mdx = (attrs, filename) => {}
- Various dev server improvements, decoupling it from node and simplifying the process model by relying on reloading the process when files change.
- Fixed "MaxListenersExceedWarning" warning in dev
- Default to production mode in
remix build
- Default to production mode when running the server
- Second attempt at fixing the build on Windows machines
- Fix the build on Windows machines to not externalize local modules
- Temporarily disable caching fetches in node for now. It seems like there are bugs there...
- Minify production builds using terser
- Add caching and
{ compress: false }
toglobal.fetch
in node - Add more strict return type to
createRequestHandler
in@remix-run/express
- Add
GetLoadContext
interface to@remix-run/express
- Re-use data we already have for routes already on the page instead of making a separate data request
- Preload stylesheets in 1 request instead of 2
- Changed
__remix_data
and__remix_manifest
endpoints to/_remix/data
and/_remix/manifest
respectively to shorten the visible portion of the URL pathname in Chrome's network tab
- Use the right return type for
<RemixBrowser>
and<RemixServer>
- Added TypeScript declarations
- Added
fetch
globals to server code includingentry-server.js
and data loaders
node_modules
dependencies now load in their own bundle which should improve caching
- Fixed route data not updating when params change
- Renamed
data
directory back toloaders
- Return data directly (instead of
useState
tuple) fromuseGlobalData
anduseRouteData
- Default to
NODE_ENV=development
inremix build
- Added Cache-Control to
/__remix_manifest
responses for better cacheability (#4) - Remove location-based browser data cache, use built-in caching instead (#15)
- Automatically reload the page when we detect the build has changed (#7)
- Added
useBeforeUnload
hook for saving state immediately before reload - Added
json
andredirect
helpers to@remix-run/loader
- Don't call
/__remix_data
for routes that don't have data loaders (#3)
- Add support for
.md
and.mdx
in conventional routes (app/routes
) - Wait for CSS
<link>
tags to load before transitioning to a new route (#16)
- Fixed code splitting causing errors with shared chunks in development
- Fixed dev server crash when renaming/deleting CSS files (#11)
- Default to development mode when running the server (#10)
- Added support for watching
.css
files inremix run
- Moved styles from
app/styles
intoapp/routes
- Moved route data loaders from
data/loaders
todata/routes
- Added
url
property to data loader arg - Added support for
headers({ loaderHeaders, parentsHeaders })
function in route modules - Added support for array initializer in
Headers
- Fixed storage/retrieval of falsy values from data loaders in client data cache
- Renamed
allData
property onmeta()
arg toparentsData
(to matchparentsHeaders
property onheaders()
arg) - Removed
pathname
andsearch
properties from data loader arg, useurl.pathname
andurl.search
instead - Removed
redirect
from@remix-run/loader
. UseResponse.redirect
instead - Renamed
<RemixServer request>
to<RemixServer url>