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

[WIP] feat: Remove the export from models/index #1298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Crash--
Copy link
Contributor

@Crash-- Crash-- commented Jan 11, 2023

In order to enhance the cozy-client tree shaking,
we should avoind importing * and exporting.

We had an issue with this PR
#1274

because this PR adds date-fns v2 as dep, but even
if the consuming app doesn't use the concerned model it was imported.

BREAKING CHANGE: You can not use
import { models } from cozy-client
...
models.files.func()

You have to change it to:
import { func } from cozy-client/dist/models/files

In order to enhance the cozy-client tree shaking,
we should avoind importing * and exporting.

We had an issue with this PR
#1274

because this PR adds date-fns v2 as dep, but even
if the consuming app doesn't use the concerned model
it was imported.

BREAKING CHANGE: You can not use
import { models } from cozy-client
...
models.files.func()

You have to change it to:
import { func } from cozy-client/dist/models/files
@Crash--
Copy link
Contributor Author

Crash-- commented Mar 15, 2023

still need to work on this subject to have a better understanding of the three shaking mechanism.

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

1 participant