Skip to content

keep consistency in dev and prod env #4093

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 5 commits into from
Nov 4, 2016
Merged

keep consistency in dev and prod env #4093

merged 5 commits into from
Nov 4, 2016

Conversation

jingsam
Copy link
Contributor

@jingsam jingsam commented Nov 3, 2016

No description provided.

@yyx990803
Copy link
Member

Does this cause any problem in production?

@jingsam
Copy link
Contributor Author

jingsam commented Nov 3, 2016

Noop, I just thought that vue should have the same behaviour in development and production enviroment except extra warnings.

@jingsam
Copy link
Contributor Author

jingsam commented Nov 3, 2016

One more thing, I think this line of code should be deleted in Vue 2. In vue 1, name will be used as a function name, such as:
name='MyComponent' => function MyComponent () {this._init(options)}
However, in Vue 2, no matter what the name is, always use function VueComponent() {this._init(options)}

@yyx990803
Copy link
Member

@jingsam true, I think this PR can be changed to simply removing that line.

@jingsam
Copy link
Contributor Author

jingsam commented Nov 4, 2016

Ops, CI failed in this test:`

  it('when incorrect name given it should not contain itself in self components', () => {
    const vm = Vue.extend({
      name: 'Hyper*Vue'
    })

    expect(vm.options.components['Hyper*Vue']).toBeUndefined()

In fact, in Vue 2, there are no limitations on the name of components. Even invalid name can be registered. The only limitation is whether the virtual dom can parse the name tag into the corresponding component. For example, Hyper*Vue can be registered but <Hyper*Vue></Hyper*Vue> can not be parsed by virtual dom correctly. _HyperVue is an invalid name but it works, as <_HyperVue></_HyperVue> can be parsed.

@yyx990803 so, shall I delete that unit test case ?

@yyx990803
Copy link
Member

Yeah, I think that test case can be removed.

@yyx990803 yyx990803 merged commit c23c5c5 into vuejs:dev Nov 4, 2016
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