Better HN
topnewbestaskshowjobs
Log inSign up

amk_

860 karma · joined Aug 9, 2014 (12y ago) · 235 submissions

Submissions

1.

CNN headlines, according to a neural net(aiweirdness.com ↗)

3 points · by amk_ · 8y ago · 1 comment

2.

Generated ice cream flavors: now it’s my turn(aiweirdness.com ↗)

1 points · by amk_ · 8y ago · discuss

comment 8y ago · link · parent

Here's one: https://medium.com/@mbaranovski/quick-guide-to-tdd-in-react-...

comment 8y ago · link · parent

Extracted boilerplate from some of my libs:

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

Want to port this to a CLI eventually, too

comment 8y ago · link · parent

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

comment 8y ago · link · parent

A framework like Phoenix would be awesome. Even something more lightweight (Express-like) would be pretty handy. Clojurescript front-end, Clojure backend...

7.

What makes a good [React Component] test?(blog.progressly.com ↗)

1 points · by amk_ · 9y ago · discuss

comment 9y ago · link · parent

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.

comment 9y ago · link · parent

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/

comment 9y ago · link · parent

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.

comment 9y ago · link · parent

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...

comment 9y ago · link · parent

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.

13.

Show HN: React-Renderless(github.com ↗)

1 points · by amk_ · 9y ago · discuss

comment 9y ago · link · parent

Wrote about that recently: https://medium.com/@alexkrolick/writing-react-components-for...

See also: the docs

comment 9y ago · link · parent

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.

16.

Show HN: React Composition Patterns from the Ground Up(hackernoon.com ↗)

5 points · by amk_ · 9y ago · discuss

comment 9y ago · link · parent

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."

comment 9y ago · link · parent

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...

19.

Show HN: React Composition Patterns from the Ground Up(medium.com ↗)

3 points · by amk_ · 9y ago · discuss

comment 9y ago · link · parent

    KHTML -> Webkit -> Blink
             \_ Safari   \_ Chromium
              |_ Epiphany  |_ Opera 15+
                           |_ Vivaldi

comment 9y ago · link · parent

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...

22.

Show HN: React without a build step (no JSX)(medium.com ↗)

7 points · by amk_ · 9y ago · 1 comment

23.

Quality Enterprise Web Development WithNode.js(qewdjs.com ↗)

1 points · by amk_ · 9y ago · discuss

comment 9y ago · link · parent

Some thought-provoking stuff in that one.

comment 9y ago · link · parent

Just VSCode with the ESLint plugin and this theme: https://marketplace.visualstudio.com/items?itemName=jdinhlif...
12345
8