⬆️ Bump remix monorepo to v2 (major) #595
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.15.0
->2.5.1
1.15.0
->2.5.1
1.15.0
->2.5.1
1.15.0
->2.5.1
1.15.0
->2.5.1
Release Notes
remix-run/remix (@remix-run/dev)
v2.5.1
Compare Source
Patch Changes
isSpaMode
to@remix-run/dev/server-build
virtual module (#8492)<!DOCTYPE html>
if not present to fix quirks mode warnings for SPA template (#8495)remix vite:build --profile
to generate a.cpuprofile
that can be shared or uploaded to speedscope.appp + enter
to start a new profiling session or stop the current sessionremix vite:dev --profile
to initialize the dev server with a running profiling session@remix-run/node@2.5.1
@remix-run/server-runtime@2.5.1
v2.5.0
Compare Source
Minor Changes
Add unstable support for "SPA Mode" (#8457)
You can opt into SPA Mode by setting
unstable_ssr: false
in your Remix Vite plugin config:Development in SPA Mode is just like a normal Remix app, and still uses the Remix dev server for HMR/HDR:
Building in SPA Mode will generate an
index.html
file in your client assets directory:To run your SPA, you serve your client assets directory via an HTTP server:
For more information, please refer to the SPA Mode docs.
Add
unstable_serverBundles
option to Vite plugin to support splitting server code into multiple request handlers. (#8332)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.
Example usage:
Patch Changes
Fix issue with
isbot
v4 released on 1/1/2024 (#8415)remix dev
will now add"isbot": "^4"
topackage.json
instead of usinglatest
entry.server
files to work with bothisbot@3
andisbot@4
for backwards-compatibility with Remix apps that have pinnedisbot
to v3isbot@4
moving forward viacreate-remix
Vite: Fix HMR issues when altering exports for non-rendered routes (#8157)
Vite: Default
NODE_ENV
to"production"
when runningremix vite:build
command (#8405)Vite: Remove Vite plugin config option
serverBuildPath
in favor of separateserverBuildDirectory
andserverBuildFile
options (#8332)Vite: Loosen strict route exports restriction, reinstating support for non-Remix route exports (#8420)
Updated dependencies:
@remix-run/server-runtime@2.5.0
@remix-run/node@2.5.0
v2.4.1
Compare Source
Patch Changes
Vite: Error messages when
.server
files are referenced by client (#8267).server
module from client code resulted in an error message like:The requested module '/app/models/answer.server.ts' does not provide an export named 'isDateType'
answer.server.ts
does provide theisDateType
export, but Remix was replacing.server
modules with empty modules (export {}
) for the client build.server
module is referenced from client code and includes dedicated error messages depending on whether the import occurs in a route or a non-route moduleRemove
unstable_viteServerBuildModuleId
in favor of manually referencing virtual module name"virtual:remix/server-build"
. (#8264)This is a breaking change for projects using the unstable Vite plugin with a custom server.
This change was made to avoid issues where
@remix-run/dev
could be inadvertently required in your server's production dependencies.Instead, you should manually write the virtual module name
"virtual:remix/server-build"
when callingssrLoadModule
in development.Vite: Fix errors for non-existent
index.html
importer (#8353)Add
vite:dev
andvite:build
commands to the Remix CLI. (#8211)In order to handle upcoming Remix features where your plugin options can impact the number of Vite builds required, you should now run your Vite
dev
andbuild
processes via the Remix CLI.Vite: Preserve names for exports from
.client
modules (#8200)Unlike
.server
modules, the main idea is not to prevent code from leaking into the server buildsince the client build is already public. Rather, the goal is to isolate the SSR render from client-only code.
Routes need to import code from
.client
modules without compilation failing and then rely on runtime checksor otherwise ensure that execution only happens within a client-only context (e.g. event handlers,
useEffect
).Replacing
.client
modules with empty modules would cause the build to fail as ESM named imports are statically analyzed.So instead, we preserve the named export but replace each exported value with
undefined
.That way, the import is valid at build time and standard runtime checks can be used to determine if the
code is running on the server or client.
Disable watch mode in Vite child compiler during build (#8342)
Vite: Show warning when source maps are enabled in production build (#8222)
Updated dependencies:
@remix-run/server-runtime@2.4.1
@remix-run/node@2.4.1
v2.4.0
Compare Source
Minor Changes
Vite: exclude modules within
.server
directories from client build (#8154)Add support for
clientLoader
/clientAction
/HydrateFallback
route exports (RFC) (#8173)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:
localStorage
)IndexedDB
)By default,
clientLoader
will not run on hydration, and will only run on subsequent client side navigations.If you wish to run your client loader on hydration, you can set
clientLoader.hydrate=true
to force Remix to execute it on initial page load. Keep in mind that Remix will still SSR your route component so you should ensure that there is no new required data being added by yourclientLoader
.If your
clientLoader
needs to run on hydration and adds data you require to render the route component, you can export aHydrateFallback
component that will render during SSR, and then your route component will not render until theclientLoader
has executed on hydration.clientAction
is simpler thanclientLoader
because it has no hydration use-cases.clientAction
will only run on client-side navigations.For more information, please refer to the
clientLoader
andclientAction
documentation.Vite: Strict route exports (#8171)
With Vite, Remix gets stricter about which exports are allowed from your route modules.
Previously, the Remix compiler would allow any export from routes.
While this was convenient, it was also a common source of bugs that were hard to track down because they only surfaced at runtime.
For more, see https://remix.run/docs/en/main/future/vite#strict-route-exports
Add a new
future.v3_relativeSplatPath
flag to implement a breaking bug fix to relative routing when inside a splat route. For more information, please see the React Router6.21.0
Release Notes and theuseResolvedPath
docs. (#8216)Patch Changes
Upgrade Vite peer dependency range to v5 (#8172)
Support HMR for routes with
handle
export in Vite dev (#8022)Fix flash of unstyled content for non-Express custom servers in Vite dev (#8076)
Bundle CSS imported in client entry file in Vite plugin (#8143)
Change Vite build output paths to fix a conflict between how Vite and the Remix compiler each manage the
public
directory. (#8077)This is a breaking change for projects using the unstable Vite plugin.
The server is now compiled into
build/server
rather thanbuild
, and the client is now compiled intobuild/client
rather thanpublic
.For more information on the changes and guidance on how to migrate your project, refer to the updated Remix Vite documentation.
Remove undocumented
legacyCssImports
option from Vite plugin due to issues with?url
imports of CSS files not being processed correctly in Vite (#8096)Vite: fix access to default
entry.{client,server}.tsx
within pnpm workspace on Windows (#8057)Remove
unstable_createViteServer
andunstable_loadViteServerBuild
which were only minimal wrappers around Vite'screateServer
andssrLoadModule
functions when using a custom server. (#8120)This is a breaking change for projects using the unstable Vite plugin with a custom server.
Instead, we now provide
unstable_viteServerBuildModuleId
so that custom servers interact with Vite directly rather than via Remix APIs, for example:Creating the Vite server in middleware mode:
Loading the Vite server build in the request handler:
Pass request handler errors to
vite.ssrFixStacktrace
in Vite dev to ensure stack traces correctly map to the original source code (#8066)Vite: Preserve names for exports from .client imports (#8200)
Unlike
.server
modules, the main idea is not to prevent code from leaking into the server buildsince the client build is already public. Rather, the goal is to isolate the SSR render from client-only code.
Routes need to import code from
.client
modules without compilation failing and then rely on runtime checksto determine if the code is running on the server or client.
Replacing
.client
modules with empty modules would cause the build to fail as ESM named imports are statically analyzed.So instead, we preserve the named export but replace each exported value with an empty object.
That way, the import is valid at build time and the standard runtime checks can be used to determine if then
code is running on the server or client.
Add
@remix-run/node
to Vite'soptimizeDeps.include
array (#8177)Improve Vite plugin performance (#8121)
server.preTransformRequests
in Vite child compiler since it's only used to process route modulesRemove automatic global Node polyfill installation from the built-in Vite dev server and instead allow explicit opt-in. (#8119)
This is a breaking change for projects using the unstable Vite plugin without a custom server.
If you're not using a custom server, you should call
installGlobals
in your Vite config instead.Vite: Errors at build-time when client imports .server default export (#8184)
Remix already stripped .server file code before ensuring that server code never makes it into the client.
That results in errors when client code tries to import server code, which is exactly what we want!
But those errors were happening at runtime for default imports.
A better experience is to have those errors happen at build-time so that you guarantee that your users won't hit them.
Fix
request instanceof Request
checks when using Vite dev server (#8062)Updated dependencies:
@remix-run/server-runtime@2.4.0
@remix-run/node@2.4.0
v2.3.1
Compare Source
Patch Changes
nonce
prop onLiveReload
component in Vite dev (#8014)public
directory in Vite build (#8039)assetsBuildDirectory
was deeply nested within thepublic
directory@remix-run/node@2.3.1
@remix-run/server-runtime@2.3.1
v2.3.0
Compare Source
Patch Changes
LiveReload
component afterScripts
in Vite dev (#7919).jsx
files without manualReact
import in Vite (#7888)LiveReload
component in Vite dev (#7919)development
andproduction
modes are present, e.g.@mdx-js/rollup
. (#7911)process.env.NODE_ENV
values other than"development"
in Vite dev (#7980)/@​fs
(#7913)server.fs.allow
.@remix-run/react
(#7926)node_modules
.Error: You must render this element inside a <Remix> element
.defer
in Vite dev server (#7842)8cd31d65
)process.env
from.env
files on the server in Vite dev (#7958)FutureConfig
type (#7895)@remix-run/server-runtime@2.3.0
@remix-run/node@2.3.0
v2.2.0
Compare Source
Minor Changes
remix build
👉vite build && vite build --ssr
remix dev
👉vite dev
future.v3_fetcherPersist
flag to change the persistence behavior of fetchers. Instead of being immediately cleaned up when unmounted in the UI, fetchers will persist until they return to anidle
state (RFC) (#7704)Patch Changes
@remix-run/server-runtime@2.2.0
@remix-run/node@2.2.0
v2.1.0
Compare Source
Patch Changes
@remix-run/server-runtime@2.1.0
v2.0.1
Compare Source
Patch Changes
getDependenciesToBundle
to handle ESM packages without main exports (#7272)package.json
in theirexports
field so that their path can be resolvedserverBuildPath
extension is.cjs
(#7180)@remix-run/server-runtime@2.0.1
v2.0.0
Compare Source
Major Changes
The
create-remix
CLI has been rewritten to feature a cleaner interface, Git repo initialization and optionalremix.init
script execution. The interactive template prompt and official Remix stack/template shorthands have also been removed so that community/third-party templates are now on a more equal footing. (#6887)create-remix
has been moved out of the Remix CLI since it's not intended for use within an existing Remix applicationremix create
command is no longer available.Enable built-in PostCSS and Tailwind support by default. (#6909)
remix.config.js
via thepostcss:false
and/ortailwind:false
flagsDrop React 17 support (#7121)
Require Node >=18.0.0 (#6939)
Compile server build to Node 18 (#7292)
await
to be used within a Remix appRemove default Node.js polyfills - you must now opt-into polyfills via the
serverNodeBuiltinsPolyfill
andbrowserNodeBuiltinsPolyfill
configs (#7269)Remove
v2_errorBoundary
flag andCatchBoundary
implementation (#6906)Remove
v2_normalizeFormMethod
future flag - allformMethod
values will be normalized in v2 (#6875)Remove
v2_routeConvention
flag - the flat route file convention is now standard (#6969)Remove
v2_headers
flag - it is now the default behavior to use the deepestheaders
function in the route tree (#6979)The route
meta
API now defaults to the new "V2 Meta" API (#6958)Default to
serverModuleFormat: "esm"
and updateremix-serve
to use dynamic import to support ESM and CJS build outputs (#6949)Remove
serverBuildTarget
config option (#6896)Remove deprecated
REMIX_DEV_HTTP_ORIGIN
env var - useREMIX_DEV_ORIGIN
instead (#6963)Remove
devServerBroadcastDelay
config option (#7063)Remove deprecated
devServerPort
option - use--port
/dev.port
instead (#7078)Remove deprecated
REMIX_DEV_SERVER_WS_PORT
env var - useremix dev
's '--port
/port
option instead (#6965)Stop passing
isTypeScript
toremix.init
script (#7099)Remove
replace-remix-magic-imports
codemod (#6899)Remove deprecated
--no-restart
/restart
cli args/flags - use--manual
/manual
instead (#6962)Remove deprecated
--scheme
/scheme
and--host
/host
cli args/flags - useREMIX_DEV_ORIGIN
instead (#6962)Promote the
future.v2_dev
flag inremix.config.js
to a root leveldev
config (#7002)Remove
browserBuildDirectory
config option (#6900)Remove
serverBuildDirectory
config option ([#6897](https://github.com/remix-run/remix/pull/- Removecodemod
command (#6918)6897))
Removed support for "magic exports" from the
remix
package. This package can be removed from yourpackage.json
and you should update all imports to use the source@remix-run/*
packages: (#6895)Minor Changes
Warn users about obsolete future flags in
remix.config.js
(#7048)Detect built mode via
build.mode
(#6964)build.mode
to determine if HMR should be performedSupport
bun
package manager (#7074)The
serverNodeBuiltinsPolyfill
option (along with the newly addedbrowserNodeBuiltinsPolyfill
) now supports defining global polyfills in addition to module polyfills (#7269)For example, to polyfill Node's
Buffer
global:Patch Changes
Fix importing of PNGs, SVGs, and other assets from packages in
node_modules
(#6813, #7182)Decouple the
@remix-run/dev
package from the contents of the@remix-run/css-bundle
package. (#6982)@remix-run/css-bundle
package are now entirely managed by the Remix compiler@remix-run/dev
without upgrading@remix-run/css-bundle
Allow non-development modes for
remix watch
(#7117)Stop
remix dev
whenesbuild
is not running (#7158)Do not interpret JSX in
.ts
files (#7306)While JSX is supported in
.js
files for compatibility with existing apps and libraries,.ts
files should not contain JSX. By not interpreting.ts
files as JSX,.ts
filescan contain single-argument type generics without needing a comma to disambiguate from JSX:
Enhance obsolete flag warning for
future.v2_dev
if it was an object, and prompt users to lift it to the rootdev
config (#7427)Allow decorators in app code (#7176)
Allow JSX in
.js
files during HMR (#7112)Kill app server when remix dev terminates (#7280)
Support dependencies that import polyfill packages for Node built-ins via a trailing slash (e.g. importing the
buffer
package withvar Buffer = require('buffer/').Buffer
as recommended in their README) (#7198)Dynamic require of "buffer/" is not supported
)Surface errors when PostCSS config is invalid (#7391)
Restart dev server when Remix config changes (#7269)
Remove outdated ESM import warnings (#6916)
Do not trigger rebuilds when
.DS_Store
changes (#7172)Remove warnings for stabilized flags: (#6905)
unstable_cssSideEffectImports
unstable_cssModules
unstable_vanillaExtract
Allow any mode (
NODE_ENV
) (#7113)Replace the deprecated
xdm
package with@mdx-js/mdx
(#4054)Write a
version.txt
sentinel file after server build is completely written (#7299)Updated dependencies:
@remix-run/server-runtime@2.0.0
v1.19.3
Compare Source
Patch Changes
devServerBroadcastDelay
anddevServerPort
config options (#7064)@remix-run/server-runtime@1.19.3
v1.19.2
Compare Source
Patch Changes
proxy-agent
to resolve npm audit security vulnerability (#7027)@remix-run/server-runtime@1.19.2
v1.19.1
Compare Source
Patch Changes
@remix-run/server-runtime@1.19.1
v1.19.0
Compare Source
Minor Changes
improved networking options for
v2_dev
(#6724)deprecate the
--scheme
and--host
options and replace them with theREMIX_DEV_ORIGIN
environment variableOutput esbuild metafiles for bundle analysis (#6772)
Written to server build directory (
build/
by default):metafile.css.json
metafile.js.json
(browser JS)metafile.server.json
(server JS)Metafiles can be uploaded to https://esbuild.github.io/analyze/ for analysis.
Add
serverNodeBuiltinsPolyfill
config option. Inremix.config.js
you can now disable polyfills of Node.js built-in modules for non-Node.js server platforms, or opt into a subset of polyfills. (#6814, #6859, #6877)Patch Changes
ignore missing react-dom/client for react 17 (#6725)
Warn if not using
v2_dev
(#6818)Also, rename
--no-restart
to--manual
to match intention and documentation.--no-restart
remains an alias for--manual
in v1 for backwards compatibility.ignore errors when killing already dead processes (#6773)
Always rewrite css-derived assets during builds (#6837)
fix sourcemaps for
v2_dev
(#6762)Do not clear screen when dev server starts (#6719)
On some terminal emulators, "clearing" only scrolls the next line to the
top. on others, it erases the scrollback.
Instead, let users call
clear
themselves (clear && remix dev
) ifthey want to clear.
Updated dependencies:
@remix-run/server-runtime@1.19.0
v1.18.1
Compare Source
Patch Changes
react-dom/client
for React 17 (#6725)@remix-run/server-runtime@1.18.1
v1.18.0
Compare Source
Minor Changes
remix build
andremix dev
(#6596)Patch Changes
remix dev -c
: kill all descendant processes of specified command when restarting (#6663)Architect (AWS Lambda)
->Architect
in thecreate-remix
CLI to avoid confusion for other methods of deploying to AWS (i.e., SST) (#6484)esbuild-plugins-node-modules-polyfill
to 1.0.16 to ensure that the plugin is cached (#6652)@remix-run/server-runtime@1.18.0
v1.17.1
Compare Source
Patch Changes
esbuild-plugin-polyfill-node
withesbuild-plugins-node-modules-polyfill
(#6562)@remix-run/css-bundle
is detected (#6535)@remix-run/server-runtime@1.17.1
v1.17.0
Compare Source
Minor Changes
built-in tls support (#6483)
New options:
--tls-key
/tlsKey
: TLS key--tls-cert
/tlsCert
: TLS CertificateIf both TLS options are set,
scheme
defaults tohttps
v1.16.1
Compare Source
Patch Changes
loader
change detection for HDR (#6299)PATH
envvar so that it works cross-platform (e.g. Windows) (#6310).css.ts
/.css.js
files with Vanilla Extract if@vanilla-extract/css
is installed (#6345)tsconfig.json
when running usinggetConfig
(remix dev
,remix routes
,remix build
, etc) (#6156)@remix-run/server-runtime@1.16.1
v1.16.0
Compare Source
Minor Changes
Enable support for CSS Modules, Vanilla Extract and CSS side-effect imports (#6046)
These CSS bundling features were previously only available via
future.unstable_cssModules
,future.unstable_vanillaExtract
andfuture.unstable_cssSideEffectImports
options inremix.config.js
, but they have now been stabilized.In order to use these features, check out our guide to CSS bundling in your project.
Stabilize built-in PostCSS support via the new
postcss
option inremix.config.js
. As a result, thefuture.unstable_postcss
option has also been deprecated. (#5960)The
postcss
option isfalse
by default, but when set totrue
will enable processing of all CSS files using PostCSS ifpostcss.config.js
is present.If you followed the original PostCSS setup guide for Remix, you may have a folder structure that looks like this, separating your source files from its processed output:
After you've enabled the new
postcss
option, you can delete the processed files fromapp/styles
folder and move your source files fromstyles
toapp/styles
:You should then remove
app/styles
from your.gitignore
file since it now contains source files rather than processed output.You can then update your
package.json
scripts to remove any usage ofpostcss
since Remix handles this automatically. For example, if you had followed the original setup guide:Stabilize built-in Tailwind support via the new
tailwind
option inremix.config.js
. As a result, thefuture.unstable_tailwind
option has also been deprecated. (#5960)The
tailwind
option isfalse
by default, but when set totrue
will enable built-in support for Tailwind functions and directives in your CSS files iftailwindcss
is installed.If you followed the original Tailwind setup guide for Remix and want to make use of this feature, you should first delete the generated
app/tailwind.css
.Then, if you have a
styles/tailwind.css
file, you should move it toapp/tailwind.css
.Otherwise, if you don't already have an
app/tailwind.css
file, you should create one with the following contents:You should then remove
/app/tailwind.css
from your.gitignore
file since it now contains source code rather than processed output.You can then update your
package.json
scripts to remove any usage oftailwindcss
since Remix handles this automatically. For example, if you had followed the original setup guide:The Remix dev server spins up your app server as a managed subprocess. (#6133)
This keeps your development environment as close to production as possible.
It also means that the Remix dev server is compatible with any app server.
By default, the dev server will use the Remix App Server, but you opt to use your own app server by specifying the command to run it via the
-c
/--command
flag:The dev server will:
NODE_ENV=development
and warn you if it was previously set to something elseApp server coordination
In order to manage your app server, the dev server needs to be told what server build is currently being used by your app server.
This works by having the app server send a "I'm ready!" message with the Remix server build hash as the payload.
This is handled automatically in Remix App Server and is set up for you via calls to
broadcastDevReady
orlogDevReady
in the official Remix templates.If you are not using Remix App Server and your server doesn't call
broadcastDevReady
, you'll need to call it in your app server after it is up and running.For example, in an Express server:
Options
Options priority order is: 1. flags, 2. config, 3. defaults.
-c
/--command
command
remix-serve <server build path>
--http-scheme
httpScheme
http
--http-host
httpHost
localhost
--http-port
httpPort
--websocket-port
websocketPort
--no-restart
restart: false
restart: true
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.