-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
fix(service): cached JsFormatOptions
with overrides
#2186
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
A-Project
Area: project
A-Website
Area: website
A-Changelog
Area: changelog
labels
Mar 25, 2024
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
ematipico
reviewed
Mar 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left few suggestions to improve the code
No need to drop the lock when it is going out of scope
Sec-ant
force-pushed
the
fix/configuration
branch
from
March 25, 2024 10:10
296bbdc
to
93b1c44
Compare
ematipico
approved these changes
Mar 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes an issue where we cache the final options after we apply overrides to the options, and reuse them in other files in the same workspace. JavaScript/TypeScript files of different variants (
.ts
,.js
,.tsx
,.jsx
) in a single workspace cannot share the same cache because they have different file source params which will affect how they are formatted. This PR uses theJsFileSource
as the cache key so files of different file sources will have different cached options. Refer to #2109 (comment) for more details.Fixes #2080, fixes #2109.
As a side note/fix, I updated the overrides application functions and configuration doc on our website to take options
lineEnding
andattributePosition
into account. They were not properly applied or documented. I grouped them into a dedicated commit: bd3aa2c.Test Plan
Unfortunately I cannot reproduce this issue in our memory filesystem. I think this problem has something to do with the IO overhead in different kinds of filesystems. I tested this fix locally with the provided minimal reproductions in #2080 (comment) and #2109 (comment) and this issue is fixed in those two cases.