Skip to content

Commit

Permalink
sku v13: remove persistentCache config option (#1013)
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Skoufis <askoufis@users.noreply.github.com>
  • Loading branch information
felixhabib and askoufis authored Jul 10, 2024
1 parent a557612 commit 0bc92a7
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 37 deletions.
26 changes: 26 additions & 0 deletions .changeset/stupid-seals-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'sku': major
---

Remove support for `persistentCache` configuration option

**BREAKING CHANGE:**

Disabling `persistentCache` was previously necessary when using [treat], which is no longer supported in `sku`. `persistentCache` is now always enabled and has been removed from the configuration options.

[treat]: https://seek-oss.github.io/treat/

**MIGRATION GUIDE:**

Remove the `persistentCache` option from your sku config.

```diff
// sku.config.ts

import { type SkuConfig } from 'sku';

export default {
- persistentCache: false,
- persistentCache: true,
} satisfies SkuConfig;
```
8 changes: 0 additions & 8 deletions docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,6 @@ The file name of the library. The main bundle of the library will be output to `

If `libraryFile` is not specified then `libraryName` will be used instead.

## persistentCache

type `boolean`

Default: `true`

Disables the use of webpack filesystem caching for `sku start` and `sku start-ssr`.

## polyfills

type `Array<string>`
Expand Down
2 changes: 0 additions & 2 deletions docs/docs/extra-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ export default {
This cache stores generated webpack modules and chunks.
It is only emitted during local development.
Its purpose is to reduce the time it takes to start the local development server.
`sku` enables this cache by default, but it can be disabled via the [`persistentCache` configuration].

> This cache is stored in `node_modules/.cache/webpack` and can be safely deleted at any time.
[webpack filesystem cache]: https://webpack.js.org/configuration/cache/#cachetype
[`persistentCache` configuration]: ./docs/configuration#persistentcache

### [`babel-loader` cache]

Expand Down
1 change: 0 additions & 1 deletion fixtures/braid-design-system/sku.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ module.exports = {
],
publicPath: '/',
port: 8200,
persistentCache: false,
dangerouslySetWebpackConfig: (config) => {
if (config.name === 'render') {
config.plugins.push(new ListExternalsWebpackPlugin());
Expand Down
1 change: 0 additions & 1 deletion fixtures/library-build/sku.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ module.exports = {
renderEntry: 'src/render.js',
libraryName: 'MyLibrary',
port: 8085,
persistentCache: false,
dangerouslySetWebpackConfig: (config) => makeStableHashes(config),
};
1 change: 0 additions & 1 deletion fixtures/library-file/sku.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ module.exports = {
libraryName: 'MyLibrary',
libraryFile: 'my-library',
port: 8086,
persistentCache: false,
dangerouslySetWebpackConfig: (config) => makeStableHashes(config),
};
16 changes: 5 additions & 11 deletions packages/sku/config/webpack/cache.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
const { persistentCache, paths } = require('../../context');
const { paths } = require('../../context');
const isCI = require('../../lib/isCI');

const disableCacheOverride = Boolean(process.env.SKU_DISABLE_CACHE);

module.exports = function getWebpackCacheSettings({ isDevServer }) {
if (isDevServer && !isCI && !disableCacheOverride) {
if (persistentCache) {
return {
type: 'filesystem',
buildDependencies: {
config: paths.appSkuConfigPath ? [paths.appSkuConfigPath] : [],
},
};
}

return {
type: 'memory',
type: 'filesystem',
buildDependencies: {
config: paths.appSkuConfigPath ? [paths.appSkuConfigPath] : [],
},
};
}

Expand Down
3 changes: 0 additions & 3 deletions packages/sku/context/configSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,6 @@ module.exports = validator.compile({
type: 'array',
items: { type: 'string' },
},
persistentCache: {
type: 'boolean',
},
externalizeNodeModules: {
type: 'boolean',
},
Expand Down
1 change: 0 additions & 1 deletion packages/sku/context/defaultSkuConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ module.exports = {
rootResolution: !isCompilePackage,
languages: null,
skipPackageCompatibilityCompilation: [],
persistentCache: true,
externalizeNodeModules: false,
};
1 change: 0 additions & 1 deletion packages/sku/context/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,5 @@ module.exports = {
languages: normalizedLanguages,
skipPackageCompatibilityCompilation:
skuConfig.skipPackageCompatibilityCompilation,
persistentCache: skuConfig.persistentCache,
externalizeNodeModules: skuConfig.externalizeNodeModules,
};
8 changes: 0 additions & 8 deletions packages/sku/sku-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,6 @@ export interface SkuConfig {
*/
orderImports?: boolean;

/**
* Disables the use of webpack filesystem caching for `sku start` and `sku start-ssr`.
*
* @default true
* @link https://seek-oss.github.io/sku/#/./docs/configuration?id=persistentcache
*/
persistentCache?: boolean;

/**
* An array of polyfills to be included into all client entry points.
*
Expand Down

0 comments on commit 0bc92a7

Please sign in to comment.