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

[Bug]: Vue Editor no longer provides root app globals #5323

Closed
1 task done
renatodeleao opened this issue Jul 10, 2024 · 2 comments
Closed
1 task done

[Bug]: Vue Editor no longer provides root app globals #5323

renatodeleao opened this issue Jul 10, 2024 · 2 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@renatodeleao
Copy link

renatodeleao commented Jul 10, 2024

Affected Packages

@tiptap/vue-3

Version(s)

2.5.0-pre.14

Bug Description

A customised editor that renders some app ui vue components via extension. These components make use of some app context globals — these can be directives, properties, etc. By rendering them in the editor, they should still have access to the app's context as they had before (v2.4.0) — or have a way to provide it.

The reproduction example uses the documentation demo https://tiptap.dev/docs/editor/extensions/custom-extensions/node-views/vue and tweaks it to include an AppButton which accesses a global app property object — someGlobal.x

Browser Used

Chrome

Code Example URL

https://stackblitz.com/edit/vitejs-vite-nmhr7x?file=src%2FApp.vue

Expected Behavior

In the latest stable v2.4.0 the components render just fine and have access to the app context -> demo: https://stackblitz.com/edit/vitejs-vite-8gu77g?file=src%2FApp.vue

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@renatodeleao renatodeleao added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Jul 10, 2024
@renatodeleao renatodeleao changed the title [Bug]: VueNodeRender no longer resolves app globals [Bug]: Editor no longer provides root app globals Jul 10, 2024
@renatodeleao renatodeleao changed the title [Bug]: Editor no longer provides root app globals [Bug]: Vue Editor no longer provides root app globals Jul 10, 2024
@wagich
Copy link
Contributor

wagich commented Jul 10, 2024

I stumbled over the same problem, it seems that the fix should be to assign the editor's appContext to the constructed vNode before rendering.

I have this working locally with this change, but don't really know enough about Vue 3 and tiptap to know whether this is the right solution or not…

@nperez0111
Copy link
Contributor

This should be resolved with 2.5.5 which added back the perf updates for vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Done
Development

No branches or pull requests

3 participants