Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Bump remix monorepo to v2 (major) #595

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 28, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@remix-run/dev (source) 1.15.0 -> 2.5.1 age adoption passing confidence
@remix-run/node (source) 1.15.0 -> 2.5.1 age adoption passing confidence
@remix-run/react (source) 1.15.0 -> 2.5.1 age adoption passing confidence
@remix-run/serve (source) 1.15.0 -> 2.5.1 age adoption passing confidence
@remix-run/server-runtime (source) 1.15.0 -> 2.5.1 age adoption passing confidence

Release Notes

remix-run/remix (@​remix-run/dev)

v2.5.1

Compare Source

Patch Changes
  • Add isSpaMode to @remix-run/dev/server-build virtual module (#​8492)
  • Automatically prepend <!DOCTYPE html> if not present to fix quirks mode warnings for SPA template (#​8495)
  • Vite: Errors for server-only code point to new docs (#​8488)
  • Vite: Fix HMR race condition when reading changed file contents (#​8479)
  • Vite: Tree-shake unused route exports in the client build (#​8468)
  • Vite: Performance profiling (#​8493)
    • Run remix vite:build --profile to generate a .cpuprofile that can be shared or uploaded to speedscope.app
    • In dev, press p + enter to start a new profiling session or stop the current session
    • If you need to profile dev server startup, run remix vite:dev --profile to initialize the dev server with a running profiling session
    • For more, see the new docs: Vite > Performance
  • Vite: Improve performance of dev server requests by invalidating Remix's virtual modules on relevant file changes rather than on every request (#​8164)
  • Updated dependencies:
    • @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:

    // vite.config.ts
    import { unstable_vitePlugin as remix } from "@&#8203;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.

  • 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:

    import { unstable_vitePlugin as remix } from "@&#8203;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";
          },
        }),
      ],
    });
