90 karma · joined September 8, 2012
const MyRootComponent = (props) => {
When it's shorter and more obvious what's happening if you write them like this: function MyRootComponent(props) {For what it's worth, all of the Git functionality in Visual Studio uses libgit2.
ES6 classes aren't "classic OOP", they're syntax sugar for regular prototypal inheritance that JavaScript has had forever.
> Any client-side routes will need to be mirrored on the server if you want isomorphism. This means you're using two routers.
A while back I worked on a library called [RouteJs](http://dan.cx/projects/routejs) that would expose certain ASP.NET MVC routes to JavaScript. The use case here was to have a way to build URLs client-side rather than hard-coding them (similar to the `Url.Action` helper in Razor) but a similar technique could be used to do client-side routing. That's actually a really good feature request for RouteJs :)
> The next issue is that most of the examples out there are simplistic. They will show a simple page with one component embedded that swaps out a part of the view.
Yeah, that's true. I have one page using server-side rendering in production, and it's a page on my site/blog: http://dan.cx/socialfeed.htm. It's also a simple page but I used it for building the original proof-of-concept for server-side rendering. I haven't actually tried using ReactJS.NET to build a single-page app, but I think that would be an interesting use case.
It'd probably be worth having a barebones starter kit though.
You could use a common PHP framework like FuelPHP, Laravel or Kohana. I'm not sure which frameworks are 100% compatible with HHVM, but I think they're all getting quite close to 100% (or may even be at 100% with the 3.0 release). It's fine to mix PHP and Hack in the one project, so you could use a PHP framework and use Hack just for your code.
- Collection classes like Vector (which is like an array in every other programming language ever) and Map (associative array or hashtable)
- Generics
- Lambda functions
- Asynchronous functions
- Type hinting for intrinsic types (int, string, bool)
Not much public documentation yet, but most bits are in the open source HHVM release, and there are a few blog posts on it (eg. http://www.sitepoint.com/hhvm-hack-part-1/)
At my previous workplace we were converting a classic ASP + ASP.NET Web Forms app to MVC. I really love MVC but I did like the component encapsulation in web forms.
$foo = 'bar';
echo $foo->length(); // 3
echo strlen($foo); // 3
This would get rid of a lot of the confusion around string function names.Another idea once you're reasonably comfortable and have done a smoke test is to direct a small amount of your traffic/users (say 1%) to the HHVM version, while closely monitoring its error log.