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 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 jnields force-pushed the jnields:dev branch from b0ab584 to 58143a3 Mar 30, 2020
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 jnields force-pushed the jnields:dev branch from 58143a3 to dbb715a Mar 30, 2020
@lmiller1990
Copy link
Member

@lmiller1990 lmiller1990 commented Apr 3, 2020

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
10 of 13 tasks complete
@lmiller1990
Copy link
Member

@lmiller1990 lmiller1990 commented Apr 8, 2020

@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 jnields force-pushed the jnields:dev branch from dbb715a to 80275fa Apr 9, 2020
@jnields
Copy link
Contributor Author

@jnields 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 #1492
@jnields jnields force-pushed the jnields:dev branch from 80275fa to 2713161 Apr 9, 2020
@lmiller1990
Copy link
Member

@lmiller1990 lmiller1990 commented Apr 10, 2020

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 Apr 10, 2020
@lmiller1990 lmiller1990 merged commit f3d0d3f into vuejs:dev Apr 10, 2020
6 checks passed
6 checks passed
ci/circleci: bootstrap Your tests passed on CircleCI!
Details
ci/circleci: build_test Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test_compat Your tests passed on CircleCI!
Details
deploy/netlify Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.