Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
vjeux
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
30 ms
·
271.
▲
by
vjeux
12y ago
Jest[1], the JavaScript testing framework used at Facebook attempts to lessen two of the mentionned impacts of TDD > TDD works best with fast tests and rapid feedback. In search of speed, some people use mocks in a way that locks their p
272.
▲
by
vjeux
12y ago
Mock functions are a really powerful tool. They let you test asynchronous functions in an entirely synchronous way. Because of that, Jest doesn't need to provide special support for asynchronous testing http://facebook.githu
273.
▲
by
vjeux
12y ago
We're not using CoffeeScript inside of Facebook. But we are using many ES6 features that make JS look a lot like CoffeeScript such as classes, arrow functions, rest arguments, destructuring assignment ... I figured that CoffeeScript wo
274.
▲
by
vjeux
12y ago
Jasmine provides you with the testing primitives such as describe(), it(), expect(value).toEqual(other): http://facebook.github.io/jest/docs/api.html#globally-inject... Jest adds multiple layers on-top: - A mock l
275.
▲
Jest – Painless JavaScript Testing
(facebook.github.io)
168 points
by
vjeux
12y ago
|
51 comments
276.
▲
by
vjeux
12y ago
While the basic idea of rendering to a virtual DOM is simple, making it work well for large applications require a lot more than a toy implementation as described in the article. In order to get adopted, React needs to coexist with existing
277.
▲
by
vjeux
12y ago
React has been designed to work in Facebook's codebase, to build large features worked on by many experienced developers. The fact that it is intuitive for beginners is a side-effect, not the primary objective.
278.
▲
by
vjeux
12y ago
@wingspan: Facebook's runs the exact same code as the open source version, but on master.
279.
▲
by
vjeux
12y ago
This is based on the Ray Tracer I worked on for a school project. Here's the technical report if you are interested :) http://blog.vjeux.com/2012/javascript/javascript-ray-tracer....
280.
▲
by
vjeux
12y ago
Kent Beck response: https://www.facebook.com/notes/kent-beck/rip-tdd/75084019494...
281.
▲
by
vjeux
13y ago
If your model is a list of enums where you know all the possible values, you can use SmallHash which encodes to the smallest possible string. http://blog.vjeux.com/2009/javascript/smallhash-information-...
282.
▲
by
vjeux
13y ago
If you use any renderer outside of the DOM then you need to implement your own layout engine. It means that you've got to figure out for each node that you output its left, top, width, height. CSS has its flaws but makes 95% of the use
283.
▲
by
vjeux
13y ago
map.validateExactlyXManyObjects = function() {}; lets you put an exit tile next to your character on every level
284.
▲
Hack is to PHP what ES6 is to JavaScript
(blog.vjeux.com)
10 points
by
vjeux
13y ago
|
0 comments
285.
▲
by
vjeux
13y ago
My bad :x JSFiddle is unusable on mobile and I assumed it was using shouldComponentUpdate. Anyway, the conclusion still holds, you can refactor your code to be performant while keeping in the React paradigm. You have a lot less control over
286.
▲
by
vjeux
13y ago
If you use `shouldComponentUpdate`, then React outperforms Blaze on the circle benchmark for both single and large number of updates. See Andrey Popp JSFiddles: https://groups.google.com/forum/#!topic/meteor-core&#
287.
▲
by
vjeux
13y ago
XSS works because the browser uses "eval" for some attributes, for example <img src="x" onerror="alert(1)">. React never uses eval internally so this class of attacks cannot happen on the server. In order
288.
▲
by
vjeux
13y ago
> I would imagine it's possible to greate "progressive enhancement" stype React components, so that you'll yield virtual DOM for a plain input box, and somehow enhance it with a auto-complete JS. You can put initializ
289.
▲
by
vjeux
13y ago
To get a sense of scale, the largest DDoS ever recorded by Cloudflare is 400Gb/s[1]. Lookback video was 450Gb/s. [1] http://arstechnica.com/security/2014/02/biggest-ddos-ever-ai...
290.
▲
by
vjeux
13y ago
I'm a developer at Facebook I thought I'd share my experience. Before I joined, I wasn't really convinced by PHP. My experience using it was good for quick and dirty work but quickly resulted in a mess. However, the Facebook
291.
▲
by
vjeux
13y ago
I wrote a similar article 3 years ago, it's impressive how many arguments we have in common. http://blog.vjeux.com/2011/analysis/start-a-technical-blog-i...
292.
▲
by
vjeux
13y ago
At a first glance, this seems like Angular's digest loop. Can someone make a more elaborate comparison for people that know nothing about iOS?
293.
▲
by
vjeux
13y ago
Flexbox is actually very good and works on all the mobile browsers today and most desktop browsers if you ignore old IE.
294.
▲
Apple Removes Shadow DOM from Safari
(trac.webkit.org)
90 points
by
vjeux
13y ago
|
67 comments
295.
▲
by
vjeux
13y ago
Removing event management from React core is a common request but it wouldn't really be a wise decision. 1. Need a way to manage events: All the applications are handling events in one way or another. So you've got to have a way t
296.
▲
by
vjeux
13y ago
You can also use a more lispy way to write React code in CoffeeScript {div, h3, textarea} = React.DOM (div {className: 'MarkdownEditor'}, [ (h3 {}, 'Input'), (textarea {onKeyUp: @handleKeyUp, ref: &
297.
▲
by
vjeux
13y ago
Pro-tip: if you express your layout as a tree composed of horizontal split, vertical split and images then you can come up with a general linear system of equations that you can feed to any solver (basically just inverting a matrix) to get
298.
▲
by
vjeux
13y ago
You should be careful when adding translateZ. If you go beyond the GPU memory it's going to be extremely slow and has high chances of crashing the app.
299.
▲
by
vjeux
13y ago
The biggest cause of bugs before we used React is the fact that the "state" of the app is leaking all over the place. Symptoms were things like looking for dom nodes that didn't exist, events that triggered on code that was n
300.
▲
by
vjeux
13y ago
See a working example: http://jsfiddle.net/spicyj/3tn45/
More ›