Skip to content

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.

1 participant