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

refactor(transloco): tree-shake injection token names in production #821

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

arturovt
Copy link
Contributor

@arturovt arturovt commented Jan 1, 2025

In this commit, we tree-shake injection token names in production by inlining the ngDevMode condition. This is the same approach that Angular uses.

See, for instance: https://tinyurl.com/4y9dxzsp (long GitHub URL).

ngDevMode cannot be extracted into a separate shared variable, as this would result in a separate runtime variable. The condition must always be inlined for the minifier to work correctly.

In this commit, we tree-shake injection token names in production by inlining the `ngDevMode`
condition. This is the same approach that Angular uses.

See, for instance: https://tinyurl.com/4y9dxzsp (long GitHub URL).

`ngDevMode` cannot be extracted into a separate shared variable, as this would result in a
separate runtime variable. The condition must always be inlined for the minifier
to work correctly.
@shaharkazaz shaharkazaz merged commit 21dd562 into jsverse:master Jan 2, 2025
6 checks passed
@shaharkazaz
Copy link
Collaborator

@arturovt Thanks for the PR! 🥳

@arturovt arturovt deleted the refactor/tree-shake branch January 2, 2025 08:21
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.

2 participants