-
Notifications
You must be signed in to change notification settings - Fork 67
feat: use history mode and deprecate hash routing by pre-rendering pages #494
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
Conversation
Thanks, @zebateira! I'll take this for a spin tomorrow and would love a tour at some point this week, but a few quick questions based on your description of the changes and caveats:
|
Sorry, my bad, I was not descriptive enough here: I mean to say that await is not supported in node in the global scope/top-level in the current version, so the correct answer to your question is: it only affects the way we use the internal APIs we built to help our Vue files talk to our JSON data.
What do you mean by one-time process?
No, it will work as expected. The redirect still happens because it was done under the hood by
The former. Because if you change the theme in the first editor, the second will also change. So we have to choose one theme that will be applied to both.
|
I just had a crazy idea tho: using For comparison, this is the current live version: Support for the I pushed this change. @terichadbourne let me know if you think it looks ok. |
Thanks for the clarifications! The filter trick looks great based on your screenshots. Very sneaky. 🤓
Sorry, I wasn't clear. I was asking whether you were making a list of all the URLs that currently exist (hash ones) and their corresponding hashless ones (in which case the list doesn't get updated later, we just create it once), or doing something programmatically forever to remove hashes from URLs for everything, even if those pages don't exist yet. Sounds like the latter. So related question... will pulling the hashes out like this prevent us from using anchor tags moving forward? (Haven't been able to yet, but I've been excited to do it.) I assume anchor tags won't have a slash immediately after them, so if we're only removing |
Oh, one other related question that would need to be addressed outside of the PR. Is there any way we can retroactively fix existing data in Countly so that for things segmented by paths we can find one entry for a page instead of looking for a stat from when we had hash mode and a stat from when we had history mode and adding them together? |
Yes, the latter. Here is the change that performs the redirect: https://github.com/ProtoSchool/protoschool.github.io/pull/494/files#diff-1c90ff38a08209f9ebd4d05d1e43358eR34
If you check the above redirect code change we only remove and redirect paths that contain hashes that start with |
I'll look into this 👍 |
Note: add tests to check the redirects Update: done! 9eeb443 |
d2abdd3
to
f5a285c
Compare
412b96f
to
254147e
Compare
254147e
to
aa4991e
Compare
Closed since |
Update on this: the countly team has migrated our data, and so previous |
Closes #105 🎉
Unblocks #258 🎉
This PR removes hash routing by using
history: 'mode'
and pre-renders the pages as suggested by @mikealThis should be ready to go, but we need to discuss the bellow caveats and understand if they are blockers to release this.
Changes
#/
)prerender-spa-plugin
(only turned on in production to not slow down dev builds and hot reload)vue-monaco-editor
(deprecated) withmonaco-editor-vue
vue.config.js
file (sinceawait
is not supported in node in the current version). This affects the protowizard, so I updated it and the tests.Caveats
0.6
to0.20
of themonaco-editor
package. Issue: monaco-editor/#338window.location.search
instead ofwindow.location.hash
triggers a scroll to top. To try and minimize this I manually restored the scroll when we change the quey parameters, but sometimes it still flickers.