-
Notifications
You must be signed in to change notification settings - Fork 112
Draft: Move Most Linting Logic to Web Workers #1047
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
base: master
Are you sure you want to change the base?
Conversation
|
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. |
9364867 to
0652bac
Compare
|
I am going to start on this again and just try to get it ready for beta testing. I plan to focus on this unless really easy or really pressing issues pop up in the meantime. |
…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
… issue with open file having changed to no longer default to making the opened file active, and other small changes
4821fdf to
cf7ddd5
Compare
|
I believe linting a file and folder are working. The log situation has yet to be ironed out. But it looks like changes are being made. I am still only testing using 1 web worker. When this goes live, I would like to have it be around 3. |
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:
RulesRunnerclass for references to the lint file manageryaml-timestamporallare disabled rules in the frontmatterutilsfolder as alintorlint-runnerfile since it is just a set of related functions that are useful when running linting operationsencountered anis converted into text that can be properly translated into other languagesdisabled rulesvalue being all gets logged properly around skipping the fileIf we want to have more than 1 worker running at a time: