-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bugfix/enable built in element extension #642
Conversation
@@ -28,6 +27,88 @@ | |||
"include": [ | |||
"NODE_ENV" | |||
] | |||
}], | |||
["babel-plugin-transform-builtin-classes", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This awesome plugin is key to make it work
https://github.com/WebReflection/babel-plugin-transform-builtin-classes
Please Lets make a concrete test in this PR:
I would merge it in this PR and when approved, make a update date and communicate it on slack. For example: "Please note, we are closing our first stable release. We realised that we cannot live anymore without supporting Custom Element Builtins. Therefore we will do Breaking change merge friday the XX.YY.KKKK". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me ready to merge when a release plan is created, one component already done in the example and that component used in pattern-library-examples. We also have to communicate to all other developers to swap their polyfill
4187d62
to
3d99a5d
Compare
@LucaMele
PS: |
let me know when everything is done and i will review :) also dont forget the table implementation |
I will pay you a hot chocolate or capuccino with lots of milk for this one! Thank u man! |
d349969
to
b6a4649
Compare
.eslintrc
Outdated
@@ -25,11 +25,87 @@ | |||
}] | |||
}, | |||
"globals": { | |||
"HTMLAllCollection": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LucaMele
We should double check which native constructors we really need.
I would argue that all HTML*Element
constructors are sufficient.
src/js/with-react.js
Outdated
@@ -52,8 +52,8 @@ const withReact = (WebComponent, { pure = true, passive = false } = {}) => { | |||
// hence it's tagName could only be resolved lazily | |||
// ref: https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry | |||
// therefor we don't instantiate it, but rather use a statically defined tagName property | |||
const { tagName } = WebComponent; | |||
const displayName = `${camelize(tagName)}React`; | |||
const { tagName, buildinTagName } = WebComponent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to support custom builtin elements with react
|
||
const mapElement = { | ||
a: 'ATOM📗', | ||
m: 'MOLECULE📘', | ||
o: 'ORGANISM📙', | ||
}; | ||
|
||
const getNativeElementConstructor = (tag) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge list, maybe we put it into a separate file 💣
@@ -268,29 +467,76 @@ const createBoilerplate = (_name) => { | |||
} | |||
}; | |||
|
|||
// @todo: this should be a clean state machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really key, may it could be made cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LucaMele
I added upgrades for create AMO script and withReact
43457ec
to
3e7015e
Compare
d29e1d2
to
d5589b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go for it man!
Please communicate the breaking changes and the new API ( |
Fixes #607 .
Blocked by #649 #639 choojs/nanohtml#136
Changes proposed in this pull request:
withReact
to support extended builtin elementsType of change
How Has This Been Tested?
Checklist: