HN user

amk_

860 karma
Posts43
Comments172
View on HN
aiweirdness.com 7y ago

CNN headlines, according to a neural net

amk_
3pts1
aiweirdness.com 8y ago

Generated ice cream flavors: now it’s my turn

amk_
1pts0
blog.progressly.com 8y ago

What makes a good [React Component] test?

amk_
1pts0
github.com 8y ago

Show HN: React-Renderless

amk_
1pts0
hackernoon.com 8y ago

Show HN: React Composition Patterns from the Ground Up

amk_
5pts0
medium.com 8y ago

Show HN: React Composition Patterns from the Ground Up

amk_
3pts0
medium.com 8y ago

Show HN: React without a build step (no JSX)

amk_
7pts1
qewdjs.com 8y ago

Quality Enterprise Web Development WithNode.js

amk_
1pts0
www.quora.com 9y ago

Why is VueJS being adopted so slowly?

amk_
2pts0
news.ycombinator.com 9y ago

Ask HN: Will you be switching back to NPM from Yarn with NPM5?

amk_
7pts4
medium.com 9y ago

Ruthless Prioritization

amk_
3pts0
www.ussherpress.com 9y ago

How to prioritize your work: work on tasks that will eliminate risk first

amk_
1pts0
medium.com 9y ago

StreamAlert: Real-Time Data Analysis and Alerting from AirBnB

amk_
3pts0
github.com 9y ago

React Voice Components

amk_
1pts0
blog.progressly.com 9y ago

How we made our React-Rails app 5x faster

amk_
66pts31
elasticterrain.xyz 9y ago

Elastic Terrain – Using motion to simulate altitude

amk_
2pts0
hackernoon.com 9y ago

The Correct Way to Validate Email Addresses

amk_
556pts388
icecube.wisc.edu 9y ago

Searching for dark matter in the Earth

amk_
1pts0
hackernoon.com 9y ago

Snow Crash Revisited: Grokking a Satire of Mimesis

amk_
111pts101
news.nationalgeographic.com 9y ago

Alaska Has Finally Been Mapped as Precisely as Mars

amk_
1pts0
en.wikipedia.org 9y ago

List of all 27 seasons of How It's Made episodes

amk_
3pts0
dev.opera.com 9y ago

Progressive web apps running as native OS X apps

amk_
2pts1
nautil.us 10y ago

Our Solar System Would Be Weird Even If It Didn’t Harbor Life

amk_
4pts0
www.johndcook.com 10y ago

Group projects

amk_
1pts0
ignorethecode.net 10y ago

Input Masks: Violating User Expectations

amk_
1pts0
alistapart.com 10y ago

The Foundation of Technical Leadership

amk_
6pts0
m.signalvnoise.com 10y ago

Don’t ask for permission, come with intent

amk_
15pts0
github.com 10y ago

Gramm – GGPlot for Matlab

amk_
1pts0
jerrygamblin.com 10y ago

Hijacking a Sonifi Hotel TV

amk_
2pts0
www.johndcook.com 10y ago

Flood control parks

amk_
2pts0

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

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.

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/

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

New React website 9 years ago

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.

Enzyme v3 released 9 years ago

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.

JSX in detail 9 years ago

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

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

setState doesn't actually care whether you've mutated your data or updated it immutably.

Not necessarily - if something downstream is looking at the values (such as a shouldComponentUpdate check), the first mutation may cause the current value to === the next value and prevent a render. I know you called this out as an "optimization" but you don't always know what's happening inside your components, especially if 3rd party libraries are involved.

Bootstrap 3 and Foundation 5 are both really nice, mature frameworks.

Bootstrap 4 and Foundation 6 on the other hand seem to be having problems. I think part of it is that developer interest stalled with the explosion of framework-specific component libraries for React, Vue, Angular, Ember, etc.

React supports these SVG attributes:

https://facebook.github.io/react/docs/dom-elements.html#all-...

    accentHeight accumulate additive alignmentBaseline allowReorder alphabetic 
    amplitude arabicForm ascent attributeName attributeType autoReverse azimuth
    baseFrequency baseProfile baselineShift bbox begin bias by calcMode capHeight
    clip clipPath clipPathUnits clipRule colorInterpolation
    colorInterpolationFilters colorProfile colorRendering contentScriptType
    contentStyleType cursor cx cy d decelerate descent diffuseConstant direction
    display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground
    end exponent externalResourcesRequired fill fillOpacity fillRule filter
    filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize
    fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fx fy
    g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical glyphRef
    gradientTransform gradientUnits hanging horizAdvX horizOriginX ideographic
    imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength
    kerning keyPoints keySplines keyTimes lengthAdjust letterSpacing lightingColor
    limitingConeAngle local markerEnd markerHeight markerMid markerStart
    markerUnits markerWidth mask maskContentUnits maskUnits mathematical mode
    numOctaves offset opacity operator order orient orientation origin overflow
    overlinePosition overlineThickness paintOrder panose1 pathLength
    patternContentUnits patternTransform patternUnits pointerEvents points
    pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits
    r radius refX refY renderingIntent repeatCount repeatDur requiredExtensions
    requiredFeatures restart result rotate rx ry scale seed shapeRendering slope
    spacing specularConstant specularExponent speed spreadMethod startOffset
    stdDeviation stemh stemv stitchTiles stopColor stopOpacity
    strikethroughPosition strikethroughThickness string stroke strokeDasharray
    strokeDashoffset strokeLinecap strokeLinejoin strokeMiterlimit strokeOpacity
    strokeWidth surfaceScale systemLanguage tableValues targetX targetY textAnchor
    textDecoration textLength textRendering to transform u1 u2 underlinePosition
    underlineThickness unicode unicodeBidi unicodeRange unitsPerEm vAlphabetic
    vHanging vIdeographic vMathematical values vectorEffect version vertAdvY
    vertOriginX vertOriginY viewBox viewTarget visibility widths wordSpacing
    writingMode x x1 x2 xChannelSelector xHeight xlinkActuate xlinkArcrole
    xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType xmlns xmlnsXlink xmlBase
    xmlLang xmlSpace y y1 y2 yChannelSelector z zoomAndPan
Anything else needs to be stripped out - mostly stuff like meta data with ":" in the tag.
React v15.5.0 9 years ago

If we switch to it as a hard dependency, library consumers on React <16 will have an extra package in the bundle. If we make it an optional peer dependency, package.json becomes less reliable because we would need to check where createClass is implemented at runtime.

Is create-react-class smart enough to determine whether the version of React it is augmenting already implements createClass to prevent bundle size bloat?