Unverified Commit 0f781a6a authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

[Breaking] Bump sass-loader to v16 (#84387)

This PR bumps sass-loader to v16 as Sass is deprecating the legacy JS
API, and updating sass-loader ensures compatibility with future Sass
versions.

x-ref: https://github.com/vercel/next.js/discussions/67931

This removes the silencing of the deprecation warning added at
https://github.com/vercel/next.js/pull/72632.

Supersedes https://github.com/vercel/next.js/pull/83091

---------
Co-authored-by: 's avatarMaikel <maikel.van.dort@gmail.com>
parent 0a02fd82
...@@ -71,19 +71,10 @@ pub async fn get_sass_loader_rules( ...@@ -71,19 +71,10 @@ pub async fn get_sass_loader_rules(
} }
let sass_options = next_config.sass_config().await?; let sass_options = next_config.sass_config().await?;
let Some(mut sass_options) = sass_options.as_object().cloned() else { let Some(sass_options) = sass_options.as_object() else {
bail!("sass_options must be an object"); bail!("sass_options must be an object");
}; };
// TODO: Remove this once we upgrade to sass-loader 16
let silence_deprecations = if let Some(v) = sass_options.get("silenceDeprecations") {
v.clone()
} else {
serde_json::json!(["legacy-js-api"])
};
sass_options.insert("silenceDeprecations".into(), silence_deprecations);
// additionalData is a loader option but Next.js has it under `sassOptions` in // additionalData is a loader option but Next.js has it under `sassOptions` in
// `next.config.js` // `next.config.js`
let additional_data = sass_options let additional_data = sass_options
......
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
"recast": "0.23.11", "recast": "0.23.11",
"regenerator-runtime": "0.13.4", "regenerator-runtime": "0.13.4",
"safe-stable-stringify": "2.5.0", "safe-stable-stringify": "2.5.0",
"sass-loader": "15.0.0", "sass-loader": "16.0.5",
"schema-utils2": "npm:schema-utils@2.7.1", "schema-utils2": "npm:schema-utils@2.7.1",
"schema-utils3": "npm:schema-utils@3.0.0", "schema-utils3": "npm:schema-utils@3.0.0",
"semver": "7.3.2", "semver": "7.3.2",
......
...@@ -174,19 +174,7 @@ export const css = curry(async function css( ...@@ -174,19 +174,7 @@ export const css = curry(async function css(
// Source maps are required so that `resolve-url-loader` can locate // Source maps are required so that `resolve-url-loader` can locate
// files original to their source directory. // files original to their source directory.
sourceMap: true, sourceMap: true,
sassOptions: { sassOptions,
// The "fibers" option is not needed for Node.js 16+, but it's causing
// problems for Node.js <= 14 users as you'll have to manually install
// the `fibers` package:
// https://github.com/webpack-contrib/sass-loader#:~:text=We%20automatically%20inject%20the%20fibers%20package
// https://github.com/vercel/next.js/issues/45052
// Since it's optional and not required, we'll disable it by default
// to avoid the confusion.
fibers: false,
// TODO: Remove this once we upgrade to sass-loader 16
silenceDeprecations: ['legacy-js-api'],
...sassOptions,
},
additionalData: sassPrependData || sassAdditionalData, additionalData: sassPrependData || sassAdditionalData,
}, },
}, },
......
...@@ -1857,7 +1857,7 @@ export async function ncc_sass_loader(task, opts) { ...@@ -1857,7 +1857,7 @@ export async function ncc_sass_loader(task, opts) {
await fs.writeFile( await fs.writeFile(
utilsPath, utilsPath,
originalContent.replace( originalContent.replace(
/require\.resolve\(["'](sass|node-sass)["']\)/g, /require\.resolve\(["'](sass|node-sass|sass-embedded)["']\)/g,
'eval("require").resolve("$1")' 'eval("require").resolve("$1")'
) )
) )
......
...@@ -657,7 +657,7 @@ importers: ...@@ -657,7 +657,7 @@ importers:
version: 9.12.0(jiti@2.5.1) version: 9.12.0(jiti@2.5.1)
eslint-config-next: eslint-config-next:
specifier: canary specifier: canary
version: 15.6.0-canary.32(eslint-plugin-import-x@4.3.1(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2) version: 15.6.0-canary.36(eslint-plugin-import-x@4.3.1(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2)
tailwindcss: tailwindcss:
specifier: 4.1.13 specifier: 4.1.13
version: 4.1.13 version: 4.1.13
...@@ -1535,8 +1535,8 @@ importers: ...@@ -1535,8 +1535,8 @@ importers:
specifier: 2.5.0 specifier: 2.5.0
version: 2.5.0 version: 2.5.0
sass-loader: sass-loader:
specifier: 15.0.0 specifier: 16.0.5
version: 15.0.0(@rspack/core@1.5.0(@swc/helpers@0.5.15))(sass@1.77.8)(webpack@5.98.0(@swc/core@1.11.24(@swc/helpers@0.5.15))(esbuild@0.25.9)) version: 16.0.5(@rspack/core@1.5.0(@swc/helpers@0.5.15))(sass@1.77.8)(webpack@5.98.0(@swc/core@1.11.24(@swc/helpers@0.5.15))(esbuild@0.25.9))
schema-utils2: schema-utils2:
specifier: npm:schema-utils@2.7.1 specifier: npm:schema-utils@2.7.1
version: schema-utils@2.7.1 version: schema-utils@2.7.1
...@@ -4363,8 +4363,8 @@ packages: ...@@ -4363,8 +4363,8 @@ packages:
'@next/env@15.5.3': '@next/env@15.5.3':
resolution: {integrity: sha512-RSEDTRqyihYXygx/OJXwvVupfr9m04+0vH8vyy0HfZ7keRto6VX9BbEk0J2PUk0VGy6YhklJUSrgForov5F9pw==} resolution: {integrity: sha512-RSEDTRqyihYXygx/OJXwvVupfr9m04+0vH8vyy0HfZ7keRto6VX9BbEk0J2PUk0VGy6YhklJUSrgForov5F9pw==}
'@next/eslint-plugin-next@15.6.0-canary.32': '@next/eslint-plugin-next@15.6.0-canary.36':
resolution: {integrity: sha512-CCjoXb3dNT1Pq+GkcQOGncBlm6HCorbqiJ4nuhF/wKo505FXIf8vnpaUId54iN/WqwaC1Zf5wBk1shSXMuMKHA==} resolution: {integrity: sha512-RznXP7eSDugL3fVYdwIyCXi4I5A2EQ4YBg0tANoPGfo1Eyn1KOTGfzBB8MLogN7TjBbUusw+gzpQ/mBvFc4RhA==}
'@next/swc-darwin-arm64@15.5.3': '@next/swc-darwin-arm64@15.5.3':
resolution: {integrity: sha512-nzbHQo69+au9wJkGKTU9lP7PXv0d1J5ljFpvb+LnEomLtSbJkbZyEs6sbF3plQmiOB2l9OBtN2tNSvCH1nQ9Jg==} resolution: {integrity: sha512-nzbHQo69+au9wJkGKTU9lP7PXv0d1J5ljFpvb+LnEomLtSbJkbZyEs6sbF3plQmiOB2l9OBtN2tNSvCH1nQ9Jg==}
...@@ -9174,8 +9174,8 @@ packages: ...@@ -9174,8 +9174,8 @@ packages:
engines: {node: '>=6.0'} engines: {node: '>=6.0'}
hasBin: true hasBin: true
eslint-config-next@15.6.0-canary.32: eslint-config-next@15.6.0-canary.36:
resolution: {integrity: sha512-rDKclf6wFaplSqVr4uI223lKLBioD+1zrYM66sIMezN4BbiMbUSwJyvGabMYOO1X600svIddP8ODnC1nxhHgqg==} resolution: {integrity: sha512-v7uPmVVRtO3RFjaFsXoXdI60TWzPIZXAWO3HifrEC/y4Pr4y16LeWH45uxSc9H78V6D3iTOisSZeBdVr87MwoQ==}
peerDependencies: peerDependencies:
eslint: ^7.23.0 || ^8.0.0 || ^9.0.0 eslint: ^7.23.0 || ^8.0.0 || ^9.0.0
typescript: '>=3.3.1' typescript: '>=3.3.1'
...@@ -15605,8 +15605,8 @@ packages: ...@@ -15605,8 +15605,8 @@ packages:
safer-buffer@2.1.2: safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
sass-loader@15.0.0: sass-loader@16.0.5:
resolution: {integrity: sha512-mbXAL7sI/fgt3skXR6xHxtKkaGyxRrGf7zrU4hLLWxBDJEcAe0QsoNy92qKttCb3zfMniTkU2kD9yakUKtW7vQ==} resolution: {integrity: sha512-oL+CMBXrj6BZ/zOq4os+UECPL+bWqt6OAC6DWS8Ln8GZRcMDjlJ4JC3FBDuHJdYaFWIdKNIBYmtZtK2MaMkNIw==}
engines: {node: '>= 18.12.0'} engines: {node: '>= 18.12.0'}
peerDependencies: peerDependencies:
'@rspack/core': 0.x || 1.x '@rspack/core': 0.x || 1.x
...@@ -16367,7 +16367,7 @@ packages: ...@@ -16367,7 +16367,7 @@ packages:
superagent@3.8.3: superagent@3.8.3:
resolution: {integrity: sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==} resolution: {integrity: sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==}
engines: {node: '>= 4.0'} engines: {node: '>= 4.0'}
deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
superstruct@1.0.3: superstruct@1.0.3:
resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==} resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==}
...@@ -21087,7 +21087,7 @@ snapshots: ...@@ -21087,7 +21087,7 @@ snapshots:
'@next/env@15.5.3': {} '@next/env@15.5.3': {}
'@next/eslint-plugin-next@15.6.0-canary.32': '@next/eslint-plugin-next@15.6.0-canary.36':
dependencies: dependencies:
fast-glob: 3.3.1 fast-glob: 3.3.1
...@@ -26748,9 +26748,9 @@ snapshots: ...@@ -26748,9 +26748,9 @@ snapshots:
optionalDependencies: optionalDependencies:
source-map: 0.6.1 source-map: 0.6.1
eslint-config-next@15.6.0-canary.32(eslint-plugin-import-x@4.3.1(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2): eslint-config-next@15.6.0-canary.36(eslint-plugin-import-x@4.3.1(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2):
dependencies: dependencies:
'@next/eslint-plugin-next': 15.6.0-canary.32 '@next/eslint-plugin-next': 15.6.0-canary.36
'@rushstack/eslint-patch': 1.10.4 '@rushstack/eslint-patch': 1.10.4
'@typescript-eslint/eslint-plugin': 8.36.0(@typescript-eslint/parser@8.36.0(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2) '@typescript-eslint/eslint-plugin': 8.36.0(@typescript-eslint/parser@8.36.0(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2)
'@typescript-eslint/parser': 8.36.0(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2) '@typescript-eslint/parser': 8.36.0(eslint@9.12.0(jiti@2.5.1))(typescript@5.9.2)
...@@ -35320,7 +35320,7 @@ snapshots: ...@@ -35320,7 +35320,7 @@ snapshots:
safer-buffer@2.1.2: {} safer-buffer@2.1.2: {}
sass-loader@15.0.0(@rspack/core@1.5.0(@swc/helpers@0.5.15))(sass@1.77.8)(webpack@5.98.0(@swc/core@1.11.24(@swc/helpers@0.5.15))(esbuild@0.25.9)): sass-loader@16.0.5(@rspack/core@1.5.0(@swc/helpers@0.5.15))(sass@1.77.8)(webpack@5.98.0(@swc/core@1.11.24(@swc/helpers@0.5.15))(esbuild@0.25.9)):
dependencies: dependencies:
neo-async: 2.6.2 neo-async: 2.6.2
optionalDependencies: optionalDependencies:
...@@ -3,7 +3,7 @@ import { nextTestSetup } from 'e2e-utils' ...@@ -3,7 +3,7 @@ import { nextTestSetup } from 'e2e-utils'
import { colorToRgb } from 'next-test-utils' import { colorToRgb } from 'next-test-utils'
const sassOptions = { const sassOptions = {
includePaths: ['./styles'], loadPaths: ['./styles'],
} }
describe.each([ describe.each([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment