-
-
Couldn't load subscription status.
- Fork 410
refactor: cleanup esm #1950
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
base: main
Are you sure you want to change the base?
refactor: cleanup esm #1950
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ea11b14 to
8558aa7
Compare
|
Ugh, this diff is massive, did you rebase it correctly? |
Haven't rebased it yet |
c603e7d to
8fab501
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also cleanup this file: https://github.com/wxt-dev/wxt/blob/main/packages/wxt/src/core/utils/eslint.ts
Other than the changes that make Vite a required dependency, the rest looks good.
Also, should this be based on the main branch? Or did you intend this to be a breaking change as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, apparently I didn't hit submit on my review, sorry for leaving you without guidance.
I was a bit confused, like didn't I just clarify + ask you a followup question? Makes sense.
Not sure what you mean, I did, right?
Vite is already a required dependency, is still a required dependency following #1945, and I'm skeptical of the multiple builders argument (I'll follow up on that above). I'll revert the changes, but I'm pretty lost as to the reasoning.
I didn't want to target changes that might be wrong, but having messed around with the codebase more, I'm pretty confident with them. |
|
The other imports to vite are because I got lazy... I'd prefer to keep it abstracted for now even if it's the only builder WXT supports. Maybe it's about time I clean those other imports up as well... Undoing the builder abstraction or more tightly coupling Vite to the project is something I will stubbornly refuse to budge on right now, sorry. |
53af521 to
4ba7209
Compare
✅ It looked like more but they were just types. Could we turn on
No need to be sorry! I'm just curious why it's built this way, I was surprised because I thought WXT was all-in on Vite. Sorry if it comes off confrontational (and I'll try not to, but knowing me I'll probably manage to complain whenever I touch these files |
4ba7209 to
a7b6b8c
Compare
As far as I could tell, the original reasons are no longer reproducible.
Since wxt-dev#848, there's no need to do all this async work. At least, as far as I could tell...
a7b6b8c to
0e5263b
Compare
These seem harmless enough I'll leave them in ig
| const [resolvedInlineConfig = {}, resolvedUserConfig = {}] = | ||
| await Promise.all([inlineConfig.vite?.(env), userConfig.vite?.(env)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could potentially be a race condition if someone is doing something stupid in their config file. Probably fine.
| const [vite, fromUser] = await Promise.all([ | ||
| import('vite'), | ||
| userVite(env), | ||
| ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
| const [builder, pm] = await Promise.all([ | ||
| createViteBuilder(config, hooks, () => wxt.server), | ||
| createWxtPackageManager(config.root), | ||
| ]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We own these, should be fine, but could potentially call something user created and cause a new race condition... yeah this is ridiculous.
| const latestVersion = dep.info['dist-tags'].latest; | ||
| const latestVersionReleasedAt = new Date(dep.info.time[latestVersion]); | ||
|
|
||
| semver.RELEASE_TYPES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oxclint was complaining and I figured I'd be nice to it.
Not sure why check didn't notice it tho, a bit concerning (cause it's in the root prob?).
Overview
A few tiny cleanups I noticed could be made while perusing around the codebase.
Manual Testing
Bundle, check it still works.
Related Issue
This PR is stacked on #1945.