Skip to content

Global config and Global API reference #68

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

Merged
merged 18 commits into from
Apr 28, 2020
Merged

Conversation

NataliaTepluhina
Copy link
Member

@NataliaTepluhina NataliaTepluhina commented Apr 19, 2020

This PR adds two first parts to the API Reference

@NataliaTepluhina NataliaTepluhina self-assigned this Apr 19, 2020
@NataliaTepluhina NataliaTepluhina added content Issues / PRs related to docs content enhancement New feature or request labels Apr 19, 2020
@NataliaTepluhina NataliaTepluhina added this to the alpha milestone Apr 19, 2020
@NataliaTepluhina NataliaTepluhina linked an issue Apr 19, 2020 that may be closed by this pull request
@NataliaTepluhina NataliaTepluhina removed a link to an issue Apr 19, 2020
@NataliaTepluhina NataliaTepluhina changed the title [WIP]: Global config and Global API reference Global config and Global API reference Apr 25, 2020
@Jinjiang
Copy link
Member

I probably prefer the title "Application Config" and "Application API" respectively. Because in v3 it's possible to create more than one applications in the same page. So we could customize them separately. That's more like an application-level thing.

Copy link
Member

@Jinjiang Jinjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the config part.

Copy link
Member

@Jinjiang Jinjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the API part. Thanks.

app.component('my-component', { /* ... */ })

// retrieve a registered component (always return constructor)
const MyComponent = app.component('my-component', {})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const MyComponent = app.component('my-component', {})
const MyComponent = app.component('my-component')

Not sure this would work but I think there should be only one parameter for the getter mode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, if we skip the second parameter here, MyComponent will be undefined

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I forked your codesandbox demo and made some change to demo my idea: https://codesandbox.io/s/async-components-pbku4?file=/index.html
Seems it returns the registered component as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @NataliaTepluhina , not sure you have seen this. Is that helpful? I still think here it should be no second parameter for the getter. Thanks.

@NataliaTepluhina
Copy link
Member Author

Thank you so much for the thorough review @Jinjiang! I've applied all the suggestions besides app.component argument - you can check this sandbox - if we remove the second parameter, app.component will return undefined.

Could you please give this PR a second look? 🙏

Copy link
Member

@bencodezen bencodezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just left some phrasing suggestions, but thanks for starting to put this together! I imagine we'll have more ideas as time goes on, but I think it's good to go!

@NataliaTepluhina NataliaTepluhina merged commit 34ace5d into master Apr 28, 2020
@NataliaTepluhina NataliaTepluhina deleted the api-reference branch May 4, 2020 04:18
moHaHa pushed a commit to moHaHa/vuejs-docs that referenced this pull request May 4, 2023
Translate src/guide/components/provide-inject.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues / PRs related to docs content enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants