Skip to content

Feat: Support Vuetify V4 - #45

Draft
snacksbro wants to merge 16 commits into
Kitware:masterfrom
snacksbro:master
Draft

snacksbro wants to merge 16 commits into
Kitware:masterfrom
snacksbro:master

Conversation

@snacksbro

@snacksbro snacksbro commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds Vuetify v4 support to Trame Vuetify.

Version Bump + Backwards Compatibility

This should all be backwards compatible, as I generated the latest wheel containing these changes and used it in a large codebase without making any modifications and v3 seems to function just the same as it did before.

Due to this, I'm unsure if I was correct in updating the version of trame-vuetify itself to v4.x.x, or if this should simply be a minor version bump.

Build Script

While building/testing this back and forth I ended up combining the commands mentioned in the js-libs's READMEs into a single script, and writing another README on how to build the components using it (and the npm build step). I added it to the MR in case you would consider it useful as well, if not I can have it removed.

Examples?

I was unsure if the examples belong here or should be somewhere else, or even if the items produced fit with a more traditional example. As a result they live in the following repo: https://github.com/snacksbro/trame-vuetify4-demo

This contains 3 main files:

  • Features - Showcases the 4 new lab components that are exclusive to v4. Nothing too ground-breaking but figured it'd be good to show what's new and a quick ai-assisted demo of them in action.
  • Config - I was looking over Vuetify's Migration Guide and was able to port some of their work-arounds to undo some of the more radical style changes and provided a quick demo on how to use this. Most notably this includes a guide to re-implement the CSS reset Vuetify 3 used to do.
  • Vuetify 3 Example - This one is nothing special, its just a quick Trame demo using Vuetify 3 still I used to test against my changes in this PR to ensure it didn't break backwards compatibility.

V4 Exclusive Components

At the time of this writing, the 4 new lab components are these:

Proper Migration

I also spent some time porting over an existing Trame project to properly migrate to Vuetify V4 and can say its not too much trouble. Most of it was find/replace references to removed utility classes. I didn't notice any bugs in any of their components. Had I used their CSS reset stylesheet this likely would have been trivial, although I'm sure they'll eventually deprecate the work-around in future updates to V4.

Minor Questions

  • I notice that trame_vuetify/module/ contains files like vue3.py and vue3_lab.py, I assume to provide backwards compatibility with projects an older import method. I didn't make a similar stub for V4 since nobody's using it yet.

May be left-over from the dir change in July, need to confirm
Had to ignore the large-files commit hook
I believe at this point I'll need to alter the top-level trame packages
Since these typos are from Vuetify themselves, we can't do much here
I'm fine if this is removed before merging to master, just found it
helpful for development
I notice this seemed to all work without it when I build the wheel via:
`python -m build .`, added in case something relies on this file
Comment thread js-libs/v3/generate_python.py
Comment thread js-libs/v4-lab/package.json
Comment thread js-libs/build-bundles.sh

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the build script I mentioned in the PR description, I was using it a lot for testing and figured I'd push it if this is something you find useful, I can have it removed otherwise

Comment thread trame_vuetify/module/v4_lab.py Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was largely lifted from vuetify 3, I was uncertain if this and the vuetify3 one could diverge in the future so I avoided just referencing it directly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On second thought, they could subtly change the API for one of the layouts here in the future so they should be seperate. I did the drawer layout in a project and verified it worked, will re-review the migration guide just to make sure nothing changed in v4 already

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would be ok to only have VAppLayout in v4 and let the users create their own...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unless you think the 2 other one provides some value.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be nice to have them if some code migration could almost work by just fixing the import at the top of the file.

Comment thread pyproject.toml Outdated
@jourdain

Copy link
Copy Markdown
Collaborator

Just a feat without a breaking change make sense as nothing from the previous code should be touched.

Comment thread js-libs/v3/.header.py
@@ -13,18 +13,19 @@ def __init__(self, _elem_name, children=None, **kwargs):
super().__init__(_elem_name, children, **kwargs)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good catch

@snacksbro

snacksbro commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Just a feat without a breaking change make sense as nothing from the previous code should be touched.

Oh whoop, looking at the blame now it seems only semantic release should be touching the version in pyproject and the __init__.py file. I'll revert the pyproject to what it was and leave __version__ untouched

"eslint": "^8.33.0",
"eslint-plugin-vue": "^9.3.0",
"prettier": "^2.7.1",
"vite": "^4.1.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

May not be needed, but it could be good to update vite to v8?

@snacksbro snacksbro Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can do, I've done this for another project, I think the only snag was v8 wanted the rust rewrite rolldown used instead of rollup for building is all, I can look into it early on Monday

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If it is a pain, pick a newer version that does not change things as drastically... But I'm just thinking it would be good to "update the build tools" to be more inline with what is used today and what vuetify4 expect to some extent.

Comment thread MANIFEST.in
graft trame_vuetify/module/v2-serve/fonts
graft trame_vuetify/module/v3-serve
graft trame_vuetify/module/v3-lab-serve
graft trame_vuetify/module/v4-serve

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if that file is still needed. But normally this is taking care by

https://github.com/Kitware/trame-vuetify/blob/master/pyproject.toml#L41-L48

Try building the wheel when you remove that file all together to validate that it is true.

@jourdain

Copy link
Copy Markdown
Collaborator

I've looked through the code and things are reasonable. The missing part is really testing it, but I'm trusting you are trying that part on your end.

Also you should put your example(s) inside the ./examples/vuetify4/** for reference.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants