Live data from Hacker News

React v0.13.0 Beta 1

facebook.github.io

11–20 of 77 posts

Re: React v0.13.0 Beta 1

#11
post #2

Nice! I think that if you use vanilla JS (even ES6), the class support adds more hassle than the gains it provides. For example, setting proptypes completely at the bottom of the file seems, well, cumbersome. It's a bit like putting a function signature after the function body. From that perspective, using the old React.createClass syntax seems to keep everything together a bit nicer. However, if you want to use e.g.…

Maybe off topic but I've been wondering whether many people are finding spending time on TS worthwhile? Given the improvements in ES6, the fact that the JS community in general is so active, and the fact that I've seen some truly awful TS code (mainly where the devs want to pretend the web doesn't exist) I've been put off exploring TS too far much (beyond looking at the basic language features). I'm not sure if I sho…

The 'Type' in TypeScript.

Re: React v0.13.0 Beta 1

#13
post #3

I'm a bit scared of what will replace mixins. I've worked with C++ code bases where inheritance went crazy, and also with C++ code bases where composition via components was well supported and somewhat enforced. I'd love to see ES building in some kind of default support for composition with components if mixins are out. See also how Unity3D does it: http://docs.unity3d.com/Manual/UsingComponents.html I'm very happy…

Yeah it sounds like React's Components could be similar to Unity3D's GameObjects and the replacement for mixins could be similar to Unity3D's Components.

E.g. implementation: SubComponent (or something named better), a component can add the subcomponents to itself on initialization, and the lifecycle events can be similar to the Unity3D's SendMessage, i.e. similar to mixins. I think it would work quite well!

You would need to get the child subcomponent specifically e.g. get the timer subcomponent to create a timer, but as a bonus the subcomponent would not edit the instance of the component, feels cleaner TBH. Also two subcomponents can have the same this.field or this.property, or this.func without worrying about whether it belongs to the Component, another mixin, or something else :D

Re: React v0.13.0 Beta 1

#14
post #2

Nice! I think that if you use vanilla JS (even ES6), the class support adds more hassle than the gains it provides. For example, setting proptypes completely at the bottom of the file seems, well, cumbersome. It's a bit like putting a function signature after the function body. From that perspective, using the old React.createClass syntax seems to keep everything together a bit nicer. However, if you want to use e.g.…

Similarly, I'm looking for a way to use react with HAML. I just can't give it up, I have absolutely no interest in closing my tags ever again. One of the things I like about angular is how it deals with standard HTML. HAML doesn't care about its wacky attributes. Whats the best way to achieve this with react? Does the JSX compiler have hooks for preprocessing of any kind?

I am assuming you could use coffeescript as well?

Re: React v0.13.0 Beta 1

#15
I'm actually looking for a system that allows me to write Javascript code in the normal imperative way, and automatically makes it reactive.

So, for example, calling a function f(a, b) is first done normally, and then, when e.g. "b" changes value, the function f(a, b) is re-evaluated incrementally. Note that this means that not simply f is invoked again, but that f is recursively re-evaluated.

Anybody here aware of such a system?

I know there is research in this area ([1]). I would really like to use such a system in Javascript.

[1] http://www.umut-acar.org/publications-by-topic#TOC-Self-Adju...

Re: React v0.13.0 Beta 1

#16
post #15

I'm actually looking for a system that allows me to write Javascript code in the normal imperative way, and automatically makes it reactive. So, for example, calling a function f(a, b) is first done normally, and then, when e.g. "b" changes value, the function f(a, b) is re-evaluated incrementally. Note that this means that not simply f is invoked again, but that f is recursively re-evaluated. Anybody here aware of s…

That sounds like another language, or some sort of javascript processor that would wrap all functions and variables with magic... I haven't personally heard of anything like that, and can imagine lots of drawbacks (mostly about memory) for it.

Re: React v0.13.0 Beta 1

#17
post #15

I'm actually looking for a system that allows me to write Javascript code in the normal imperative way, and automatically makes it reactive. So, for example, calling a function f(a, b) is first done normally, and then, when e.g. "b" changes value, the function f(a, b) is re-evaluated incrementally. Note that this means that not simply f is invoked again, but that f is recursively re-evaluated. Anybody here aware of s…

I think what you are looking for is called auto-lifting. That is, automatically lifting functions into reactive streams.

While it sounds like an awesome idea, things get crazy really fast. It's hard to explain briefly, but make it explicit and clear to the programmer which things are reactive streams and which are simply values makes it much easier to predict what the program is doing.

Re: React v0.13.0 Beta 1

#18

Earlier quoted context omitted.

Maybe off topic but I've been wondering whether many people are finding spending time on TS worthwhile? Given the improvements in ES6, the fact that the JS community in general is so active, and the fact that I've seen some truly awful TS code (mainly where the devs want to pretend the web doesn't exist) I've been put off exploring TS too far much (beyond looking at the basic language features). I'm not sure if I sho…

The 'Type' in TypeScript.

?

Re: React v0.13.0 Beta 1

#19
Hmm. Feels like big changes too early. While it is more idiomatic, i can't see any substantial gains here. Simply looks like more work to me until es7. Especially binding each method manually, That shit's wack! And im actually kinda scared to see OOP features being embraced so quickly. Hopefully a changelog could ease my mind.

Re: React v0.13.0 Beta 1

#20
post #2

Nice! I think that if you use vanilla JS (even ES6), the class support adds more hassle than the gains it provides. For example, setting proptypes completely at the bottom of the file seems, well, cumbersome. It's a bit like putting a function signature after the function body. From that perspective, using the old React.createClass syntax seems to keep everything together a bit nicer. However, if you want to use e.g.…

Similarly, I'm looking for a way to use react with HAML. I just can't give it up, I have absolutely no interest in closing my tags ever again. One of the things I like about angular is how it deals with standard HTML. HAML doesn't care about its wacky attributes. Whats the best way to achieve this with react? Does the JSX compiler have hooks for preprocessing of any kind?

Not what you're looking for exactly, but you could settle for using Jade? https://github.com/duncanbeevers/jade-react
Post reply on HN