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

feat: add support of arbitrary mounting point via attachTo option #1492

Merged
merged 1 commit into from
Apr 10, 2020

Conversation

jnields
Copy link
Contributor

@jnields jnields commented Mar 30, 2020

This allows for users to specify where in the document their component should attach, either through
a CSS selector string or a provided HTMLElement. This option is passed through directly to the
vm.$mount method that is called as part of mount.js

feat #1487

This enables testing of SSR code with Vue test utils as well as enables rendering of applications via Vue test utils in contexts that aren't 100% Vue

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@jnields
Copy link
Contributor Author

jnields commented Mar 30, 2020

I added in a message that attachToDocument would be deprecated in the future. Let me know if you'd like me to remove it or update any messaging.

I also didn't add any checks to see if both attachTo and attachToDocument were provided. I can add such a check and messaging for that if you think it's necessary.

Also happy to help with any documentation updates that might be required. Please let me know.

Thanks!

jnields added a commit to jnields/vue-test-utils that referenced this pull request Mar 30, 2020
This allows for users to specify where in the document their component should attach, either through
a CSS selector string or a provided HTMLElement. This option is passed through directly to the
vm.$mount method that is called as part of mount.js. This enables testing of SSR code with Vue test
utils as well as rendering of applications via Vue test utiles in contexts that aren't 100% Vue

fixes vuejs#1492
jnields added a commit to jnields/vue-test-utils that referenced this pull request Mar 30, 2020
This allows for users to specify where in the document their component should attach, either through
a CSS selector string or a provided HTMLElement. This option is passed through directly to the
vm.$mount method that is called as part of mount.js. This enables testing of SSR code with Vue test
utils as well as rendering of applications via Vue test utiles in contexts that aren't 100% Vue

fixes vuejs#1492
@lmiller1990
Copy link
Member

Hi! Thanks for the PR.

Seems reasonable. Happy to merge this... but can you please update the docs to include this? Otherwise no-one will be able to use this new feature!

@lmiller1990 lmiller1990 mentioned this pull request Apr 3, 2020
13 tasks
@lmiller1990
Copy link
Member

@jnields do you think you will have some time to update the docs by any chance? Going to do a 1.0 release pretty soon - would be good to get this in.

jnields added a commit to jnields/vue-test-utils that referenced this pull request Apr 9, 2020
This allows for users to specify where in the document their component
should attach, either through a CSS selector string or a provided
HTMLElement. This option is passed through directly to the vm.$mount
method that is called as part of mount.js. This enables testing of SSR
code with Vue test utils as well as rendering of applications via
vue-test-utils in contexts that aren't entirely Vue

fixes vuejs#1492
@jnields
Copy link
Contributor Author

jnields commented Apr 9, 2020

@lmiller1990 awesome, thank you! I pushed up some doc updates in English.

This allows for users to specify where in the document their component
should attach, either through a CSS selector string or a provided
HTMLElement. This option is passed through directly to the vm.$mount
method that is called as part of mount.js. This enables testing of SSR
code with Vue test utils as well as rendering of applications via
vue-test-utils in contexts that aren't entirely Vue

fixes vuejs#1492
@lmiller1990
Copy link
Member

Looks good. This will go out with 1.0. We are finalizing the API. Aiming to have something out within a month.

@lmiller1990 lmiller1990 self-requested a review April 10, 2020 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants