Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Switch to SWC #442

Draft
wants to merge 4 commits into
base: 5.x-RC
Choose a base branch
from
Draft

Switch to SWC #442

wants to merge 4 commits into from

Conversation

kmonahan
Copy link
Contributor

@kmonahan kmonahan commented Apr 1, 2024

No description provided.

@kmonahan kmonahan requested a review from coreylafferty April 1, 2024 14:58
@timnolte
Copy link
Contributor

timnolte commented Apr 1, 2024

Is it appropriate to do this without @wordpress/scripts making that change also?

@timnolte timnolte requested a review from tropicandid April 1, 2024 15:42
@tropicandid
Copy link
Contributor

Could we also get a description for what this change fixes/improves? I'm not super familiar with SWC.

@kmonahan
Copy link
Contributor Author

kmonahan commented Apr 1, 2024

SWC is a Babel replacement -- same thing, just does it with Rust. Gesso Drupal/GUSWDS and Gesso for React have switched, so this PR brings that same change to Gesso WP. Since Gesso WP doesn't use @wordpress/scripts (or at least, I don't see that in the package dependencies here), I don't think that has an impact here, but really for the Gesso WP Working Group to decide.

@timnolte
Copy link
Contributor

timnolte commented Apr 1, 2024

So, actually, I think that moving to @wordpress/scripts should actually be on the list of things to do and clean up all of the individual @wordpress packages that are being included. However, that change aside, it does use @wordpress/babel-preset-default and from what I've seen that is not compatible with SWC correct, or has that been addressed in newer versions of SWC?

@timnolte
Copy link
Contributor

timnolte commented Apr 1, 2024

Hmm, looks like this PR is removing @wordpress/babel-preset-default, I'm not so sure that is an appropriate course to take for a WordPress block-based theme.

@kmonahan
Copy link
Contributor Author

kmonahan commented Apr 1, 2024

Correct, it is removing Babel-related plugins along with Babel. @timnolte What is the planned timeline for replacing the existing build tools with @wordpress/scripts? If it's soon, then agree there's no reason to switch to SWC and switch back. I hadn't heard that update was in the works.

@coreylafferty coreylafferty requested a review from timnolte April 1, 2024 17:47
@tropicandid
Copy link
Contributor

We discussed nixing this PR in favor of working to introduce wp_scripts and concurrently upgrading to node 20. Please see issue #449. Converting this to draft.

@tropicandid tropicandid marked this pull request as draft May 22, 2024 19:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants