Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
insin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
45 ms
·
541.
▲
by
insin
12y ago
Or you could use Lo-Dash and require() the specific functions you actually used instead of the whole thing, after you're done: https://www.npmjs.com/browse/keyword/lodash-modularized It's nice to have th
542.
▲
by
insin
12y ago
This blog post - "JSX: E4X The Good Parts" - covers what's in and out for JSX: http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts...
543.
▲
by
insin
12y ago
NaN is passed to Array.prototype.join() as the separator to join strings with, so it gets coerced to String ("NaN"). It's deliberately working backward from the behaviour of Array.prototype.join() to create a contrived exampl
544.
▲
by
insin
12y ago
It can be! That's one of the the benefits of the isomorphic approach - for the bits you want to use it in, it should degrade to regular forms 'n links round-tripping.
545.
▲
by
insin
12y ago
The fact that componentDidMount only gets called on the client seems like it would make it a good place to hook up progressive enhancement after rendering a basic isomorphic version on the server (e.g. a <select multiple> which you en
546.
▲
by
insin
12y ago
The form example can be written this way to avoid having to register onChange on every field (within the same form): <form onChange={this.inputHandler}> ... <input type="text" name="blah" value
547.
▲
by
insin
12y ago
The visualisation of live upvotes is nice, how did you handle that state-wise in React? I also have comment counts and whatever data is used to dim downvoted comments on my API wishlist ( my own implementation is http://insin.git
548.
▲
by
insin
12y ago
> Here’s a lovely bit of irony for you: Adblock Plus... is actually increasing the amount of memory used by your web browser, rather than decreasing it It’s like ten thousand spoons when all you need is a knife.
549.
▲
Show HN: React and react-router: forms which work without client-side JavaScript
(isomorphic-lab.herokuapp.com)
4 points
by
insin
12y ago
|
0 comments
550.
▲
by
insin
12y ago
The important part for making it isomorphic is the data flow - you could use any component which can populate its form fields and error messages from props on initial render. The express middleware [1] which uses your react-router routes ju
551.
▲
by
insin
12y ago
I have form submission and redisplay with and without JavaScript on the client working with my React forms library (newforms) and react-router. The server version funnels POST bodies through the same willTransitionTo hook that the client us
552.
▲
by
insin
12y ago
> And documentation! The code does not support javadoc, and in fact, there are only two comments in the entirety of the nearly 1500 line code base! This is just _so_ non-compliant with Best Practices that it reveals itself too easily as
553.
▲
Don't React
(staltz.com)
2 points
by
insin
12y ago
|
2 comments
554.
▲
by
insin
12y ago
That's effectively what React Bootstrap [1] is. I'm wondering if there's a nice way to make a factory-like version of something similar which takes DSL definitions and generates the necessary components for you to use in a sa
555.
▲
by
insin
12y ago
Here's mine: https://github.com/insin/greasemonkey/blob/master/hncommentt... In addition to collapsing, it highlights new comments and shows how many new comments there are on story list pages since
556.
▲
by
insin
12y ago
Was coming here to say the same earlier, but I liked it so much I've now hacked together a sweet DSL to use it with my React form library. Rendering demo: http://insin.github.io/newforms-gridforms/ DSL example: h
557.
▲
ES6 Modules, AMD and CommonJS
(medium.com)
3 points
by
insin
12y ago
|
0 comments
558.
▲
by
insin
12y ago
https://github.com/rpflorence/react-training/blob/gh-pages/l...
559.
▲
by
insin
12y ago
Alternatively, here's Adam Bien's (JSON) version of Hello World with JEE: https://www.youtube.com/watch?v=zESNqWcY0pY
560.
▲
by
insin
12y ago
I found it almost a necessity when I started generating larger DOM trees in JavaScript. No more games of hunt-the-missing-comma-on-the-ragged-edge: https://gist.github.com/insin/8e72bed793772d82ca8d (These syntax woes
561.
▲
by
insin
12y ago
Try going sideways once things get too nested for callbacks not to be arduous: https://github.com/rpflorence/react-training/blob/gh-pages/l... Another option (albeit currently an undocumented one) is to
562.
▲
by
insin
12y ago
Add new String(...) and new Boolean(...) to the is-(boolean|object|string) test cases for surprising fun, OP, then check out Object.prototype.toString.call(...).
563.
▲
React: CSS in JS
(speakerdeck.com)
33 points
by
insin
12y ago
|
7 comments
564.
▲
by
insin
12y ago
Argument From Cranky Authority (Whose Lawn You Are On)
565.
▲
by
insin
12y ago
If that's Backbone's extend, that can be fixed: http://bl.ocks.org/insin/raw/db5f79d7d97ee6200245/
566.
▲
by
insin
12y ago
The pattern didn't break subclassing there, your code did by not continuing the pattern and then not using new :) Personally, I only use this pattern for cases where it's more convenient not to have to use new (e.g. building decla
567.
▲
by
insin
12y ago
It doesn't update the underlying object for you by default. If you use an uncontrolled component (by giving it a defaultValue/defaultChecked prop) you have to pick up the new value using an event or directly via the DOM. If you do
568.
▲
by
insin
12y ago
It still takes me a few beats from thinking "I need a flexible grid layout here" to remembering I can just use display:table, having spent so many years discounting it off-hand because of Internet Explorer.
569.
▲
Be progressive
(adactio.com)
2 points
by
insin
12y ago
|
2 comments
570.
▲
by
insin
12y ago
> but nested or complex HTML must get ugly fast That's the problem JSX solves - nesting tags and attributes is less syntactically onerous than managing a tree of function calls or nested object structures, with their attendant brace
More ›