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

Drop the default export? #370

Closed
ctavan opened this issue Feb 18, 2020 · 3 comments · Fixed by #372
Closed

Drop the default export? #370

ctavan opened this issue Feb 18, 2020 · 3 comments · Fixed by #372
Milestone

Comments

@ctavan
Copy link
Member

ctavan commented Feb 18, 2020

In uuid@3.x the Version 4 algorithm was exported as a default:

const uuid = require('uuid');
uuid(); // -> "2b0d20b0-6462-4738-abe6-413512e9fbf2"

In the current master this is no longer the case:

const uuid = require('uuid');
uuid(); // -> Uncaught TypeError: uuid is not a function
uuid.v4() // -> "ea58b65b-80c4-44c6-b482-6714c78ac43e"

The minimum we should probably do is describe this in the README and in the CHANGELOG.

I could also try to use the data from https://github.com/tc39/proposal-uuid/tree/master/analysis in order to try to figure out how much of a breakage removing the default export would be?!

What do you think about this breaking change @broofa?

@ctavan ctavan added this to the 7.0.0 milestone Feb 18, 2020
@broofa
Copy link
Member

broofa commented Feb 19, 2020

Finally, an actual breaking change! ;-) (I'm fine with this since we've been actively discouraging people from using a default export since v3.)

@ctavan
Copy link
Member Author

ctavan commented Feb 20, 2020

Cool! I only found out about this breaking change now while writing the TypeScript types, so it looks like you did a great job at discouraging it's use 😂!

I will still add a note to the upgrading section in the readme though and will make sure that this breaking change appears in the CHANGELOG.

ctavan added a commit that referenced this issue Feb 20, 2020
BREAKING CHANGE: The default export, which used to be the v4() method
but which was already discouraged in v3.x of this library, has been
removed.

Fixes #370
ctavan added a commit that referenced this issue Feb 21, 2020
BREAKING CHANGE: The default export, which used to be the v4() method
but which was already discouraged in v3.x of this library, has been
removed.

Fixes #370
@ctavan ctavan mentioned this issue Feb 21, 2020
10 tasks
@Raynos
Copy link
Contributor

Raynos commented Apr 7, 2020

I would recommend leaving a human readable exception in place for user experience.

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 a pull request may close this issue.

3 participants