-
Notifications
You must be signed in to change notification settings - Fork 207
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
Migration to Nuxt 3 #3646
Migration to Nuxt 3 #3646
Conversation
c20e337
to
c6d4eb9
Compare
29071e3
to
d5d0e86
Compare
Full-stack documentation: https://docs.openverse.org/_preview/3646 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
b6b493d
to
a80bfc9
Compare
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
Signed-off-by: Olga Bulat <[email protected]>
7b2e936
to
659a0ee
Compare
Signed-off-by: Olga Bulat <[email protected]> layout Signed-off-by: Olga Bulat <[email protected]>
659a0ee
to
f9cbebb
Compare
Signed-off-by: Olga Bulat <[email protected]>
f9cbebb
to
2cd94a6
Compare
Playwright failure test results: https://github.com/WordPress/openverse/actions/runs/7779344167 It looks like some of the Playwright tests failed. You can download the trace output and image diffs for the failed tests under the "Artifacts" section in the above page. You can read the docs on how to use this artifact. If the test is flaky, follow the flaky test triage procedure. |
@obulat Can we close this PR in the meantime, until we get ready to attempt this again (or do something else entirely)? I'll close it proactively, but please reopen it with a note why we need to keep it drafted long-term, if that is the case. |
Fixes
Fixes #411 by @obulat
Description
This PR migrates the frontend app from Nuxt 2 to Nuxt 3. The following functionality works well:
Fetching changes
Fetching media on
search
,single-detail
andcollection
pages is done inuseAsyncFetch
. Previously, we were splitting the fetching between middleware for the server and theuseFetch
for the client fetching, to make sure that the server finishes fetching before sending the page to the client, and there are no client-server mismatches. While working on this PR, I realized that Nuxt requires some data (payload
) returned from theuseAsyncFetch
function to cancel re-fetching of the same data on the client when hydrating (which was actually causing the mismatch).We cannot call
showError
from inside theuseAsyncFetch
, so there's an error watcher that redirects to the error page after theuseAsyncFetch
in the components.The search results are now fetched in the search layout. The reason for moving it from the child
search.vue
page was the fact that the server-rendered page would not update the result count in the header after the server fetches the media. This was causing the server-client mismatch.Global audio player
The global audio component is moved to the
app.vue
, the base component for all pages. The global audio would either keep playing on navigation, or stop playing when navigating from one single result page to the other. Previously, we were getting the active audio properties from media store or from the related media store. If the item wasn't found in the store, it would be set to null, and the player would be closed until the new item is fetched from the API. To fix this, I added thedetail
property to theactiveAudio
store, so that if there is an active audio, we always have its properties and can show it in the global player.API proxying
The API calls are now proxied through the Nuxt server route (
/api/...
). This allows us to send the auth credentials with all of the Nuxt requests.TODO:
.env
template file has all necessary variables.env
variables correctly.Testing Instructions
Go to https://staging.openverse.org and check that the deployed version works correctly. Read through the code and see that it makes sense.
Locally
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin