-
Notifications
You must be signed in to change notification settings - Fork 668
Suggestion: un-deprecate attachToDocument #1578
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
Comments
Hi! 👋 Thanks for bringing this up. While it is true that attaching to OTOH, it would be great to add this snippet in docs. Would you like to do so? 😄 |
Sure, I can do that. Thanks for considering.
…On Fri, Jun 12, 2020 at 6:42 PM Adrià Fontcuberta ***@***.***> wrote:
Hi! 👋 Thanks for bringing this up. While it is true that attaching to
document is probably the most common scenario, attachTo provides more
flexibility to cover other cases, so we'd want to stick with it.
OTOH, it would be great to add this snippet in docs. Would you like to do
so? 😄
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1578 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJGQP64SNLMWBW434HEHTTRWKVM5ANCNFSM4N4LX2MQ>
.
|
+1 to the undeprecation suggestion. What is the reason for all users to write 3 lines of boilerplate, if this can be an extra built-in option? What are the risks of having both |
+1 to the un-deprecation suggestion. |
Supporting both of these seems pretty reasonable. I think the original PR was to make it more robust, but we did not consider the additional boilerplate that would be introduced. I wonder if we can have the best of both worlds? mount(Foo, {
attachTo: someEl
})
// what about adding support for?
mount(Foo, {
attachTo: document
}) Thoughts? We get the best of both words, and it reads pretty nicely too. We could just check if value of the |
As far as I understand how Having a separate explicit method is preferred because it is more clear than the difference between |
I feel it might be hard for newcomers to understand the differences between That being said, if people feel the need to have this baked in, I'm okay with it 👍 as suggested right above, I'd keep it separate from |
Ok so we just re added the previous method back in? Should be easy. Would anyone like to take responsibility for this? |
I personally prefer having |
There are use cases for attaching to a specific element apparently (adding Vue into existing applications with pre-existing HTML...) |
In |
We should make the migration process as seamless as possible. I thikn we should port the above suggestion, and make |
Workflow test conversion, they pass. A few chatty bits to clean up. Make unit test galaxy object access quieter.
Workflow test conversion, they pass. A few chatty bits to clean up. Make unit test galaxy object access quieter.
Workflow test conversion, they pass. A few chatty bits to clean up. Make unit test galaxy object access quieter.
When using attachTo with document.body as a target do not replace original content of body but append a new div instead See vuejs#1578 for details and discussion
When using attachTo with document.body as a target do not replace original content of body but append a new div instead See vuejs#1578 for details and discussion
When using attachTo with document.body as a target do not replace original content of body but append a new div instead See vuejs#1578 for details and discussion
When using attachTo with document.body as a target do not replace original content of body but append a new div instead See #1578 for details and discussion
This was merged in #1699 and will go out in a few days. |
I feel the most common use case of
attachTo
is stillattachToDocument
, since that is necessary for testing any Vue code that utilizesdocument.querySelector
and similar methods, even if run in total isolation. By un-deprecating attachToDocument, we prevent developers who are new to the library from having to hunt for the following code.The text was updated successfully, but these errors were encountered: