-
Notifications
You must be signed in to change notification settings - Fork 61
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 for partial loading or not loading at all of the GitHub Writer #348
Conversation
@Dumluregn let's have it reviewed either by you or me. |
I've tested this briefly, and can confirm that it is working way better now. |
@mateuszzagorski, I can only reproduce the issue with editing comments. Indeed, the editor is then partially loaded – yet it doesn't seem to fix itself after editing the same comment again. However, I can't reproduce other issues you raise. Could you share some more details? |
Sure @Comandeer. I am experiencing the issues when using Chrome (v 104.0.5112.79 ). 1. Opening PR for the first time: After refreshing it's working as expected. 2. Creating a new PR Similarly to the previous issue - when refreshed, it's working as expected. |
I can't reproduce the issue with creating new PR but I'm able to reproduce the issue with navigating to PR. It's present only at the first navigation to the PR, then it disappears. |
I conducted a research on how this PR improves the loading of GH Writer in different scenarios.
The results are in the table below. To sum up:
I think that this PR is a great improvement on its own and it's worth to release a new version once we merge it. (the table below has 5 columns - you may need to scroll it horizontally)
|
Ok, since we have a confirmation that it indeed improves many cases - let's merge it. |
The GHW's router listened to pjax events to detect when it should destroy the old editors and initialize new ones. However, it seems that GH no longer uses the pjax and it uses Turbo instead. I've replaced the pjax events with their Turbo equivalents:
pjax:start
→turbo:before-visit
,pjax:end
→turbo:render
.Thanks to that, the navigation between pages is correctly detected and handled and GHW is once again loading correctly.
Closes #337.