-
Notifications
You must be signed in to change notification settings - Fork 204
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
Nuxt 3 migration #411
Comments
@obulat Do you know when we'll prioritise this project? Node 16 reaches EOL in September 2023, 4 months from now. It would probably be nice to give ourselves a little breathing room for planning and any major changes that need to be implemented to accommodate the Nuxt 3 transition. As I understand it that is what is keeping us on Node 16, right? |
I haven't looked at this migration from the point of view of the Node version, @sarayourfriend . I think we should prioritize it after the current Core UI improvements project is done. I'm going to be adding some more notes about the things we would need for migration, as pre-planning steps. Modules
Nuxt i18n changesThe setup changed a little bit
Route
|
beforeRouteEnter(to, from, next) { | |
/** | |
* The order in which beforeRouteEnter and middleware are called is indeterminate. | |
* We need to make sure that query `q` exists before checking if it matches | |
* the store searchTerm. | |
*/ | |
const searchStore = useSearchStore() | |
if (to.query.q && to.query.q !== searchStore.searchTerm) { | |
searchStore.setSearchTerm(to.query.q) | |
} | |
next() |
- Replace route guards with route
middleware
Regarding the modules that can be deleted: that should only happen during the Nuxt 3 migration, not before, right? |
For most modules the answer is yes, we should only delete them during the Nuxt 3 migration. |
Do you think it's worth us writing an implementation for this? Just doing the count on how much longer before Node 16 EOL, I think three weeks of planning for this (writing + review) would be on the potentially speedier side. That would give us about 2.5 months for implementation, which would hopefully allow us a small amount of wiggle room to account for unexpected difficulties. Just thinking of this in light of how difficult and roundabout the changes have been in the past when we've tried and considering the distinct possible approaches (Bridge vs a "re-write" with Nuxt 3 vs something like Vite SSR)... getting ahead of this seems wise to me. If you agree then I'll add it to the community meeting agenda for this week. |
This makes sense to me, especially considering @obulat has already done a lot of the planning research in this comment. A formal plan should definitely help us set expectations in the context of the September 11th EOL for Node 16 (Which I've also updated the project description to mention) |
👍 Added to the agenda for this week. |
I agree with writing the implementation plan for this soon.
I think Nuxt i18n does not support bridge, so we can only go with a "re-write" with Nuxt 3. |
Hi @obulat, this project has not received an update comment in 14 days. Please leave an update comment as soon as you can. See the documentation on project updates for more information. |
hi @obulat, check |
This project will be placed On Hold while TypeScript updates are made to the codebase. Those changes will impact the contents of the implementation plan which has also been drafted. |
@sarayourfriend thanks for the reminder about Dhruv's local issue, we definitely want to watch out for that.
Yes, I should have been more specific. After the chat I was thinking as a very first step we could simply see how Nuxt 3 behaves with only English first. It would be quite simple to deploy a single service, load test it, and then if the problem is present we'll know we're really in trouble before running any tests of multiple services split at the load-balancer. I'm fine with skipping that though if it doesn't seem worthwhile. |
Oh true, and actually we could do that and direct increasing percentages of production traffic to it as well, if we wanted, with a small bit of configuration on the load balancer side. That way we can see how it operates under some production load, without taking out all of production if it fails. If it goes well with English, we can add localizations and see if we can find the "limit" |
Thank you for the writeup, @zackkrida! I've updated the Nuxt 3 migration branch: rebased it onto main, removed unnecessary changes such as converting components to There are several code changes that work in Nuxt 2 that I think we can do before starting the testing:
|
The nuxt preview service is ready to go in this PR in the infrastructure repository: https://github.com/WordPress/openverse-infrastructure/pull/874 #4227 complements that PR by adding a script to build and push to the
|
140 locales have been removed from page generation and the locale chooser as a general improvement to Openverse, but relevant to this project, in this PR: #4224. |
2024-05-13Most of the preparation work for Nuxt 3 is done (except for #4295, which needs one more review). Once we fix the deployment, we can start testing memory consumption. |
I have successfully deployed to https://nuxt-preview.openverse.org/ ✨ |
Now that the preparation work is done, we can start memory testing. Memory consumption testingSteps
We will write the script next week, and start load-testing after it is merged. |
@obulat please open a PR in the infrastructure repository for Cloudflare rule changes. There are now drifted configurations in the Terraform because of the manual changes to the cache settings in Cloudflare, which will overwrite those manual changes if applied. |
2024-06-05 UpdateWe ran the load testing against staging (Nuxt 2) and On all scenario options (static pages with only English, search pages with only English, static pages with the 4 testing locales, static and search pages with 4 testing locales), Nuxt 2 consumes almost twice as much memory as Nuxt 3. Nuxt 2 Nuxt 3 However, during the With the caveat that the Nuxt 3 app does not have Sentry enabled, it seems that the memory usage is not a problem. Next steps
|
Definitely @obulat. The vue-router problem seems to arise simply by having these pages in memory. |
Really exciting, Olga!
As part of this, I'll want to look at reducing caching on the frontend as well, otherwise we could end up with users getting slightly different experiences. I don't know what the precise differences would be, but it's better if the traffic is consistent. I'll look and see how many frontend requests that aren't static resources are actually cached. We need closer evaluation of this as part of other work anyway... Don't let this block you though, if you get to deploying Nuxt 3 in production with split traffic (use weighted listeners with cookie-based stickiness enabled), don't want for me if I haven't had a chance to look at this yet! |
@obulat @zackkrida can either of y'all clarify what is left for the branch? I wanted to try help getting it mergeable, but I'm afraid of the large force pushes still going on would just squash any attempt I made to help. What can I do to help get it across the line? I see that storybook seems not to be working. Is that something I could help with? Is there another bettey way to help? I'll do some code review today as well, but it's hard to know what exactly to review 🙂 |
My own knowledge of the latest work on the branch is limited too @sarayourfriend. Last I heard was that @obulat was integrating Sentry and fixing a bug. We'll have to wait until Olga is back from AFK next week for an update. |
@obulat can you share an update here on how we can help get this across the finish line? |
I've been keeping the branch updated by rebasing onto the main. Currently, the missing parts that I think can be fixed in separate follow-up PRs are:
Items that were removed from
I can run the Playwright tests on my Mac. I think most of the tests have been converted to run correctly (except for Storybook tests). |
I've opened https://github.com/WordPress/openverse-infrastructure/pull/965 to address the only outstanding Cloudflare/proxy/cache configuration issue I was able to identify in my review of the Nuxt 3 branch today. Otherwise, I think our existing Nginx and other proxy configurations are correct for Nuxt 3 to roll out. |
Hi @obulat, this project has not received an update comment in 14 days. Please leave an update comment as soon as you can. See the documentation on project updates for more information. |
The Nuxt 3 PR was merged and deployed to production 🚀 |
@obulat The issues you added the blocked labels to for the code freeze, can they be unblocked now? |
Done 👍 |
Description
Vue 2 is reaching end-of-life at the end of 20231. We need to update to Nuxt 3 to use Vue 3.
Node 16, which is required to build the frontend app (Nuxt 2 applications can theoretically run on Node >16) reaches end-of-life on September 11th, 2023.
Documents
Issues
preset
to innerpostcssOptions
nuxt/nuxt#19518@nuxtjs/style-resources
#2232Prior Art
Several members of the team have attempted the migration previously but without success. This is one of such attempts: WordPress/openverse-frontend#313
The Nuxt team has said that working on simplifying the migration is one of their priorities for 2023, so hopefully, it will be easier this time.
Footnotes
Vue 2 LTS: https://v2.vuejs.org/lts/ ↩
The text was updated successfully, but these errors were encountered: