Skip to content
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

WIP - Nuxt 3 #4257

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

WIP - Nuxt 3 #4257

wants to merge 9 commits into from

Conversation

zackkrida
Copy link
Member

@zackkrida zackkrida commented May 2, 2024

@WordPress/openverse-frontend and @sarayourfriend I'm creating this draft pull request as a place to discuss efforts to test and deploy https://nuxt-preview.openverse.org/.

I was able to successfully build and push Nuxt 3 from this branch with the following changes:

This diff:

diff --git a/frontend/justfile b/frontend/justfile
index 5a54dc43c..488a95d62 100644
--- a/frontend/justfile
+++ b/frontend/justfile
@@ -35,6 +35,7 @@ export FRONTEND_PNPM_VERSION := `grep 'packageManager' ../package.json | awk -F'
 # Build the frontend Docker image
 build-img tag="openverse-frontend:local" target="app":
     docker build \
+      --load \
       --target {{ target }} \
       --build-context 'repo_root=..' \
       --build-arg FRONTEND_NODE_VERSION=$(just node-version) \
diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts
index e1782c3c2..6e6f15ac0 100644
--- a/frontend/nuxt.config.ts
+++ b/frontend/nuxt.config.ts
@@ -43,7 +43,7 @@ const openverseLocales = [
     name: "English",
     nativeName: "English",
   },
-  ...(locales ?? []),
+  // ...(locales ?? []),
 ].filter((l) => Boolean(l.iso)) as LocaleObject[]
 
 const isProdNotPlaywright = isProd && !(process.env.PW === "true")
diff --git a/frontend/src/locales/scripts/en.json5 b/frontend/src/locales/scripts/en.json5
index 453f30fc0..40752e85b 100644
--- a/frontend/src/locales/scripts/en.json5
+++ b/frontend/src/locales/scripts/en.json5
@@ -4,7 +4,7 @@
     main: "Go to {link} or search for something similar from the field below.",
   },
   hero: {
-    subtitle: "Explore more than 700 million creative works",
+    subtitle: "Testing Nuxt 3",
     description: "An extensive library of free stock photos, images, and audio, available for free use.",
     search: {
       placeholder: "Search for content",

And manually switching the nginx image to use the latest tag in the "staging-nuxt-preview" task definition (and template, so future deploys should work).

Edit: the patch was updated to make it pass the Playwright tests: locales are added if the

Deployment

Maintainers only

  1. Authenticate with ghcr.io
$ export CR_PAT=YOUR_TOKEN
$ echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
> Login Succeeded
  1. Run the just script
just frontend/push-to-nuxt-preview USERNAME

@github-actions github-actions bot added 🧱 stack: documentation Related to Sphinx documentation 🧱 stack: frontend Related to the Nuxt frontend 🧱 stack: mgmt Related to repo management and automations labels May 6, 2024
@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature 💻 aspect: code Concerns the software code in the repository labels May 6, 2024
@obulat obulat force-pushed the update/nuxt3-Apr26 branch 9 times, most recently from 14df293 to e63aaeb Compare May 9, 2024 09:30
@obulat obulat force-pushed the update/nuxt3-Apr26 branch 11 times, most recently from 6696e09 to 0b132cd Compare May 13, 2024 17:10
Copy link

Full-stack documentation: https://docs.openverse.org/_preview/4257

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.

@obulat obulat force-pushed the update/nuxt3-Apr26 branch 2 times, most recently from eb1dc38 to f1935e3 Compare May 15, 2024 18:32
@obulat obulat force-pushed the update/nuxt3-Apr26 branch 6 times, most recently from fbb0168 to 4587058 Compare May 20, 2024 13:37
@obulat obulat force-pushed the update/nuxt3-Apr26 branch 5 times, most recently from 1e0233d to d9f6472 Compare May 30, 2024 06:48
Use har for audio tests to prevent provider requests and flakiness
Convert ui cookies for ease of use
Move analytics tests from unit tests to e2e tests
Disable buttons until hydrated
Make audio tapes smaller
Update tests
Use har for audio tests to prevent provider requests and flakiness
Convert ui cookies for ease of use
Move analytics tests from unit tests to e2e tests
Disable buttons until hydrated
Remove everything but the homepage and content pages
Vendor in SVG sprites
Remove patch
Add search, media and related-media stores
Add search pages with search functionality
Add single result pages
Re-add tests; fix unit tests; disable buttons until hydrated
Fix invalid locale keys
Refactor search page and fetching
Fix localePath warning
Add additional search views
Get localePath from useNuxtApp
Add healthcheck and robots server routes
Add photos redirect
Add sitemap
Add simple sentry integration
Proxy API calls
Tests
Add a missing tapes and add peaks=true to related audio tapes
Add peaks=true to related tapes
Reuse the same audio for seo
Add server-prepare for initial provider loading
Fix e2e route mocking
Fix collection test
Fix provider unit test
Handle case when there are no providers
Fix ui cookie overwriting
Fix Tab border when focused
Fix Waveform on box layout
Fix Sources table sorting
Fix content report POST request
Fix global audio player on navigation
Add link to source page to the sources table
Update nuxt prepare script and add logging
Remove aria-pressed from buttons when not set
Refactor media store to make easier to test
Add coverage to unit tests
Add more media store unit tests
Extract api-token from the api route
Add api token tests
Remove duplicate tags
Use script setup for pages fetching data
Improve VSkipToContentButton and add it to VCollectionPage
Error component: add modal target and script setup
Unify error handling
Update sentry and env settings
Remove unnecessary await from VSvg
Remove provider-init plugin
Set lazy to true in useAsyncData
Remove error watch from index pages
Remove VFetchingError
Use script setup and remove useHead from pages
Remove head and localeHead from app, error and single result
Remove sentry
Use script setup; simplify VLoadMore; remove fetchState
Remove async from watchers
Convert headers to script setup
Replace store getters with actions
Remove page title
Update @nuxtjs/i18n to edge version
Update dependencies
Move search handling to search.vue
Remove single-result middleware
Use script setup and t from useNuxtApp.$i18n
layout
Replace axios with ofetch
Signed-off-by: Olga Bulat <obulat@gmail.com>

Update prettier; types; analytics plugin
Signed-off-by: Olga Bulat <obulat@gmail.com>

Use axios for fetching search requests
Signed-off-by: Olga Bulat <obulat@gmail.com>

Fix photos redirect
Signed-off-by: Olga Bulat <obulat@gmail.com>

Remove extra param
Signed-off-by: Olga Bulat <obulat@gmail.com>

Fix single result
Signed-off-by: Olga Bulat <obulat@gmail.com>

Fix back to search link for all view
Signed-off-by: Olga Bulat <obulat@gmail.com>

Try fixing error display
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>

Add locales if fewer than 5 (for testing)

Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Signed-off-by: Olga Bulat <obulat@gmail.com>
Copy link

Playwright failure test results: https://github.com/WordPress/openverse/actions/runs/9305162669

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 aspect: code Concerns the software code in the repository ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: documentation Related to Sphinx documentation 🧱 stack: frontend Related to the Nuxt frontend 🧱 stack: mgmt Related to repo management and automations
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

None yet

2 participants