swc-project / swc-loader

Moved to https://github.com/swc-project/pkgs
MIT License
394 stars 29 forks source link

0.1.16 breaks Webpack 4 #44

Closed yazeedbz closed 2 years ago

yazeedbz commented 2 years ago

Hello,

I believe because of the new way 0.1.16 accesses the options object, apps using Webpack 4 will break.

My app uses Webpack 4 and until I pinned swc-loader to 0.1.15, the build task kept returning this.getOptions is not a function. So swc-loader is receiving the Webpack object just fine, but the jump from 4 to 5 broke this operation.

Is re-adding loader-utils a dealer-breaker? This is my first time getting involved in this repo, so I'm not sure what the tradeoffs are.

minsoku commented 2 years ago

Hello ,

I had same problem and solve problem

And solved the problem

It's fixed version swc-loader in package.json

"swc-loader": "^0.1.15" => "swc-loader": "0.1.15"

I'm in same enviroment webpack 4

yazeedbz commented 2 years ago

@minsoku Yep thanks, that's how I fixed it as well!

However I'm wondering if Webpack 4 users will forever be stuck on 0.1.15, because of this change in implementation details.

kdy1 commented 2 years ago

I set latest to 0.1.15 and published 0.2.0 instead

minsoku commented 2 years ago

I set latest to 0.1.15 and published 0.2.0 instead

감사합니다 ~~

yazeedbz commented 2 years ago

I set latest to 0.1.15 and published 0.2.0 instead

Sorry but how does this solve the problem? 0.1.x --> 0.2.x is a minor bump, which shouldn't contain breaking changes.

kdy1 commented 2 years ago

@yazeedbz No It's not a minor bump

kdy1 commented 2 years ago

Read semver docs

yazeedbz commented 2 years ago

@kdy1 From the semver docs, it seems changes that break users' apps is a major change (1.x.x --> 2.x.x)

semver
kdy1 commented 2 years ago

It's bit different for 0.x Read it fully

2022년 4월 14일 (목) 오전 1:40, yazeedbz @.***>님이 작성:

@kdy1 https://github.com/kdy1 From the semver docs https://semver.org/, it seems changes that break users' apps is a major change (1.x.x --> 2.x.x)

[image: semver] https://user-images.githubusercontent.com/95372772/163228595-9b59f16d-6c68-41bb-a320-19d23457f12f.png

  • Patch version Z (x.y.Z | x > 0) MUST be incremented if only backwards compatible bug fixes are introduced. A bug fix is defined as an internal change that fixes incorrect behavior. https://semver.org/#spec-item-6
  • Minor version Y (x.Y.z | x > 0) MUST be incremented if new, backwards compatible functionality is introduced to the public API. https://semver.org/#spec-item-7

— Reply to this email directly, view it on GitHub https://github.com/swc-project/swc-loader/issues/44#issuecomment-1098264923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHELSJ4N3YEZ7BHC5GBNTQ3VE32JNANCNFSM5TH7ZEKQ . You are receiving this because you were mentioned.Message ID: @.***>

yazeedbz commented 2 years ago

@kdy1 Oh man you're right...I'm sorry about that 😓

Thanks for patiently clarifying!