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

Add unknown properties as attribute #72

Merged
merged 2 commits into from
Apr 10, 2018
Merged

Add unknown properties as attribute #72

merged 2 commits into from
Apr 10, 2018

Conversation

Jomik
Copy link
Member

@Jomik Jomik commented Apr 7, 2018

We need to set attributes from props.attrs & attributes in props before we set behaviors.
Simple way of doing it is looping over the keys in props, check against a list of known keywords, then reuse previous code.

@Jomik Jomik requested review from paldepind and limemloh April 7, 2018 08:46
@Jomik Jomik self-assigned this Apr 7, 2018
@codecov
Copy link

codecov bot commented Apr 7, 2018

Codecov Report

Merging #72 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted Files Coverage Δ
src/dom-builder.ts 100% <100%> (ø) ⬆️

Copy link
Member

@limemloh limemloh left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -243,13 +249,22 @@ function handleEntryClass(desc: string, elm: HTMLElement): void {
});
}

const propKeywords = ["style", "attrs", "props", "class", "actionDefinitions", "actions", "setters", "entry", "behaviors", "streams", "output"];
Copy link
Member

Choose a reason for hiding this comment

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

We could use a Set here. It should give better performance.

@Jomik Jomik requested a review from paldepind April 10, 2018 08:17
@paldepind paldepind merged commit c94d058 into master Apr 10, 2018
@paldepind paldepind deleted the feature-RootAttrs branch April 17, 2018 08:27
@paldepind paldepind mentioned this pull request Jul 19, 2018
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.

3 participants