Skip to content

How to Widget reactivity client side ? #3895

Answered by boutell
ezzle asked this question in Q&A
Discussion options

You must be logged in to vote

Generally speaking, Apostrophe has very few opinions about frontend JavaScript. If you want to use a reactive library like Vue or React to implement widget players, you can do that, or you can write vanilla JavaScript.

One challenge is that two separate widgets occupy separate parts of the DOM so you can't just put them in the same Vue or React app. A solution to that is to use a reactive store library like Vuex or Redux, with a single instance shared by all apps in the page.

Another challenge is that, currently, there is a bug in vue-loader that makes it difficult to use Vue 2 and Vue 3 in the same project, even though in theory they should coexist. Since Apostrophe 3 uses Vue 2, we curr…

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ezzle
Comment options

You must be logged in to vote
2 replies
@boutell
Comment options

@boutell
Comment options

Comment options

You must be logged in to vote
1 reply
@boutell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants