Skip to content

feat: Migrate to Nuxt 3 framework #5184

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

Merged
merged 489 commits into from
Jun 19, 2025

Conversation

mrth2
Copy link
Contributor

@mrth2 mrth2 commented Mar 6, 2025

feat: Migrate to Nuxt 3 framework

What this PR does / why we need it:

This PR migrates the frontend application from Nuxt 2 to Nuxt 3, bringing significant performance improvements and updated dependency support.

Key changes include:

  • Upgraded from Vue 2 to Vue 3 with Composition API
  • Migrated from Vuetify 2 to Vuetify 3
  • Replaced @nuxtjs/auth-next with @sidebase/nuxt-auth
  • Updated component syntax to match Vue 3 standards
  • Refactored composables to work with Nuxt 3’s module system
  • Modified reactive state management to use Vue 3’s Composition API
  • Replaced @nuxtjs/axios ( deprecated ) with axios & the custom nuxt plugin
  • Replaced @nuxtjs/proxy with nitro built-in proxy

The migration improves developer experience with better TypeScript support, faster HMR (Hot Module Replacement), and access to modern Vue ecosystem features.

Which issue(s) this PR fixes:

Fixes #XXX (Migration to Nuxt 3)

Special notes for your reviewer:

Please pay special attention to:

  • Authentication flow changes with the new auth provider
  • Vuetify 3 UI changes
  • Component lifecycle handling in the Composition API
  • TypeScript type definitions across the application

Testing

Testing was conducted across all major components and pages, ensuring:

  • Recipe browsing functionality works correctly
  • Authentication and authorization flows are maintained
  • Responsive design works across different viewports
  • User preferences are correctly stored and retrieved

Comment on lines 4 to 6
<BaseDialog v-if="editTarget" v-model="dialogStates.edit" width="100%" max-width="1100px"
:icon="$globals.icons.pages" :title="$t('general.edit')" :submit-icon="$globals.icons.save"
:submit-text="$t('general.save')" :submit-disabled="!editTarget.queryFilterString" @submit="editCookbook">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I know this is a work in progress - very exciting)

If we can stick with consistent formatting it'll make the diff a lot easier to review. Currently this is showing ~12 lines removed and 3 added, whereas it's probably only 2 lines actually changed? (I didn't look too closely, but $tc => $t by the looks)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is anything removed or added here, just a reformat putting multiple arguments in one row and wrapping at a reasonable length.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that's what happening. Just makes the diff harder to parse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • FYI the changes was $tc => $t due to nuxtjs/i18n upgrade

  • I agreed on the formatting. What was the rule for formatting, please?

Copy link
Collaborator

@michael-genson michael-genson Mar 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than actual changes (e.g. changing $tc to $t) can we just keep the original formatting? I don't think we had a specific rule, one of the things I wanted to add after the migration is linter rules similar to how we do the backend

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so that you know, I used the VS Code with the Vue Official plugin. The code was formatted with this plugin.

The change on CookbookPage is pretty easy to reformat into original formatting. I understand the hard part of reviewing if the code has reformatted, but we have no specific rule, and many components were changed due to migration...

As I observed along the way, not all components (some pieces of code ) were reformatted after I added changes to them. This means there is different formatting throughout the front end.

@mrth2 mrth2 marked this pull request as ready for review March 18, 2025 16:59
@Kuchenpirat
Copy link
Collaborator

Can you fix the failing tests, should mostly be replacing the node version.

@mrth2
Copy link
Contributor Author

mrth2 commented Mar 19, 2025

Can you fix the failing tests, should mostly be replacing the node version.

@Kuchenpirat Can you please check it again? I have upgraded the workflow node version to v20. The checks for commits were successful, but the PR check seems to be hanging.

@Kuchenpirat
Copy link
Collaborator

yeah, we have to approve running tests for first time contributors.

@mrth2
Copy link
Contributor Author

mrth2 commented Mar 19, 2025

yeah, we have to approve running tests for first time contributors.

I agree. The tests are now successful, but the lining phase failed due to a heap out of memory. Can we retry it later after the backend is successful?

@mrth2
Copy link
Contributor Author

mrth2 commented Mar 19, 2025

There are some issues with Playwright tests; my first guess is due to the change in the Vuetify component structure. I'll try to fix them.

@Kuchenpirat
Copy link
Collaborator

retriggered both tests with the same result

@mrth2
Copy link
Contributor Author

mrth2 commented Mar 21, 2025

@Kuchenpirat please trigger the workflows again

@michael-genson
Copy link
Collaborator

michael-genson commented Mar 21, 2025

It looks like there are a lot of warnings from the linter. Are these addressable?
https://github.com/mealie-recipes/mealie/actions/runs/13985262869/job/39157799776?pr=5184

Similarly there are also some code warnings (check the commit page and scroll down):
image

@Kuchenpirat
Copy link
Collaborator

Also it seems that this commit 57369d5 changed formatting for pretty much every frontend file?

Increasing indent size from 2 spaces to a tab leading to over 37k added and 30k removed lines.

@michael-genson
Copy link
Collaborator

Good catch. Can we revert back to 2-space indentation? While some files definitely did have 4 space indentation, the vast majority had 2 spaces

@mrth2
Copy link
Contributor Author

mrth2 commented Mar 21, 2025 via email

@michael-genson
Copy link
Collaborator

michael-genson commented Mar 21, 2025

To get the local version working we have to disable verbatimModuleSyntax; can you add that to tsconfig.json?

{
  "extends": "./.nuxt/tsconfig.json",
  "compilerOptions": {
    "noImplicitAny": false,
    "verbatimModuleSyntax": false,  // <--- this
  }
}

It will take some time to get through everything, but some preliminary notes on app appearance below. In general some changes to Mealie's appearance are acceptable (we're coming from a pretty old framework) but they have to be as good as (or better than) how they used to be. We definitely don't want regressions.

While hardly a "great" dataset, if you don't already have data in your test instance, here's a snapshot of the demo instance:
mealie_2025.03.21.20.07.07.zip

You can restore from here by going to settings -> backups -> upload -> backup restore


On the main page, the app sidebar doesn't render right. When scrolling recipes, only the main area should scroll, not the sidebar. Because of this, if you have more than ~30 recipes, the settings, language, and light/dark mode toggle is off screen:

Old State
image

New State
image


Images should fill the entire recipe card on non-compact mode:

Old State
image

New State
image


The compact view doesn't look right, things don't seem to be rendering properly. To switch to the compact view:
image

Old State
image

New State
image

Kuchenpirat and others added 25 commits June 18, 2025 11:40
@Kuchenpirat
Copy link
Collaborator

All Lint Errors are fixed now 🤘🚀

@michael-genson michael-genson enabled auto-merge (squash) June 19, 2025 16:59
Copy link
Collaborator

@michael-genson michael-genson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What could possibly go wrong?

@michael-genson michael-genson merged commit c24d532 into mealie-recipes:mealie-next Jun 19, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants