Skip to content

Enable persistent cache in Faster + Rspack #10823

Closed
@tats-u

Description

@tats-u

Have you read the Contributing Guidelines on issues?

Motivation

Rspack 1.2.0-alpha.0 used in Faster 3.7 now supports the experimental persistent cache.

https://github.com/web-infra-dev/rspack/releases/tag/v1.2.0-alpha.0
https://rspack.dev/config/experiments#persistent-cache

We need to modify the following parts:

     if (props.currentBundler.name === 'rspack') {
       // TODO Rspack only supports memory cache (as of Sept 2024)
       // TODO re-enable file persistent cache one Rspack supports it
       //  See also https://rspack.dev/config/cache#cache
-      return undefined;
+      return true;
     }

return {
// This is mostly useful in dev
// See https://rspack.dev/config/experiments#experimentsincremental
// Produces warnings in production builds
// See https://github.com/web-infra-dev/rspack/pull/8311#issuecomment-2476014664
// We use the same integration as Rspress, with ability to disable
// See https://github.com/web-infra-dev/rspress/pull/1631
// See https://github.com/facebook/docusaurus/issues/10646
// @ts-expect-error: Rspack-only, not available in Webpack typedefs
incremental: !isProd && !process.env.DISABLE_RSPACK_INCREMENTAL,
};

         // @ts-expect-error: Rspack-only, not available in Webpack typedefs
         incremental: !isProd && !process.env.DISABLE_RSPACK_INCREMENTAL,
+        cache: {
+          type: 'persistent',
+          // Some extra options
+       },
      };

Self-service

  • I'd be willing to do some initial work on this proposal myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue is a proposal, usually non-trivial change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions