-
Notifications
You must be signed in to change notification settings - Fork 53
feat: Vue AFM bridge #854
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
feat: Vue AFM bridge #854
Conversation
|
|
Thank you very much for the contribution. I have been on vacation and traveling and will be able to take a look this week. I really appreciate your patience. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #854 +/- ##
==========================================
- Coverage 98.45% 96.73% -1.72%
==========================================
Files 8 9 +1
Lines 452 551 +99
==========================================
+ Hits 445 533 +88
- Misses 7 18 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
manzt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, thanks so much for the contribution! I'm not super familiar with the idiomatic Vue patterns so I really appreciate the thought that went into this. Tried it out and things worked really well.
I agree, we can try to sort out HMR in a separate PR!
|
Thanks again for the contribution! Released https://github.com/manzt/anywidget/releases/tag/%40anywidget%2Fvue%400.1.0 |
Hey, awesome project! 🎉
I wanted to create some custom widgets using Vue, and since you already have packages for React and Svelte, I decided to contribute the Vue binding code.
The API of the Vue binding is very similar to the @anywidget/react package. The major difference is that instead of returning a getter-setter pair from
useModelState, we return aShallowRefwhich can be mutated directly (eg.value++). This is more idiomatic to Vue's reactivity system.Current Status
I haven't figured out how to get HMR to work, so for now, you’ll need to restart the kernel for updated JS/CSS files to be picked up. If this can be addressed in a patch release, great! Otherwise, I’ll revisit it in a few days to troubleshoot further.
Demo
You can check out a demo of this package on the branch aryan02420:demo/vue-bridge.