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

feat: deprecate Compilation API #6505

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/node_binding/binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ export interface JsStatsChunkGroupAsset {

export interface JsStatsError {
message: string
formatted: string
moduleIdentifier?: string
moduleName?: string
moduleId?: string
Expand Down Expand Up @@ -573,7 +572,6 @@ export interface JsStatsOptimizationBailout {

export interface JsStatsWarning {
message: string
formatted: string
moduleIdentifier?: string
moduleName?: string
moduleId?: string
Expand Down
4 changes: 0 additions & 4 deletions crates/rspack_binding_values/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use super::{JsCompilation, ToJsCompatSource};
#[derive(Debug)]
pub struct JsStatsError {
pub message: String,
pub formatted: String,
pub module_identifier: Option<String>,
pub module_name: Option<String>,
pub module_id: Option<String>,
Expand All @@ -24,7 +23,6 @@ impl From<rspack_core::StatsError> for JsStatsError {
fn from(stats: rspack_core::StatsError) -> Self {
Self {
message: stats.message,
formatted: stats.formatted,
module_identifier: stats.module_identifier,
module_name: stats.module_name,
module_id: stats.module_id,
Expand All @@ -35,7 +33,6 @@ impl From<rspack_core::StatsError> for JsStatsError {
#[napi(object)]
pub struct JsStatsWarning {
pub message: String,
pub formatted: String,
pub module_identifier: Option<String>,
pub module_name: Option<String>,
pub module_id: Option<String>,
Expand All @@ -45,7 +42,6 @@ impl From<rspack_core::StatsWarning> for JsStatsWarning {
fn from(stats: rspack_core::StatsWarning) -> Self {
Self {
message: stats.message,
formatted: stats.formatted,
module_identifier: stats.module_identifier,
module_name: stats.module_name,
module_id: stats.module_id,
Expand Down
8 changes: 0 additions & 8 deletions crates/rspack_core/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,6 @@ impl Stats<'_> {
message: diagnostic_displayer
.emit_diagnostic(d)
.expect("should print diagnostics"),
formatted: diagnostic_displayer
.emit_diagnostic(d)
.expect("should print diagnostics"),
module_identifier: module_identifier.map(|i| i.to_string()),
module_name,
module_id: module_id.flatten(),
Expand Down Expand Up @@ -369,9 +366,6 @@ impl Stats<'_> {
message: diagnostic_displayer
.emit_diagnostic(d)
.expect("should print diagnostics"),
formatted: diagnostic_displayer
.emit_diagnostic(d)
.expect("should print diagnostics"),
module_identifier: module_identifier.map(|i| i.to_string()),
module_name,
module_id: module_id.flatten(),
Expand Down Expand Up @@ -703,7 +697,6 @@ fn get_stats_module_name_and_id(
#[derive(Debug)]
pub struct StatsError {
pub message: String,
pub formatted: String,
pub module_identifier: Option<String>,
pub module_name: Option<String>,
pub module_id: Option<String>,
Expand All @@ -712,7 +705,6 @@ pub struct StatsError {
#[derive(Debug)]
pub struct StatsWarning {
pub message: String,
pub formatted: String,
pub module_identifier: Option<String>,
pub module_name: Option<String>,
pub module_id: Option<String>,
Expand Down
1 change: 0 additions & 1 deletion packages/rspack-test-tools/tests/errorCases/error-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
expect(errors).toMatchInlineSnapshot(`
Array [
Object {
"formatted": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"index": 0,
"message": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"moduleId": "./resolve-fail-esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ module.exports = {
Object {
"errors": Array [
Object {
"formatted": " × test push\\n",
"message": " × test push\\n",
},
Object {
"formatted": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"message": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"moduleId": "./resolve-fail-esm/index.js",
"moduleIdentifier": "javascript/esm|<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
Object {
"errors": Array [
Object {
"formatted": " × test unshift\\n",
"message": " × test unshift\\n",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
Object {
"errors": Array [
Object {
"formatted": " × test splice\\n",
"message": " × test splice\\n",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ module.exports = {
Object {
"errors": Array [
Object {
"formatted": " × test splice\\n",
"message": " × test splice\\n",
},
Object {
"formatted": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"message": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"moduleId": "./resolve-fail-esm/index.js",
"moduleIdentifier": "javascript/esm|<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
Object {
"errors": Array [
Object {
"formatted": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"message": " × Resolve error: Can't resolve './answer' in '<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm'\\n ╭────\\n 1 │ import { answer } from './answer';\\n · ──────────\\n ╰────\\n help: Did you mean './answer.js'?\\n \\n The request './answer' failed to resolve only because it was resolved as fully specified,\\n probably because the origin is strict EcmaScript Module,\\n e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '\\"type\\": \\"module\\"'.\\n \\n The extension in the request is mandatory for it to be fully specified.\\n Add the extension to the request.\\n",
"moduleId": "./resolve-fail-esm/index.js",
"moduleIdentifier": "javascript/esm|<cwd>packages/rspack-test-tools/tests/fixtures/errors/resolve-fail-esm/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/rspack-test-tools/tests/errorCases/warning-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
expect(warnings).toMatchInlineSnapshot(`
Array [
Object {
"formatted": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n",
"index": 0,
"message": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n",
"moduleId": "./require.main.require.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"formatted": " ⚠ Error: test push\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-push.js:10:33\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
"message": " ⚠ Error: test push\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-push.js:10:33\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
},
Object {
"formatted": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n",
"message": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n",
"moduleId": "./require.main.require.js",
"moduleIdentifier": "<cwd>packages/rspack-test-tools/tests/fixtures/errors/require.main.require.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"formatted": " ⚠ Error: test unshift\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-shift.js:13:37\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
"message": " ⚠ Error: test unshift\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-shift.js:13:37\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"formatted": " ⚠ Error: test splice\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js:10:41\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
"message": " ⚠ Error: test splice\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-1.js:10:41\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ module.exports = {
"errors": Array [],
"warnings": Array [
Object {
"formatted": " ⚠ Error: test splice\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js:10:41\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
"message": " ⚠ Error: test splice\\n │ at <cwd>packages/rspack-test-tools/tests/errorCases/warning-test-splice-2.js:10:41\\n │ at Hook.eval [as callAsync] (eval at create (<cwd>node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)\\n │ at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (<cwd>node_modules/tapable/lib/Hook.js:18:14)\\n │ at <cwd>packages/rspack/dist/Compiler.js:466:41\\n │ at <cwd>packages/rspack/dist/Compiler.js:533:65\\n",
},
Object {
"formatted": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n",
"message": " ⚠ Module parse warning:\\n ╰─▶ ⚠ Module parse failed: require.main.require() is not supported by Rspack.\\n ╭────\\n 1 │ require.main.require('./file');\\n · ──────────────────────────────\\n ╰────\\n \\n",
"moduleId": "./require.main.require.js",
"moduleIdentifier": "<cwd>packages/rspack-test-tools/tests/fixtures/errors/require.main.require.js",
Expand Down
Loading
Loading