Skip to content

Import Prettier from prettier/standalone #1024

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

Merged

Conversation

remcohaszing
Copy link
Contributor

What does this PR do?

The import from prettier includes support for all languages supported by Prettier. The prettier/standalone import only includes the core. The prettier export also points to prettier/standalone for the browser export condition.

This means that with this change yaml-language-server has to load less code, leading to faster startup time. And depending on configuration, it may lead to smaller bundle sizes.

What issues does this PR fix or reference?

This PR is an improvement, but I would strongly prefer #983.

Is it tested? How?

npm test

The import from `prettier` includes support for all languages supported
by Prettier. The `prettier/standalone` import only includes the core.
The `prettier` export also points to `prettier/standalone` for the
`browser` export condition.

This means that with this change `yaml-language-server` has to load less
code, leading to faster startup time. And depending on configuration, it
may lead to smaller bundle sizes.
@coveralls
Copy link

Coverage Status

coverage: 84.313%. remained the same
when pulling d04645f on remcohaszing:prettier-standalone
into 96feb3d on redhat-developer:main.

Copy link
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

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

LGTM

@msivasubramaniaan msivasubramaniaan merged commit dffbff4 into redhat-developer:main Mar 11, 2025
4 checks passed
@remcohaszing remcohaszing deleted the prettier-standalone branch March 17, 2025 07:54
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.

3 participants