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

Move admintable vue component to its own package #11107

Merged
merged 1 commit into from
May 6, 2022

Conversation

nfourtythree
Copy link
Contributor

@nfourtythree nfourtythree commented May 5, 2022

Description

Currently, all the Vue related things for the admin table are located in the admintable asset bundle. This works perfectly fine if you are using it as part of a template or maybe even if you are instantiating it from another piece of JS.

In both of those cases calling new Craft.VueAdminTable({ ... }) will get you what you need.

From a plugin's perspective, the problem (that this PR looks to solve) arises when you are using Vue and would like to use the component inside your app. At this point you have two options, either instantiate it with the normal JS method (losing out on being able to hook into the Vue "goodness") or include it by having the cms repo checked out and having a long-winded relative path on the import (e.g. ../../../../../../cms/src/web/assets/admintable/App.vue).

Neither are particularly ideal, but moving it to its own package means it is easily includable both from within cms and for plugin developers.

This PR gives scope to also have further components in the future. For example Commerce had a need to recreate the HTML for a field in a Vue file. This could easily be moved to this new package and be available for the cms and everyone else.

The package will be publish to npm in the same way we deal with the webpack and sass packages.

/cc @timkelty

@nfourtythree nfourtythree requested a review from brandonkelly May 5, 2022 14:43
@nfourtythree nfourtythree requested a review from a team as a code owner May 5, 2022 14:43
@nfourtythree nfourtythree self-assigned this May 5, 2022
Copy link
Contributor

@timkelty timkelty left a comment

Choose a reason for hiding this comment

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

Love it.

@brandonkelly brandonkelly changed the base branch from develop to 4.1 May 6, 2022 05:18
@brandonkelly brandonkelly merged commit 357e167 into 4.1 May 6, 2022
@brandonkelly brandonkelly deleted the feature/move-admintable-vue-to-package branch May 6, 2022 05:19
brandonkelly added a commit that referenced this pull request May 6, 2022
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.

3 participants