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

fix: builtin swc loader input sourcemap #5492

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

2239559319
Copy link
Contributor

Summary

fix #5480

std::mem::take will be replaced with the default value. Therefore, subsequent loaders cannot obtain the correct value.

Test Plan

Require Documentation?

  • No
  • Yes, the corresponding rspack-website PR is __

@CLAassistant
Copy link

CLAassistant commented Jan 27, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Jan 27, 2024
@ahabhgk ahabhgk requested a review from h-a-n-a March 18, 2024 09:29
@ahabhgk
Copy link
Collaborator

ahabhgk commented Mar 18, 2024

Could you add a test?

@2239559319 2239559319 force-pushed the fix-input-sourcemap-clear branch 2 times, most recently from 2f15a86 to d0ea54c Compare March 18, 2024 14:36
@2239559319
Copy link
Contributor Author

Could you add a test?

test has been added and passed in my repository see https://github.com/2239559319/rspack/pull/3 but failed in this repository.

@hardfist
Copy link
Contributor

!bench

@rspack-bot
Copy link

rspack-bot commented Mar 19, 2024

📝 Benchmark detail: Open

Name Base (2024-03-19 873cfad) Current Change
10000_development-mode + exec 1.94 s ± 28 ms 1.94 s ± 30 ms +0.20 %
10000_development-mode_hmr + exec 742 ms ± 15 ms 742 ms ± 10 ms -0.12 %
10000_production-mode + exec 2.81 s ± 21 ms 2.83 s ± 62 ms +0.88 %
arco-pro_development-mode + exec 2.46 s ± 33 ms 2.47 s ± 20 ms +0.46 %
arco-pro_development-mode_hmr + exec 514 ms ± 2.3 ms 514 ms ± 5.6 ms +0.02 %
arco-pro_development-mode_hmr_intercept-plugin + exec 527 ms ± 7.1 ms 528 ms ± 4.1 ms +0.16 %
arco-pro_development-mode_intercept-plugin + exec 3.31 s ± 40 ms 3.32 s ± 27 ms +0.30 %
arco-pro_production-mode + exec 4.11 s ± 34 ms 4.09 s ± 35 ms -0.45 %
arco-pro_production-mode_intercept-plugin + exec 4.94 s ± 39 ms 4.93 s ± 43 ms -0.15 %
threejs_development-mode_10x + exec 1.89 s ± 33 ms 1.91 s ± 33 ms +0.75 %
threejs_development-mode_10x_hmr + exec 737 ms ± 4.5 ms 733 ms ± 6 ms -0.50 %
threejs_production-mode_10x + exec 5.78 s ± 153 ms 5.76 s ± 130 ms -0.40 %

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit cc0a9b4
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6618c7ef6917240008dcb6b7

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for rspack-back failed. Why did it fail? →

Name Link
🔨 Latest commit 433818c
🔍 Latest deploy log https://app.netlify.com/sites/rspack-back/deploys/65fc3becaa042600081d2f12

@sgarfinkel
Copy link

@ahabhgk Can we get a review on this please?

Copy link
Collaborator

@ahabhgk ahabhgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for delay, this is a good catch, thank you!

@ahabhgk ahabhgk enabled auto-merge (squash) April 12, 2024 05:37
@ahabhgk ahabhgk merged commit ab3f38e into web-infra-dev:main Apr 12, 2024
28 checks passed
@littleprincewdk
Copy link

littleprincewdk commented May 10, 2024

@hardfist Is this released?the latest version(0.6.5) is still not effective

compile this file,sources should be .ts(webpack swc-loader is ok),but builtin:swc-loader will get .js,prove that it does not take effect

"use strict";

function message() {
  console.log('inline-source-map');
}

message();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlubGluZS1zb3VyY2UtbWFwLnRzIl0sIm5hbWVzIjpbIm1lc3NhZ2UiLCJjb25zb2xlIiwibG9nIl0sIm1hcHBpbmdzIjoiOztBQUFBLFNBQVNBLE9BQVQsR0FBbUI7QUFDakJDLEVBQUFBLE9BQU8sQ0FBQ0MsR0FBUixDQUFZLG1CQUFaO0FBQ0Q7O0FBRURGLE9BQU8iLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBtZXNzYWdlKCkge1xuICBjb25zb2xlLmxvZygnaW5saW5lLXNvdXJjZS1tYXAnKTtcbn1cblxubWVzc2FnZSgpO1xuIl19

repo: https://github.com/littleprincewdk/rspack-inputSourceMap-bug-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

builtin:swc-loader breaks source-map-loader
9 participants