-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix tree shaking #21
Merged
Merged
Fix tree shaking #21
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1611527
New export
cdedreuille 1655f06
Test with new export
cdedreuille 5fc08fe
Update tsup.config.ts
cdedreuille 30271e7
Update tsup.config.ts
cdedreuille da9d4e1
Test new structure
cdedreuille f6d04c9
Test
cdedreuille a240a20
Update package.json
cdedreuille 4682571
Update package.json
cdedreuille c76c8d6
Try something
cdedreuille 41fcadf
Update tsup.config.ts
cdedreuille 1d05674
Test
cdedreuille b9bd056
Stuff
cdedreuille 3072114
Cleaning
cdedreuille acbea1d
Update package.json
cdedreuille 2230fe1
Update tsup.config.ts
cdedreuille f9be3b6
Change name of all icons
cdedreuille 5fc3960
Update package.json
cdedreuille bf34a28
Update package.json
cdedreuille File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does that mean that we don't provide cjs exports anymore?
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 found a couple of places where it says that setting
"main": "./dist/index.js",
is enough for cjs. But I might be wrong. What would be your recommendation?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 am not that experienced with this kind of setting. @ndelangen is the best person to ask.
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.
On what basis are we making these changes? What's the rationale? Do we know what effects these changes will have and why?
I'd expect a PR description detailing what the problem was, how the code change fixes it and potentially the alternatives and potential alternatives.
This is the first time for me looking at this codebase as far as I can remember, so I can't determine if this change is ok or now.
cjs
exports seems/feels wrongBut maybe there are valid reasons for doing this. I do not have enough context.
I do not trust the screenshots of a website I do not know the details of.
I was told it's running esbuild, but it's extremely dependent on how esbuil is configured, as well as other factors in our toolchain if the code is actually treeshaken in the end or not.
I'd like to see the actual tree-shaken code when consumed in the manager itself, and inside a manager-entry.
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.
@ndelangen We are not using the library anywhere right now. The question is more about is the best way to export the library in
package.json
. I made this change inpackage.json
because it was recommended in a couple of articles I found but I'm definitely not an expert in that field.cjs
exportReact.forwardRef
is not annotated as PURE evanw/esbuild#2749There 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 guess I'm not sure what's the difference between:
and
In the later, it seem we still need
"main"
. I can't find a clear answer on the web.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.
By the way @ndelangen I brought back the change.
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.
Thank you for that context & link, I agree that it makes sense then.
Ok, I see. I'm fine with removing it, if we're sure that's the right thing to do, and we can argue why, and preferable demonstrate.
package.json
exports fields are complex, because they are used by a variety of tools in a variety of ways depending on multiple variables