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

fix(viewer): share Vue constructor from Viewer #5402

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Feb 20, 2024

📝 Summary

Briefly: <ViewerComponent> from Text is rendered in Viewer's so everything that it uses must use the same Vue constructor as Viewer. Otherwise, there is a mix of Viewer's Vue constructor and Text's one in a single Virtual DOM, which is not fully supported by Vue.

More details: nextcloud-libraries/nextcloud-vue#5267 (comment)

I don't know much about tiptap. Probably there is a cleaner way to provide Vue constructor to the plugin than using shared src/ViewerVue.js.

Also, the best to use this everywhere instead of import Vue from 'vue' in modules that can be used in Viewer.

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

Otherwise, there is a mix of Viewer's Vue constructor and Text's one in a single Virtual DOM,
which is not fully supported by Vue.

Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
@ShGKme ShGKme force-pushed the fix/sharing-viewers-vue-constructor branch from a1942e5 to 613c5d2 Compare February 20, 2024 23:14
Copy link
Member

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

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

Tested and works. Thanks for your help here @ShGKme

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks a lot for tackling this!

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dev console of main flooded with errors $attrs is readonly
3 participants