Patch Changes
  • Fix issue with isbot v4 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 to v3
    • Templates are updated to use isbot@4 moving forward via create-remix
  • Vite: Fix HMR issues when altering exports for non-rendered routes (#​8157)

  • Vite: Default NODE_ENV to "production" when running remix vite:build command (#​8405)

  • Vite: Remove Vite plugin config option serverBuildPath in favor of separate serverBuildDirectory and serverBuildFile 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)

    • Previously, referencing a .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'
    • 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
    • Now, Remix explicitly fails at compile time when a .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 module
    • The error messages also include links to relevant documentation
  • Remove 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 calling ssrLoadModule in development.

    -import { unstable_viteServerBuildModuleId } from "@&#8203;remix-run/dev";
    
    // ...
    
    app.all(
      "*",
      createRequestHandler({
        build: vite
    -      ? () => vite.ssrLoadModule(unstable_viteServerBuildModuleId)
    +      ? () => vite.ssrLoadModule("virtual:remix/server-build")
          : await import("./build/server/index.js"),
      })
    );
  • Vite: Fix errors for non-existent index.html importer (#​8353)

  • Add vite:dev and vite: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 and build processes via the Remix CLI.

    {
      "scripts": {
    -    "dev": "vite dev",
    -    "build": "vite build && vite build --ssr"
    +    "dev": "remix vite:dev",
    +    "build": "remix vite:build"
      }
    }
  • 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 build
    since 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 checks
    or 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:

    • Leveraging a data source local to the browser (i.e., localStorage)
    • Managing a client-side cache of server data (like IndexedDB)
    • Bypassing the Remix server in a BFF setup and hitting your API directly from the browser
    • Migrating a React Router SPA to a Remix application

    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 your clientLoader.

    If your clientLoader needs to run on hydration and adds data you require to render the route component, you can export a HydrateFallback component that will render during SSR, and then your route component will not render until the clientLoader has executed on hydration.

    clientAction is simpler than clientLoader because it has no hydration use-cases. clientAction will only run on client-side navigations.

    For more information, please refer to the clientLoader and clientAction 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 Router 6.21.0 Release Notes and the useResolvedPath 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 than build, and the client is now compiled into build/client rather than public.

    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 and unstable_loadViteServerBuild which were only minimal wrappers around Vite's createServer and ssrLoadModule 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:

    -import {
    -  unstable_createViteServer,
    -  unstable_loadViteServerBuild,
    -} from "@&#8203;remix-run/dev";
    +import { unstable_viteServerBuildModuleId } from "@&#8203;remix-run/dev";

    Creating the Vite server in middleware mode:

    const vite =
      process.env.NODE_ENV === "production"
        ? undefined
    -    : await unstable_createViteServer();
    +    : await import("vite").then(({ createServer }) =>
    +        createServer({
    +          server: {
    +            middlewareMode: true,
    +          },
    +        })
    +      );

    Loading the Vite server build in the request handler:

    app.all(
      "*",
      createRequestHandler({
        build: vite
    -      ? () => unstable_loadViteServerBuild(vite)
    +      ? () => vite.ssrLoadModule(unstable_viteServerBuildModuleId)
          : await import("./build/server/index.js"),
      })
    );
  • 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 build
    since 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 checks
    to 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's optimizeDeps.include array (#​8177)

  • Improve Vite plugin performance (#​8121)

    • Parallelize detection of route module exports
    • Disable server.preTransformRequests in Vite child compiler since it's only used to process route modules
  • Remove 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.

    import { unstable_vitePlugin as remix } from "@&#8203;remix-run/dev";
    +import { installGlobals } from "@&#8203;remix-run/node";
    import { defineConfig } from "vite";
    
    +installGlobals();
    
    export default defineConfig({
      plugins: [remix()],
    });
  • 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
  • Support nonce prop on LiveReload component in Vite dev (#​8014)
  • Ensure code-split JS files in the server build's assets directory aren't cleaned up after Vite build (#​8042)
  • Fix redundant copying of assets from public directory in Vite build (#​8039)
    • This ensures that static assets aren't duplicated in the server build directory
    • This also fixes an issue where the build would break if assetsBuildDirectory was deeply nested within the public directory
  • Updated dependencies:
    • @remix-run/node@2.3.1
    • @remix-run/server-runtime@2.3.1

v2.3.0

Compare Source

Patch Changes
  • Support rendering of LiveReload component after Scripts in Vite dev (#​7919)
  • fix(vite): fix "react-refresh/babel" resolution for custom server with pnpm (#​7904)
  • Support JSX usage in .jsx files without manual React import in Vite (#​7888)
  • Support optional rendering of LiveReload component in Vite dev (#​7919)
  • Fix Vite production builds when plugins that have different local state between development and production modes are present, e.g. @mdx-js/rollup. (#​7911)
  • Cache resolution of Remix Vite plugin options (#​7908)
  • Support Vite 5 (#​7846)
  • Allow process.env.NODE_ENV values other than "development" in Vite dev (#​7980)
  • Attach CSS from shared chunks to routes in Vite build (#​7952)
  • fix(vite): Let Vite handle serving files outside of project root via /@&#8203;fs (#​7913)
    • This fixes errors when using default client entry or server entry in a pnpm project where those files may be outside of the project root, but within the workspace root.
    • By default, Vite prevents access to files outside the workspace root (when using workspaces) or outside of the project root (when not using workspaces) unless user explicitly opts into it via Vite's server.fs.allow.
  • Improve performance of LiveReload proxy in Vite dev (#​7883)
  • fix(vite): deduplicate @remix-run/react (#​7926)
    • Pre-bundle Remix dependencies to avoid Remix router duplicates.
    • Our remix-react-proxy plugin does not process default client and
    • server entry files since those come from within node_modules.
    • That means that before Vite pre-bundles dependencies (e.g. first time dev server is run) mismatching Remix routers cause Error: You must render this element inside a <Remix> element.
  • Fix React Fast Refresh error on load when using defer in Vite dev server (#​7842)
  • Handle multiple "Set-Cookie" headers in Vite dev server (#​7843)
  • Fix flash of unstyled content on initial page load in Vite dev when using a custom Express server (#​7937)
  • Emit assets that were only referenced in the server build into the client assets directory in Vite build (#​7892, cherry-picked in 8cd31d65)
  • Populate process.env from .env files on the server in Vite dev (#​7958)
  • Fix FutureConfig type (#​7895)
  • Updated dependencies:
    • @remix-run/server-runtime@2.3.0
    • @remix-run/node@2.3.0

v2.2.0

Compare Source

Minor Changes
  • Unstable Vite support for Node-based Remix apps (#​7590)
    • remix build 👉 vite build && vite build --ssr
    • remix dev 👉 vite dev
    • Other runtimes (e.g. Deno, Cloudflare) not yet supported.
    • See "Future > Vite" in the Remix Docs for details
  • Add a new 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 an idle state (RFC) (#​7704)
Patch Changes
  • Updated dependencies:
    • @remix-run/server-runtime@2.2.0
    • @remix-run/node@2.2.0

v2.1.0

Compare Source

Patch Changes
  • Sourcemap takes into account special chars in output file (#​7574)
  • Updated dependencies:
    • @remix-run/server-runtime@2.1.0

v2.0.1

Compare Source

Patch Changes
  • Fix types for MDX files when using pnpm (#​7491)
  • Update getDependenciesToBundle to handle ESM packages without main exports (#​7272)
    • Note that these packages must expose package.json in their exports field so that their path can be resolved
  • Fix server builds where serverBuildPath extension is .cjs (#​7180)
  • Updated dependencies:
    • @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 optional remix.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)

    • The code for create-remix has been moved out of the Remix CLI since it's not intended for use within an existing Remix application
    • This means that the remix create command is no longer available.
  • Enable built-in PostCSS and Tailwind support by default. (#​6909)

    • These tools are now automatically used within the Remix compiler if PostCSS and/or Tailwind configuration files are present in your project.
    • If you have a custom PostCSS and/or Tailwind setup outside of Remix, you can disable these features in your remix.config.js via the postcss:false and/or tailwind:false flags
  • Drop React 17 support (#​7121)

  • Require Node >=18.0.0 (#​6939)

  • Compile server build to Node 18 (#​7292)

    • This allows features like top-level await to be used within a Remix app
  • Remove default Node.js polyfills - you must now opt-into polyfills via the serverNodeBuiltinsPolyfill and browserNodeBuiltinsPolyfill configs (#​7269)

  • Remove v2_errorBoundary flag and CatchBoundary implementation (#​6906)

  • Remove v2_normalizeFormMethod future flag - all formMethod 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 deepest headers function in the route tree (#​6979)

  • The route meta API now defaults to the new "V2 Meta" API (#​6958)

  • Default to serverModuleFormat: "esm" and update remix-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 - use REMIX_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 - use remix dev's '--port / port option instead (#​6965)

  • Stop passing isTypeScript to remix.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 - use REMIX_DEV_ORIGIN instead (#​6962)

  • Promote the future.v2_dev flag in remix.config.js to a root level dev config (#​7002)

  • Remove browserBuildDirectory config option (#​6900)

  • Remove serverBuildDirectory config option ([#​6897](https://github.com/remix-run/remix/pull/- Remove codemod command (#​6918)
    6897))

  • Removed support for "magic exports" from the remix package. This package can be removed from your package.json and you should update all imports to use the source @remix-run/* packages: (#​6895)

    - import type { ActionArgs } from "remix";
    - import { json, useLoaderData } from "remix";
    + import type { ActionArgs } from "@&#8203;remix-run/node";
    + import { json } from "@&#8203;remix-run/node";
    + import { useLoaderData } from "@&#8203;remix-run/react";
Minor Changes
  • Warn users about obsolete future flags in remix.config.js (#​7048)

  • Detect built mode via build.mode (#​6964)

    • Prevents mode mismatch between built Remix server entry and user-land server
    • Additionally, all runtimes (including non-Node runtimes) can use build.mode to determine if HMR should be performed
  • Support bun package manager (#​7074)

  • The serverNodeBuiltinsPolyfill option (along with the newly added browserNodeBuiltinsPolyfill) now supports defining global polyfills in addition to module polyfills (#​7269)

    • For example, to polyfill Node's Buffer global:

      module.exports = {
        serverNodeBuiltinsPolyfill: {
          globals: {
            Buffer: true,
          },
          // You'll probably need to polyfill the "buffer" module
          // too since the global polyfill imports this:
          modules: {
            buffer: true,
          },
        },
      };
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)

    • The contents of the @remix-run/css-bundle package are now entirely managed by the Remix compiler
    • 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
  • Allow non-development modes for remix watch (#​7117)

  • Stop remix dev when esbuild 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 files
      can contain single-argument type generics without needing a comma to disambiguate from JSX:

      // this works in .ts files
      const id = <T>(x: T) => x;
      //          ^ single-argument type generic
      // this doesn't work in .tsx files
      const id = <T,>(x: T) => x;
      //          ^ is this a JSX element? or a single-argument type generic?
      // this works in .tsx files
      const id = <T,>(x: T) => x;
      //           ^ comma: this is a generic, not a JSX element
      const component = <h1>hello</h1>;
      //                   ^ no comma: this is a JSX element
  • Enhance obsolete flag warning for future.v2_dev if it was an object, and prompt users to lift it to the root dev 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 with var Buffer = require('buffer/').Buffer as recommended in their README) (#​7198)

    • These imports were previously marked as external
    • 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)
  • Surface errors when PostCSS config is invalid (#​7391)

  • Restart dev server when Remix config changes (#​7269)

  • Remove outdated ESM import warnings (#​6916)

    • Most of the time these warnings were false positives.
    • Instead, we now rely on built-in Node warnings for ESM imports.
  • 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
  • Show deprecation warning when using devServerBroadcastDelay and devServerPort config options (#​7064)
  • Updated dependencies:
    • @remix-run/server-runtime@1.19.3

v1.19.2

Compare Source

Patch Changes
  • Update proxy-agent to resolve npm audit security vulnerability (#​7027)
  • Updated dependencies:
    • @remix-run/server-runtime@1.19.2

v1.19.1

Compare Source

Patch Changes
  • Add a heartbeat ping to prevent the WebSocket connection from being closed due to inactivity when using a proxy like Cloudflare (#​6904, #​6927)
  • Treeshake out HMR code from production builds (#​6894)
  • Updated dependencies:
    • @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 the REMIX_DEV_ORIGIN environment variable

  • Output 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. In remix.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)

    // Disable all polyfills
    exports.serverNodeBuiltinsPolyfill = { modules: {} };
    
    // Enable specific polyfills
    exports.serverNodeBuiltinsPolyfill = {
      modules: {
        crypto: true, // Provide a JSPM polyfill
        fs: "empty", // Provide an empty polyfill
      },
    };
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) if
    they want to clear.

  • Updated dependencies:

    • @remix-run/server-runtime@1.19.0

v1.18.1

Compare Source

Patch Changes
  • Ignore missing react-dom/client for React 17 (#​6725)
  • Updated dependencies:
    • @remix-run/server-runtime@1.18.1

v1.18.0

Compare Source

Minor Changes
  • stabilize v2 dev server (#​6615)
  • improved logging for remix build and remix dev (#​6596)
Patch Changes
  • fix docs links for msw and mkcert (#​6672)
  • fix remix dev -c: kill all descendant processes of specified command when restarting (#​6663)
  • Add caching to regular stylesheet compilation (#​6638)
  • Rename Architect (AWS Lambda) -> Architect in the create-remix CLI to avoid confusion for other methods of deploying to AWS (i.e., SST) (#​6484)
  • Improve CSS bundle build performance by skipping unused Node polyfills (#​6639)
  • Improve performance of CSS bundle build by skipping compilation of Remix/React packages that are known not to contain CSS imports (#​6654)
  • Cache CSS side-effect imports transform when using HMR (#​6622)
  • Fix bug with pathless layout routes beneath nested path segments (#​6649)
  • Add caching to PostCSS for CSS Modules (#​6604)
  • Add caching to PostCSS for side-effect imports (#​6554)
  • cache getRouteModuleExports calls to significantly speed up build and HMR rebuild times (#​6629)
  • group rebuild logs with surrounding whitespace (#​6607)
  • instructions for integrating with msw (#​6669)
  • Update minimum version of esbuild-plugins-node-modules-polyfill to 1.0.16 to ensure that the plugin is cached (#​6652)
  • Updated dependencies:
    • @remix-run/server-runtime@1.18.0

v1.17.1

Compare Source

Patch Changes
  • Replace esbuild-plugin-polyfill-node with esbuild-plugins-node-modules-polyfill (#​6562)
  • Lazily generate CSS bundle when import of @remix-run/css-bundle is detected (#​6535)
  • Updated dependencies:
    • @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 Certificate

    If both TLS options are set, scheme defaults to https

v1.16.1

Compare Source

Patch Changes
  • Cross-module loader change detection for HDR (#​6299)
  • Normalize path for dev server PATH envvar so that it works cross-platform (e.g. Windows) (#​6310)
  • Fix CSS imports in JS files that use JSX (#​6309)
  • Kill app server when dev server exits (#​6395)
  • Wait until app server is killed before starting a new app server (#​6289)
  • Ensure CSS bundle changes result in a new manifest hash (#​6374)
  • Normalize file paths before testing if a changed file is a route entry (#​6293)
  • Fix race where app server responds with updated manifest version before dev server is listening for it (#​6294)
    • dev server now listens for updated versions before writing the server changes, guaranteeing that it is listening before the app server gets a chance to send its 'ready' message
  • Only process .css.ts/.css.js files with Vanilla Extract if @vanilla-extract/css is installed (#​6345)
  • Stop modifying a user's tsconfig.json when running using getConfig (remix dev, remix routes, remix build, etc) (#​6156)
  • Cancel previous build when rebuild is kicked off to prevent rebuilds from hanging (#​6295)
  • Update minimum version of Babel dependencies to avoid errors parsing decorators (#​6390)
  • Support asset imports when detecting loader changes for HDR (#​6396)
  • Updated dependencies:
    • @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 and future.unstable_cssSideEffectImports options in remix.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 in remix.config.js. As a result, the future.unstable_postcss option has also been deprecated. (#​5960)

    The postcss option is false by default, but when set to true will enable processing of all CSS files using PostCSS if postcss.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:

    .
    ├── app
    │   └── styles (processed files)
    │       ├── app.css
    │       └── routes
    │           └── index.css
    └── styles (source files)
        ├── app.css
        └── routes
            └── index.css
    

    After you've enabled the new postcss option, you can delete the processed files from app/styles folder and move your source files from styles to app/styles:

    .
    ├── app
    │   └── styles (source files)
    │       ├── app.css
    │       └── routes
    │           └── index.css
    

    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 of postcss since Remix handles this automatically. For example, if you had followed the original setup guide:

    {
      "scripts": {
    -    "dev:css": "postcss styles --base styles --dir app/styles -w",
    -    "build:css": "postcss styles --base styles --dir app/styles --env production",
    -    "dev": "concurrently \"npm run dev:css\" \"remix dev\""
    +    "dev": "remix dev"
      }
    }
  • Stabilize built-in Tailwind support via the new tailwind option in remix.config.js. As a result, the future.unstable_tailwind option has also been deprecated. (#​5960)

    The tailwind option is false by default, but when set to true will enable built-in support for Tailwind functions and directives in your CSS files if tailwindcss 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 to app/tailwind.css.

    rm app/tailwind.css
    mv styles/tailwind.css app/tailwind.css

    Otherwise, if you don't already have an app/tailwind.css file, you should create one with the following contents:

    @&#8203;tailwind base;
    @&#8203;tailwind components;
    @&#8203;tailwind utilities;

    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 of tailwindcss since Remix handles this automatically. For example, if you had followed the original setup guide:

    {
      // ...
      "scripts": {
    -    "build": "run-s \"build:*\"",
    +    "build": "remix build",
    -    "build:css": "npm run generate:css -- --minify",
    -    "build:remix": "remix build",
    -    "dev": "run-p \"dev:*\"",
    +    "dev": "remix dev",
    -    "dev:css": "npm run generate:css -- --watch",
    -    "dev:remix": "remix dev",
    -    "generate:css": "npx tailwindcss -o ./app/tailwind.css",
        "start": "remix-serve build"
      }
      // ...
    }
  • 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:

    remix dev # uses `remix-serve <serve build path>` as the app server
    remix dev -c "node ./server.js" # uses your custom app server at `./server.js`

    The dev server will:

    • force NODE_ENV=development and warn you if it was previously set to something else
    • rebuild your app whenever your Remix app code changes
    • restart your app server whenever rebuilds succeed
    • handle live reload and HMR + Hot Data Revalidation
App 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 or logDevReady 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:

// server.js
// <other imports>
import { broadcastDevReady } from "@&#8203;remix-run/node";

// Path to Remix's server build directory ('build/' by default)
const BUILD_DIR = path.join(process.cwd(), "build");

// <code setting up your express server>

app.listen(3000, () => {
  const build = require(BUILD_DIR);
  console.log("Ready: http://localhost:" + port);

  // in development, call `broadcastDevReady` _after_ your server is up and running
  if (process.env.NODE_ENV === "development") {
    broadcastDevReady(build);
  }
});
Options

Options priority order is: 1. flags, 2. config, 3. defaults.

Option flag config default
Command -c / --command command remix-serve <server build path>
HTTP(S) scheme --http-scheme httpScheme http
HTTP(S) host --http-host httpHost localhost
HTTP(S) port --http-port httpPort Dynamically chosen open port
Websocket port --websocket-port websocketPort Dynamically chosen open port
No restart --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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code js major labels Jan 28, 2024
@renovate renovate bot enabled auto-merge (squash) January 28, 2024 09:43
Copy link

vercel bot commented Jan 28, 2024

Deployment failed with the following error:

Resource is limited - try again in 5 hours (more than 100, code: "api-deployments-free-per-day").

@renovate renovate bot force-pushed the renovate/major-remix-monorepo branch 3 times, most recently from 3fd64b1 to 33ac0cc Compare January 28, 2024 09:55
@renovate renovate bot force-pushed the renovate/major-remix-monorepo branch from 33ac0cc to 6f4c7ad Compare January 28, 2024 09:59
Copy link

sonarcloud bot commented Jan 28, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@chrillep chrillep merged commit a878aa1 into main Jan 28, 2024
4 of 8 checks passed
@chrillep chrillep deleted the renovate/major-remix-monorepo branch January 28, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code js major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant