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

fix(compiler-core): assert the component tag correctly #3508

Merged
merged 2 commits into from
Mar 29, 2021
Merged

fix(compiler-core): assert the component tag correctly #3508

merged 2 commits into from
Mar 29, 2021

Conversation

HcySunYang
Copy link
Member

Fix: #3507

@HcySunYang HcySunYang added 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. need test The PR has missing test cases. labels Mar 29, 2021
@@ -672,3 +673,7 @@ function stringifyDynamicPropNames(props: string[]): string {
}
return propsNamesString + `]`
}

function isComponentTag(tag: string) {
return tag[0].toLowerCase() + tag.slice(1) === 'component'
Copy link
Member

Choose a reason for hiding this comment

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

isn't it faster to do a check like

Suggested change
return tag[0].toLowerCase() + tag.slice(1) === 'component'
return tag === 'component' || tag === 'Component'

Since it's the compiler, I think it makes more sense. Size-wise it should be pretty much the same

@@ -836,6 +836,24 @@ describe('compiler: element transform', () => {
})
})

test('capitalized version w/ static binding', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just write the whole word 😆

Suggested change
test('capitalized version w/ static binding', () => {
test('capitalized version with static binding', () => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. need test The PR has missing test cases.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic component with pascalcase not working correctly
3 participants