Hacker Newsnew | past | comments | ask | show | jobs | submit | more zpao's commentslogin

No, it skips the DOM entirely and works with native elements (iOS views) directly.


This is where I get confused. How is it compiling to these elements?


One possibility: You have a JS interpreter running your React code. You generate a virtual DOM and hand it off to React. React sends the virtual DOM through a message bus to native code. So far, nothing crazy here, this is how frameworks like cordova work. That native code dynamically translates the virtual DOM into native UI elements.


That's the million dollar question and tomorrow we might get an answer.


It is worth considering, but it's often worth finding out what the cure is before writing it off. You have to make the right tradeoffs (eg, when working on a tight deadline, it's probably not the right call to go off into the weeds finding out if you can make 3 lines of code into 1).


Maybe. We're still working on the details about what that will look like. Chances are we'll have some basic support if you're doing a limited set of things. Stay tuned.


Mostly what @BinaryBullet said. fb.me is a urlshortener and then it hits real CDNed files. I (as maintainer of React) suggest not actually using fb.me urls in production. Use cdnjs or jsdelivr. Or host it yourself. We've been meaning to put together a proper CDN hosting setup for JS libraries but just haven't gotten around to it.


Ok, thanks. That is what I am actually doing now (host it yourself). It might be nice to mention that in the documentation/article that those links shouldn't not be used on production. Currently it is definitely not the messaging that comes across. eg. "Minified build for production: http://fb.me/react-0.12.0.min.js"


Out of curiosity why don't you suggest using the fb.me urls in production? It would be nice to take advantage of the reach of Facebook to know that a decent percentage of users would have hit the CDN'ed react url before hitting non-fb site(s).


So long as you know the colors in [0] are all just the hardcoded CSS "standard" colors, then great :) There are some "awesome" ones there (papayawhip, lightgoldenrodyellow) and the history of how they came to be (via X11) is pretty interesting too.


AFAIK You're taxed on receiving stock as if it were income. This is regardless of if you sell it today, tomorrow, or never.

After that you're only taxed on gains. If you sold on the day of reception, then your gains/losses are likely minimal. Eg, receive at 50 sell at 50 = 0 gains/losses. Sell at 51 and you have $1*N gains. Those gains are taxed at a higher rate until a year after the stock appeared in your account. I think the difference is ~10% (35 vs 25 or so).

So there are definite tradeoffs between holding for the year vs selling immediately. This part is no different than buying/selling on the stock market.

tldr; yes, but not exactly


You could actually do this without a single change to the JSX transform, and instead just make a simple object that calls m() with the right params. Then you just change the @jsx pragma to point at that object. With a complete array of elements this should mostly work.

```js / @jsx m.dom */

function m(type, props, children) { // assuming m() looks something like this. return { type: type, props: props, children: children}; } m.render = function(lwDOM){ console.log(lwDOM)}; m.dom = {};

// React hard codes this array so we can do something like this to build the mapping ['a', 'span'].forEach((el) => { m.dom[el] = function(props, ...args) { return m.call(null, el, props, args); } });

m.render( <a href={"google.com"}> <span>hello</span> <span>world</span> </a> ); ```


Sorry to get your hopes up! I'll try to remember to make it a bit more obvious next time.


No, they aren't. Taking a look at the first one on the list... the latest version was published in 2011.


The trick is to use rawgithub.com (where you would otherwise see raw.github.com) - http://rawgithub.com/pinterest/cloudgrid/master/example/inde...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: