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

import v4 instead of uuid/v4 #10478

Merged
merged 2 commits into from Sep 30, 2020
Merged

import v4 instead of uuid/v4 #10478

merged 2 commits into from Sep 30, 2020

Conversation

lsmoura
Copy link
Contributor

@lsmoura lsmoura commented Sep 30, 2020

Why

Some package managers (like pnpm) don't understand the importing of uuid/v4, since the project does not have a folder "v4". The import was supposed to be resolved to uuid/dist/v4. Even tough it works on npm and yarn, it's behaviour is not documented anywhere.

How

By imported the "named export", it works on all package managers, sticks to standards and still works when doing treeshaking.

Test Plan

For testing this, just run any "web expo" project, even the "hello world" without any changes.

Copy link
Member

@ide ide left a comment

Choose a reason for hiding this comment

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

Thank you, this also lines up with how the import is supposed to work for uuid.

@ide ide merged commit 36a413b into expo:master Sep 30, 2020
@ide ide mentioned this pull request Sep 30, 2020
brentvatne pushed a commit that referenced this pull request Oct 1, 2020
# Why

Some package managers (like [pnpm](https://pnpm.js.org/)) don't understand the importing of `uuid/v4`, since the project does not have a folder "v4". The import was supposed to be resolved to `uuid/dist/v4`. Even tough it works on npm and yarn, it's behaviour is not documented anywhere.

# How

By imported the "named export", it works on all package managers, sticks to standards and still works when doing treeshaking.

# Test Plan

For testing this, just run any "web expo" project, even the "hello world" without any changes.
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.

None yet

2 participants