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

Add sideEffects flag to library packages #1643

Merged
merged 1 commit into from
Aug 23, 2024
Merged

Add sideEffects flag to library packages #1643

merged 1 commit into from
Aug 23, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented Aug 23, 2024

Closes #1642

Adds the sideEffects: false flag to our library package.json files. Since we only export methods/constants/classes and don't perform any polyfills, our libraries don't have any side effects. This results in smaller bundles when only a subset of Langium's features are used.

@msujew msujew added the polish Some feature needs improvement label Aug 23, 2024
@msujew msujew added this to the v3.2.0 milestone Aug 23, 2024
Copy link
Contributor

@dhuebner dhuebner left a comment

Choose a reason for hiding this comment

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

I tested our code (hope I did it right) with Rollup to check for side effects and it seems like we don't have them, at least nothing was reported.

@msujew msujew merged commit 2066098 into main Aug 23, 2024
5 checks passed
@msujew msujew deleted the msujew/side-effects branch August 23, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Some feature needs improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

langium package cannot be tree-shaken well
2 participants