-
Notifications
You must be signed in to change notification settings - Fork 85
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
Draft: Move Most Linting Logic to Web Workers #1047
base: master
Are you sure you want to change the base?
Conversation
…oad (if it stops working as I add things it needs to be addressed)
…the linting of file content
…ile working. Note that the logging is not working properly.
…d from the worker to the main thread
…quired for rules to run and added some more changes to get closer to getting the worker setup in place for all linting types
…d the old rules runner which should be replaced by the worker now
I am going to beef up the integration test suite for this to make sure I have a higher degree of confidence that this is working as expected. Right now I am not entirely sure that I am at a good point to move forward with this PR since I am feeling a little overwhelmed thinking about all of the manual testing that will be needed. If I add enough ITs, it should give me a better feeling of certainty as to the reliability of these changes. |
Fixes #337
Relates to #927
Relates to #872
This should unblock #488 which gets us closer to #183
To make the linting experience better for users, it is better if we can run the linting logic on a separate thread from the main thread. This will allow the user to be able to work on things if linting a file is taking a while. Most rules can run in the web workers. But the ones that deal with moment or obsidian specific logic have to remain on the main thread since they cannot have their data passed to and from the web worker (this is a limitation due to the complexity of the moment object) and because the source code is not available at compile time which makes it impossible to inline the logic from obsidian. So we have to compromise a little here. But this should still be a net improvement for users with larger files or who use mass linting options on their vaults. This will need to be in BETA for some time if possible. So I will need to setup BRAT for this change.
TODO:
RulesRunner
class for references to the lint file managerutils
folder as alint
orlint-runner
file since it is just a set of related functions that are useful when running linting operationsIf we want to have more than 1 worker running at a time: