Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(typescript-estree): add experimental mode for type-aware linting that uses a language service instead of a builder#6172

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
bradzacher wants to merge1 commit intomainfrompr6172

Conversation

bradzacher
Copy link
Member

@bradzacherbradzacher commentedDec 6, 2022
edited
Loading

Overview

This is just an experiment to help address memory issues (#1192), maybe performance, and maybe out-of-sync types (#5845).

I was looking into some code around the place and noticed that TS exposes the concept of a "document registry" - which is a shared cache that can be reused across certain TS data structures to deduplicate memory usage (and I assume improve performance by deduplicating work).

This PR implements a new parser strategy which uses TS's "Language Service" tooling, which in turn leverages the document registry. "persistent parse" tests pass - which at least proves that it works in some manner of speaking.

One interesting thing to note here is under the hood the language serivce doesn't use a builder program. I believe the idea is that the document registry is supposed to forego the performance implications of that? I don't know exactly - it will require more testing. Though it's worth mentioning that this means this could replace our current "single-run" codepaths because it doesn't use a builder program.

TODO:

  • figure out how to roll-back "dirty" states
  • memory pressure testing
  • runtime performance testing

viceice reacted with thumbs up emojiviceice reacted with heart emoji
… that uses a language service instead of a builder program## PR Checklist- [x] Steps in [CONTRIBUTING.md](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md) were taken## OverviewThis is just an experiment to help address memory issues (#1192), maybe performance, and maybe out-of-sync types (#5845).I was looking into some code around the place and noticed that TS exposes the concept of a "document registry" - which is a shared cache that can be reused across certain TS data structures to deduplicate memory usage (and I assume improve performance by deduplicating work).This PR implements a new parser strategy which uses TS's "Language Service" tooling, which in turn leverages the document registry. "persistent parse" tests pass - which at least proves that it works in some manner of speaking.One interesting thing to note here is under the hood the language serivce doesn't use a builder program. I believe the idea is that the document registry is supposed to forego the performance implications of that? I don't know exactly - it will require more testing. Though it's worth mentioning that this means this could replace our current "single-run" codepaths because it doesn't use a builder program.TODO:- figure out how to roll-back "dirty" states- memory pressure testing- runtime performance testing
@nx-cloud
Copy link

nx-cloudbot commentedDec 6, 2022
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commita092809. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
Node 18 - nx test typescript-estree
✅ Successfully ran 44 targets

Sent with 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedDec 6, 2022
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commita092809
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/638ed04fe6a60d000864dbdc
😎 Deploy Previewhttps://deploy-preview-6172--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site settings.

@bradzacher
Copy link
MemberAuthor

something weird is happening on the CI - dunno why it's OOMing.
cannot reproduce locally so that's fun.

@bradzacher
Copy link
MemberAuthor

Cc@jakebailey I know you had an inclination about helping us improve the perf of the tooling.

I was hoping you could help me by providing some TS insider insight ☺

Do you think this approach will help out a lot compared to the existing builder program approach?
From what I can tell by poking around and reading it'll at least save us a bunch of memory - though not too sure about runtime cost/savings yet.

Would it be worth us building our own layer on top of the document registry instead of reusing the language service?

@jakebailey
Copy link
Collaborator

Honestly, I have no clue;@sheetalkamat or someone may have better insight.

bradzacher reacted with thumbs up emoji

@JoshuaKGoldberg
Copy link
Member

Closing this old draft for housekeeping since there are merge conflicts and it's taking up space in the open PRs list. Nothing bad will happen in my housekeeping if this is re-opened. Don't mind me. 😄

@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 27, 2023
@bradzacherbradzacher added the DO NOT MERGEPRs which should not be merged yet labelFeb 27, 2023
@bradzacherbradzacher added the enhancementNew feature or request labelApr 17, 2023
@JoshuaKGoldberg
Copy link
Member

@bradzacher do you still want to work on this now thatEXPERIMENTAL_useProjectService is in (#6754)?

@bradzacher
Copy link
MemberAuthor

Let's put a pin in this - if we find that the project service works for all cases then there's no need for us to worry about improving the manual config case, I think.
We may want to re-investigate this if there are strong usecases that it doesn't support - but I'm optimistic we won't have to.

@bradzacherbradzacher deleted the pr6172 branchJuly 17, 2023 02:02
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
Assignees
No one assigned
Labels
DO NOT MERGEPRs which should not be merged yetenhancementNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@bradzacher@jakebailey@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp