-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
feat!: move to ESM first with dual ESM/CJS subpackage exports #881
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
# Conflicts: # tests/memoryleaks.test.ts
@@ -1,49 +1,67 @@ | |||
{ | |||
"name": "valtio", | |||
"type": "module", |
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.
ugh, unfortunately, this is not acceptable. we try to keep cjs first. we plan esm first for valtio v3.
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 pr is for main, I can send another pr using commonjs to v2 branch (this PR should be closed)
Sounds good. This PR introduces too many changes and can't even see if there are breaking changes or not. I'm pretty sure it breaks some old environments. I would appreciate if you can send small PRs. For example: #882 (well, it's exceptionally small.) |
}, | ||
"./*": { |
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.
I'm curious why we need to avoid subpath patterns?
At least, we should separate for different issues: a) fix the result in |
Related Issues or Discussions
Talk with Kato and Moha in discord.
Summary
Move to ESM first and include subpackage exports.
This PR also includes:
useProxy
fromsrc/macro.ts
module and patch the d.ts and d.cts filesbuild
to runbuild:all
: now we can generate multiples outputs (d.mts, d.cts and d.ts) and also the ts3.4 version, we need to play with the target and maybe lib to fix ts3.4postbuild
now includes onlyyarn copy
, I've left oldxpostbuild
, we should remove it latercopy
script now copy src and esm from root, I've left oldxcopy
, we should remove it later: why copying src folder to remove it in the next script?Check List
yarn run prettier
for formatting code and docs