Skip to content

feat: compiler register hook#482

Merged
tvanhens merged 4 commits intomainfrom
tyler/register-hook
Sep 9, 2022
Merged

feat: compiler register hook#482
tvanhens merged 4 commits intomainfrom
tyler/register-hook

Conversation

@tvanhens
Copy link
Copy Markdown
Contributor

@tvanhens tvanhens commented Sep 6, 2022

Fixes #

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 6, 2022

Deploy Preview for effortless-malabi-1c3e77 ready!

Name Link
🔨 Latest commit b4168bd
🔍 Latest deploy log https://app.netlify.com/sites/effortless-malabi-1c3e77/deploys/631b447f9db7970009c5fbf3
😎 Deploy Preview https://deploy-preview-482--effortless-malabi-1c3e77.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

register.js Outdated
},
},
transform: null,
target: "es2021",
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

How did we choose this? Any reason not to jump straight to 2022?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I cargo-culted it from the test-app directory like the grown up developer I am 🤣

I'll update it to es2022

@tvanhens tvanhens force-pushed the tyler/register-hook branch from 628f2dd to c71a946 Compare September 6, 2022 20:31
@tvanhens tvanhens changed the title wip: register hook feat: compiler register hook Sep 6, 2022
@@ -0,0 +1,26 @@
const register = require("@swc/register/lib/node").default;

register({
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Will we need to allow users to specify any of these configuration properties?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but breaking this into a separate file and allowing the config to be overwritten seems to be causing the error I was running into yesterday. As it stands, users can still overwrite the config by including a .swcrc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My inclination is to get the critical path in place first to unblock the getting started section of the website and then come back and figure out the problem with making this composable. Doing so is a non-breaking change with the hook in place so I don't think it makes sense to block finishing the getting started guide.

@@ -1,29 +0,0 @@
{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Did you forget to remove the root .swcrc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's still needed for testing. Will remove when I add a jest loader.

Tyler van Hensbergen and others added 4 commits September 9, 2022 07:49
@tvanhens tvanhens force-pushed the tyler/register-hook branch from f326a5e to b4168bd Compare September 9, 2022 13:49
@tvanhens tvanhens marked this pull request as ready for review September 9, 2022 13:50
@tvanhens tvanhens merged commit ed0ae82 into main Sep 9, 2022
@tvanhens tvanhens deleted the tyler/register-hook branch September 9, 2022 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants