Mercateo / component-check

A quick introduction to exploring how components can be created in several frameworks.
Apache License 2.0
465 stars 27 forks source link

Incorrect Cycle.js #1

Closed Frikki closed 8 years ago

Frikki commented 8 years ago

The Cycle.js example under Interactive components is not up to date. While in the past it was true that we could use cuid() for generating a unique ID for a component, today we should use isolate() https://github.com/cyclejs/isolate. The same holds true for the Composable components section.

Also, while you can use JSX with Cycle.js, it is not the recommendation. Instead, Cycle.js recommends using hyperscript-helpers.

foxdonut commented 8 years ago

Nowhere in the article is it recommended to use JSX with Cycle.js. In fact, I find that @donaldpipowitch went out of his way to clearly indicate that he is not making a recommendation, that it is a matter of personal taste, and that it is not a requirement. I understand that some Cycle.js users really dislike JSX; voice your opinion but I think if some people prefer to use JSX with Cycle.js nevertheless, understand that they have their reasons for choosing. Being able to use JSX with Cycle.js is appealing to some users.

donaldpipowitch commented 8 years ago

@Frikki Is isolate stable now? I have mentioned it at the beginning as a new feature coming soon, but the last time I checked the docs didn't mention isolate.

Regarding JSX - what @foxdonut said. I don't want to make a recommendation for any side, but if you like I can highlight that JSX is way more untypical in the Cycle community compared to the React/Redux community in an additional paragraph.

Frikki commented 8 years ago

@foxdonut I never implied that @donaldpipowitch recommended JSX with Cycle.js. I simply noticed the use of it in the examples. Cycle.js does recommend using hyperscript helpers, but offers the option to use JSX for those who favor that. This is, by the way, not my opinion, but how it is.

@donaldpipowitch Yes, the isolate function is stable. However, it is not all drivers that support it, yet. And true, if you want to use it with the DOM driver, you need to use the release candidates. It is, however, only a matter of a couple of days when the official release will be out. So I’ll leave the choice to you what you recommend in your brilliant write-up.

foxdonut commented 8 years ago

@Frikki fair enough. Call it a misunderstanding. I still stand by my statement that @donaldpipowitch does an excellent job of explaining the use of JSX in the examples. If some readers just look at the code and draw conclusions without reading the article, it's not the author's fault.

donaldpipowitch commented 8 years ago

@Frikki Are hyperscript-helpers actually still needed with the newest @cycle/dom version? It looks like helper are now included by default (https://github.com/Mercateo/component-check/blob/master/examples/static-components/cyclejs/src/static-component/index.js#L1). I'd like to add another paragraph about this topic.

Frikki commented 8 years ago

@donaldpipowitch hyperscript helper functions are available through the DOM driver, just as the hyperscript function still is.

Example:

import {div, a, button, span} from '@cycle/dom'
donaldpipowitch commented 8 years ago

@staltz fixed the examples so they use isolate. I added a new paragraph to explicitly tell that hyperscript helpers are the recommendation for Cycle.

This issue should be fixed now.

staltz commented 8 years ago

Cool