Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

#16, #17, #19 and #20 - Remove portals, use native element constructors, support custom events and upgrade to use semantic-release / commitizen. #18

Merged
merged 15 commits into from
Jun 21, 2016

Conversation

treshugart
Copy link
Contributor

@treshugart treshugart commented Jun 20, 2016

Implements #16, #17, #19 and #20. Bulk of the review src/index.js. It was simpler to do all of these at once since it was a major overhaul to the only file in this repo. The rest of the files were changed / added / removed from re-initialising from the updated build.

This PR also removes the old tests and adds new ones in their place as the old tests were tested against Skate and the portals method. Since we've generalised the wrapper and removed portal support, these tests were no longer relevant.

@treshugart treshugart changed the title #16, #17 - Remove portals and use native element constructors #16, #17, #19 and #20 - Remove portals and use native element constructors Jun 20, 2016
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) {year} {author}
Copyright (c) Trey Shugart <treshugart@gmail.com> 2016
Copy link
Member

Choose a reason for hiding this comment

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

This is flipped now, probably won't matter though :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting. That's a bit odd. I didn't touch the LICENSE template or file manually.

@joscha
Copy link
Member

joscha commented Jun 21, 2016

LGTM, however I think it would be beneficial to read the config files (webpack, karma, saucelabs) from skatejs-build like we do in named-slots if possible.

@treshugart
Copy link
Contributor Author

Re the config files, I agree and that's been done. Originally I wanted to do this but it got lost in the midst of doing other fixes. Waiting for the build to re-release now.

@@ -0,0 +1,3 @@
describe('skatejs-react-integration', () => {

Choose a reason for hiding this comment

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

I love this huge test :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, wrote it myself ;)

@lukebatchelor
Copy link

LGTM 👍


// Listen for custom element changes and cancel them to make a stateless component
this._realCustomElement.addEventListener('property-change', function (e) {
if (props.handlePropertyChange) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There was some behaviour before where if you passed a handlePropertyChange prop, it'd cancel all state change events and give that data back to React. Is there an equivalent now?

Copy link
Contributor Author

@treshugart treshugart Jun 21, 2016

Choose a reason for hiding this comment

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

I ended up keeping it and writing tests for it. In doing so, I realised all it's really doing is automating the binding to the prop-change event and calling e.preventDefault(). Now that we support custom events, all you have to do is simply bind to the event and call e.preventDefault() yourself. Removing it prevents us from having to maintain and test this behaviour. We'd also want to allow customisation of the event name and prop handler name. Now all you need to do is:

<Component onPropChange={e => e.preventDefault()} />

...if propchange was emitted when a property changes.

@treshugart treshugart changed the title #16, #17, #19 and #20 - Remove portals and use native element constructors #16, #17, #19 and #20 - Remove portals, use native element constructors, support custom events and upgrade to use semantic-release / commitizen. Jun 21, 2016
@jpnelson
Copy link
Contributor

LGTM. This should also fix #11

@treshugart
Copy link
Contributor Author

I'll update #11 to remind us to write a test for it.

@treshugart treshugart merged commit 3227e19 into master Jun 21, 2016
@treshugart treshugart deleted the 16-17 branch June 21, 2016 06:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants