News for hackers. Stuff that matters.

amk_

Re:Learn React by building a web app on Wednesday April 11, 2018 @02:53PM (#16814255)
Extracted boilerplate from some of my libs:

https://github.com/alexkrolick/react-lib-quickstart

Want to port this to a CLI eventually, too

Re:As Discord nears 100M users, safety concerns are heard on Friday December 08, 2017 @01:34AM (#15877079)
IMO its origins in the gaming community, and all the moderation features that grew out of it, make Discord a much better fit for open source communities than Slack. For example:

- Individuals can block and report other users

- There are tiered mod levels

- Per-community pseudonyms, but a single account makes it easier to track bad actors

Markdown support, including syntax highlighting, is actually better in Discord than Slack already, too.

If you haven't checked out an OSS community on Discord yet here are a few:

- https://www.reactiflux.com/

- https://chat.vuejs.org

- https://discord.gg/reasonml

Re:Nightcoders.net – A Cloud IDE for Clojure on Monday December 04, 2017 @12:09AM (#15841586)
A framework like Phoenix would be awesome. Even something more lightweight (Express-like) would be pretty handy. Clojurescript front-end, Clojure backend...
Re:Simple React Patterns on Friday November 10, 2017 @02:00PM (#15672064)
CSS-in-JS libs like https://emotion.sh make "micro-componentization" even easier - pretty much every raw DOM element can be replaced by a domain-relevant/ui-relevant component type. Then if you need to add something beyond styles like state or complex render logic, the consumers don't even know about it because the reference is the same.
Re:Show HN: Server.js – A modern Express alternative on Saturday November 04, 2017 @04:05PM (#15626650)
Fastify is a similar project that aims to be faster than Express and adds a number of API improvements like baked-in schema validation for routes, logging, and async-by-default APIs.

Haven't used it in production but replaced Express with it in some side projects.

Since server.js is built on top of express it might even be possible to build a variant of it on Fastify instead and get those benefits as well.

https://www.fastify.io/

Re:Front-End Checklist on Wednesday October 18, 2017 @04:28PM (#15502689)
This would be a good checklist for anyone considering building a UI framework. This kind of thing is the reason Bootstrap & friends are so large - they do a lot for you.
I have to agree, this will create a new component type every time the function is called, definitely causing a repaint and re-render of the subtree.

The "right" way to do this is re-implement `connect` as a render-callback and then use that to create a HOC, not the other way around.

https://github.com/juliankrispel/redux-connector/blob/master...

Here's a Codepen that demonstrates which component-creation methods are safely inlineable and which aren't:

https://codepen.io/alexkrolick/pen/WZwMYW

GIF of repaints: https://user-images.githubusercontent.com/1571667/30631908-f...

Re:New React website on Saturday September 30, 2017 @01:22PM (#15373893)
Still, it isn't entirely obvious under what conditions the methods of a React Component class are going to be called. For all you know they might always be called against the instance.
Re:React 16 on Wednesday September 27, 2017 @02:35AM (#15345383)
Wrote about that recently: https://medium.com/@alexkrolick/writing-react-components-for...

See also: the docs

Re:Enzyme v3 released on Tuesday September 26, 2017 @01:30PM (#15340792)
The adapter system is super interesting: https://github.com/airbnb/enzyme/blob/master/docs/guides/mig...

This might be the way to go for complex dependencies like React where APIs move in and out of the main package, or could be implemented by third parties (like how Preact can supply render and createElement in a mostly-compatible way).

It also makes clear that semver dependencies in package.json are insufficient to describe the library combinations that work in the main package.

Re:JSX in detail on Friday September 08, 2017 @11:34AM (#15200992)
Yeah, I wrote about it last week:

https://medium.com/@alexkrolick/writing-react-components-for...

"Overall it's not a bad experience. JSX makes HTML feel more at home, but tends to obscure the underlying Javascript. Composition and higher-order components are more obvious in plain JS. If I was writing a library using those patterns heavily I might be tempted to go JSX-free even if bundling with Webpack + Babel."

Re:JSX in detail on Friday September 08, 2017 @03:58AM (#15198612)
I could be wrong, but I don't think a LISP macro can transform the structure of the code in the same way that the JSX pragma turns an XML tree "inside-out". For example here's the source for the Babel JSX transformer:

https://github.com/babel/babel/blob/master/packages/babel-pl...

Re:“Google: it is time to return to not being evil” on Tuesday September 05, 2017 @01:12AM (#15172686)

    KHTML -> Webkit -> Blink
             \_ Safari   \_ Chromium
              |_ Epiphany  |_ Opera 15+
                           |_ Vivaldi
Re:Show HN: React without a build step (no JSX) on Friday September 01, 2017 @06:53AM (#15147409)
React is my preferred frontend library, so rather than ditch it when I needed to work with a CMS I decided to go JSX-free and write my component in plain ES2015 with Preact's hyperscript/createElement syntax. I thought I'd write up a few tips and a demo widget to show how it works.

Overall it's not a bad experience. JSX makes HTML feel more at home, but tends to obscure the underlying Javascript. Composition and higher-order components are more obvious in plain JS. If I was writing a library using those patterns heavily I might be tempted to go JSX-free even if bundling with Webpack + Babel.

BTW the Codepen version of the post has much better code formatting: https://codepen.io/alexkrolick/post/react-without-a-build-st...

Re:Summer Reading List on Friday August 04, 2017 @02:49AM (#14926830)
Some thought-provoking stuff in that one.
Re:Monospaced Programming Fonts with Ligatures on Friday July 21, 2017 @10:58PM (#14825149)
Just VSCode with the ESLint plugin and this theme: https://marketplace.visualstudio.com/items?itemName=jdinhlif...
Re:Monospaced Programming Fonts with Ligatures on Friday July 21, 2017 @05:57PM (#14824001)
Re:Monospaced Programming Fonts with Ligatures on Friday July 21, 2017 @04:41PM (#14823623)
Just recorded this GIF of typing out a function with the added visual cues:

http://imgur.com/a/LQVV2

IMO it's comparable to a WYSIWYG equation editor vs looking at raw LaTeX - conceptual errors pop more.

Re:Monospaced Programming Fonts with Ligatures on Friday July 21, 2017 @04:24PM (#14823550)
exactly, and the !== != forms are also correspondingly adjusted
Re:Monospaced Programming Fonts with Ligatures on Friday July 21, 2017 @12:40PM (#14821870)
I really like the giant, triple-line === ligature for JS in Fira Code. Makes it super-obvious when you are doing strict vs sloppy equality checks.
I like how they "trick" you to engage with the video, and don't give you an option to get distracted trying to dig around the page. Normally I skip videos if I can and miss out on the high-level guided introduction.

The [video] tag would be a good warning for the sound though.

Older »