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

chore: update to swc v1.3.36 #169

Merged
merged 2 commits into from
Feb 22, 2023
Merged

Conversation

titanous
Copy link
Contributor

The --config flag was renamed to --config-json, so plugin support will only work with versions >= 1.3.36 going forward.

@realtimetodie It looks like module path handling may have been broken by swc-project/swc#6930, do you understand what is going on here?

Executing tests from //examples/paths:test_test
-----------------------------------------------------------------------------
5c5
< const _moduleA = require("../../../../../home/codespace/.cache/bazel/_bazel_codespace/8740319a112a77c7681d8f1244e5cd69/sandbox/linux-sandbox/11/execroot/aspect_rules_swc/examples/paths/src/modules/moduleA");
---
> const _moduleA = require("./modules/moduleA");
FAIL: files "examples/paths/src/index.js" and "examples/paths/expected.js" differ. 

@//examples/paths:expected.js is out of date. To update this file, run:

    bazel run //examples/paths:test

@realtimetodie
Copy link
Contributor

As far as I remember, I was able to run the tests after I changed the baseUrl property in the .swcrc configuration file

"baseUrl": "examples/paths",

I think this needs to be set to .. Please try this out and let me know if this helps.

@titanous
Copy link
Contributor Author

Unfortunately that didn't work.

@realtimetodie
Copy link
Contributor

{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "target": "es2021",
    "baseUrl": "./src",
    "paths": {
      "@modules/*": ["./modules/*"]
    }
  },
  "module": {
    "type": "commonjs"
  },
  "sourceMaps": true
}

And then you need to fix the test, the module resolution was changed

$ bazel run //examples/paths:test

@titanous
Copy link
Contributor Author

Thanks, @realtimetodie, that worked!

@gregmagolan @alexeagle This is ready for review.

@gregmagolan
Copy link
Member

//examples/paths:check_paths is still failing?

@alexeagle
Copy link
Member

The change to the examples/paths/.swcrc also needs to be applied in examples/paths/tsconfig.json since we have an assertion that they have the same semantics. Fortunately TypeScript is okay with the change to the baseUrl.
I pushed a commit.

@alexeagle alexeagle merged commit dec45d2 into aspect-build:main Feb 22, 2023
@titanous titanous deleted the bump-swc branch February 22, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants