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

infra: async plugin importing #182

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

Dimava
Copy link
Contributor

@Dimava Dimava commented Apr 3, 2023

I got bored of generating one plugin taking minutes to start and made this

@Dimava Dimava requested a review from Shinigami92 as a code owner April 3, 2023 14:24
tsconfig.json Show resolved Hide resolved
@Shinigami92
Copy link
Collaborator

Shinigami92 commented Apr 3, 2023

Do I understand correctly that this will just parallelize the imports of the plugins?
Is the difference really affecting?
Does the logs of generating the rule files still be sequentially?

@Dimava
Copy link
Contributor Author

Dimava commented Apr 3, 2023

Do I understand correctly that this will just parallelize the imports of the plugins? Is the difference really affecting? Does the logs of generating the rule files still be sequentially?

The only difference is that plugins get imported just before usage (in a function that alreaty was async), as the first (logged) step of plugin rule generation

@Dimava
Copy link
Contributor Author

Dimava commented Apr 3, 2023

The code took around 90 seconds to start (for just tsx watch ./scripts/generate-rule-files/cli.ts --plugins=n), now it takes a second

@Shinigami92
Copy link
Collaborator

@Julien-R44 I rewrote it a bit to apply more with "my" style

I think the ES2020 is okay, as it does not affect the npm package code (see my other comment)

Please leave your approval as well (if you do not have any further complains) and then I will merge

@Julien-R44
Copy link
Collaborator

Julien-R44 commented Apr 3, 2023

Yes I was talking about the use of the ESM internally, not in the final "bundle" for end-users. But it doesn't seem to be a problem so that's cool!
Great optimization !! Looks fine to me

@Shinigami92 Shinigami92 changed the title feat: Async plugin importing infra: async plugin importing Apr 3, 2023
@Shinigami92 Shinigami92 merged commit b07d842 into eslint-types:main Apr 3, 2023
3 checks passed
@Dimava Dimava deleted the async-plugin-import branch April 3, 2023 21:13
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.

None yet

3 participants