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

build(refs T19759): update vuex to v4 [vue 3 upgrade] #2405

Merged
merged 51 commits into from
Dec 6, 2023

Conversation

hwiem
Copy link
Contributor

@hwiem hwiem commented Dec 1, 2023

Integration branch: #1151
Ticket: https://yaits.demos-deutschland.de/T19759

How to review/test

  • install dependencies in dplan
  • cd node_modules/@demos-europe/demosplan-ui && yarn && yarn build:tokens && yarn build:prod
  • in dplan, run yarn dev:<project>
  • open the project in the browser
  • login via the login form (the login via login list does not work)
  • verify that stores work as expected

Linked PRs (optional)

PR Checklist

  • Link all relevant tickets

salisdemos and others added 30 commits October 11, 2023 17:11
variouse stuff that had to be changed to see at least something.
Now the fixing can begin.
with vue3 the parent wasn't found anymore.
…nd remove click-outside

- we have to fix that later.
For now it only makes trouble
I don't get in wich version it has to be at the
same element as the loop, and when It shal nopt be on template
- config.productionTip has been removed in vue 3
- in prod build, the tip will not show up
see https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
it has been removed and is no longer needed
while these are set to the default values, defining them removes
a console warning:
vue.esm-bundler.js:6776 You are running the esm-bundler build of Vue.
It is recommended to configure your bundler to explicitly replace
feature flag globals with boolean literals to get proper tree-shaking
in the final bundle. See http://link.vuejs.org/feature-flags for more
details.
Vue.prototype is no longer available in vue 3. Instead,
app.config.globalProperties should be used

see https://v3-migration.vuejs.org/breaking-changes/global-api.html#a-new-global-api-createapp
in vue 3, the hooks in directives have changed:
bind -> beforeMount
inserted -> mounted
update -> updated
componentUpdated -> updated
unbind -> unmounted
it has been removed and is no longer needed
SearchAndSorting doesn't have a hasChangedStatements
prop, so it was added as an attribute. I could not
find any usage of it, so I believe that it was added
here accidentally and can simply be removed
in vue 3, html attributes need to be set to null
instead of false to be removed
in vue 3, the beforeDestroy hook is replaced with
beforeUnmount
…o_f_vue3_fixes

# Conflicts:
#	client/js/components/procedure/admin/AdministrationProceduresList.vue
#	client/js/components/statement/assessmentTable/SearchModal/SearchModal.vue
#	package.json
#	templates/bundles/DemosPlanCoreBundle/Extension/contextual_help.html.twig
#	yarn.lock
in vue 3, watchers for arrays are not
deep by default, so the option needs
to be set
- add empty lines before `if` and `return`
as well as after variable declarations
- rename parameter in catch blocks to avoid
confusion
- make error messages more specific
- remove unused parameter
- remove obsolete comment
we don't need to include vue-multiselect in our
dependencies as it is imported and used in demosplan-ui
- link to most recent commit in the corresponding
demosplan-ui branch for testing purposes
after the changes in demos-europe/demosplan-ui#650,
the usage of DpTab.vue needs to be adjusted - an `isActive` prop needs
to be passed to it
for testing purposes only
- to work with vue 3, vuex needs to be updated to v4
- new Store() is now createStore()
- vue/compat and vue/compiler-sfc need to be updated
to make things work
- vue-template-compiler is only needed in vue 2, so
it can be removed
- dependencies need to be updated in demosplan-ui
and vuex-json-api, too:
  - demos-europe/demosplan-ui#658
  - eFrane/vuex-json-api#534
@hwiem hwiem added the review:frontend PRs that are missing review(s) from a FE perspective label Dec 1, 2023
@hwiem hwiem self-assigned this Dec 1, 2023
in vue 3, events emitted from a component need
to be declared via the 'emits' option
in vue 3, dynamic imports need to be wrapped in a
`defineAsyncComponent()`
for testing purposes, demosplan-ui and
vuex-json-api need to be set to the most
recent commit in the feature branches needed
for the vuex update
…up_into_f_T19759_vuex_update

# Conflicts:
#	client/js/components/statement/assessmentTable/DpFilterModal.vue
#	client/js/components/statement/assessmentTable/DpMoveStatementModal.vue
#	package.json
#	yarn.lock
@hwiem hwiem marked this pull request as ready for review December 6, 2023 09:28
Copy link
Contributor

@salisdemos salisdemos left a comment

Choose a reason for hiding this comment

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

Just one tiny thing

client/js/store/core/initStore.js Outdated Show resolved Hide resolved
@hwiem hwiem requested a review from salisdemos December 6, 2023 11:01
the corresponding feature branch in demosplan-ui (f_T19759_update_vue_deps)
has been merged into the integration branch
@hwiem hwiem merged commit 663b356 into f_vue3_compat_mode_setup Dec 6, 2023
4 of 6 checks passed
@hwiem hwiem deleted the f_T19759_vuex_update branch December 6, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:frontend PRs that are missing review(s) from a FE perspective
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants