Skip to content
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

Support esm via package.json routes #455

Closed
wants to merge 1 commit into from
Closed

Support esm via package.json routes #455

wants to merge 1 commit into from

Conversation

TrySound
Copy link
Contributor

Ref #77

@TrySound
Copy link
Contributor Author

/cc @jquense @Andarist

@@ -2,14 +2,18 @@
"name": "react-transition-group",
"version": "2.5.3",
"description": "A react component toolset for managing animations",
"main": "lib/index.js",
"main": "lib/cjs/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldnt it make sense to also remove semantic-release-alt-publish-dir ? and restructure the rest to more common structure? i find this indirection rly confusing when i track what particular scripts do

Copy link
Collaborator

Choose a reason for hiding this comment

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

I hear that, tho I'm inclined to accept some more confusing build output if it means easier, and shorter imports when consuming. I mean we are already doing this package json thing which is a very uncommon pattern right?

Copy link
Contributor

Choose a reason for hiding this comment

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

right, although I wasnt proposing making the imports longer but rather building to dist (and some files to root) and just using files/npmignore to filter out what gets published - this wouldnt change how the lib is consumed, only how it gets built

Copy link
Collaborator

Choose a reason for hiding this comment

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

it would effect how they are consumed tho wouldn't It? you can't use files and npmignore to avoid import 'foo/lib/module' you need to to publish everything without a lib, e.g. you can't tell a package to resolve 'foo/module' to 'foo/lib/module'

Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd like the build step to not produce a ton of root directories/files they should be scoped under /build or whatever, otherwise it gets confusing and harder to understand whats happening in the repo, and gitignores need to keep being updated for new files etc. The publishDir thing doesn't bother me b/c it only produces an inconsistency between whats in npm and the repo structure, that, i think is fine. There isn't any need for the two to match.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can with if you make foo/module a directory with package.json in it which would have main field pointing to foo/lib/module (which this PR already adds with cherry-pick tool)

my proposal is merely to change where npm artifacts gets outputted to, because I feel that this alt-publish-dir introduces a confusing indirection

@TrySound
Copy link
Contributor Author

Is this good to merge?

@silvenon
Copy link
Collaborator

@TrySound I'll test this in the next few days and apply fixes if necessary, taking into account the conversation in this PR.

@silvenon silvenon closed this in ef3e357 Mar 22, 2019
jquense pushed a commit that referenced this pull request Mar 22, 2019
# [2.7.0](v2.6.1...v2.7.0) (2019-03-22)

### Features

* support ESM (tree-shaking) ([#455](#455)) ([ef3e357](ef3e357))
@jquense
Copy link
Collaborator

jquense commented Mar 22, 2019

🎉 This issue has been resolved in version 2.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@silvenon
Copy link
Collaborator

I tested tree-shaking and it works! I resolved some conflicts and pushed the changes in a separate commit. Thanks!

silvenon added a commit that referenced this pull request Mar 22, 2019
@TrySound
Copy link
Contributor Author

@silvenon @jquense Ping guys. Need to remerge this and fix release script.

@taion
Copy link
Member

taion commented Apr 15, 2019

@TrySound Do you want to pull the PR back up and just mark it appropriately as breaking this time around? It's really only weird interop stuff that's breaking; the CJS exports per se are still fine.

johnfrench3 pushed a commit to johnfrench3/transition-group-react that referenced this pull request Nov 2, 2022
patrickm68 added a commit to patrickm68/react-transition-group-developer that referenced this pull request Dec 1, 2022
shaikdev2 pushed a commit to shaikdev2/transition-group-react that referenced this pull request Jun 9, 2023
GreenCat1996 added a commit to GreenCat1996/react-transition-group that referenced this pull request Aug 1, 2023
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.

5 participants