Failure to Componentize (plus Stylescope & ModCSS)

Back in Aug 26 2015 I posted hopefully about the future of web components in Netflix’s Digital Supply Chain. Since then, all fans of the open web have sided with expediency (and therefore React). You can’t stop the mob’s forward march :). Seeing this coming a year ago, I offered Reactive Elements as the virtually cost-free way to bridge the gap ‘tween React and WC, but interop be damned I guess. The group recently had the joy of bringin’ on Tim Branyen from Bocoup—I hope he’ll help folks “see the light”.

Scoped CSS

As a side note, I’m developing an answer to one of the main open questions. It’s tentatively called Stylescope and serves as a more traditional (but versatile) companion to ModCSS.

ModCSS

ModCSS assists in modularizing styles by enabling CommonJS-like system to pull in Stylus or CSS files as JSON. The primary use so far in Netlix has been assigning to style in JSX.

Stylescope

Stylescope assists in modularizing styles by enabling one to reliably assign style information to an HTMLElement with 100% security that style won’t affect other elements. The pain of an Enterprise front-end developer attempting to add their own flair to a large CSS cascade is traumatizing and I’m here to prevent others from experiencing the same fate :)

Stylescope is early alpha, but it already works well for one-deep style trees in its Mochify tests. For next steps, I plan to demonstrate distributing and sharing styles via ModCSS and then consuming them in a Web Component via Stylescope. I’ll need to locate a module containing all viable HTML tags to implement parent-child style relationships in Stylescope…


Hello Japan

We changed a few things at Netflix.com to prepare for our new Japanese friends:

  • Image-Based Subtitles to support vertical text, furigana (rubies), bouten (emphasis). This also sets us up for subtitles in other languages that don’t use a Latin script
  • On-Screen Keyboard for Darwin (user selects kana, yielding kanji suggestions)
  • Search tokenizes input (no spaces in Japanese), normalize to two possible search scripts
  • Typographic differences (bold and italic not used)
  • Multi-Language box art
  • Metadata length
  • First / last name order in sign up
  • Studio Copyright attribution

Points written by Joubert Nel


Weberize ALL the components

Some folks in Netflix’s Digital Supply Chain have agreed that Web Components are a good interop container. I also (perhaps controversially) believe people should also use WCs whenever effective as it’s simply native to the web. Telling someone to not use WCs is like telling someone not to use document.querySelector or Array::forEach. The war against React zealots is treacherous and ongoing.


Asynchronous communication

I was at a company called Amco a few years ago. It was my first Senior position outside of running my own company. The VP of Engineering there (Jason King) taught us something he called “asynchronous communication”. It’s the concept that sharing information globally and digitally is more efficient than individually & physically. By sharing with more people, and in a way that they can respond as convenient to them, you optimize the quality and quantity of feedback you can receive. When everyone does this, it make everyone better. It definitely made me better and I think Netflix will get better if we all start practicing asynchronous communication. Ways we can do this are:

  • Remote pair programming tools that support multiple people
  • Google Docs
  • Frequent pull requests

Viewing images right inside iTerm 2.9

Call me crazy, but viewing images from a CLI app can be pretty cool.
Yes, we have the ancient art of ASCII (and that will not go away)
but why not use a real image in some cases?

Now the nice folks behind iTerm 2 have made that possible in versions
of iTerm post-2.9. I do not claim this has not been done before, but
I am unaware of this capability in Terminal. Anyway, on to the goods:

Steps for ZSH Users

[ iTerm & ZSH, great together ]

  • mkdir ~/Projects/iterm/imgcat && cd !$
  • wget https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat
  • wget http://p1cdn01.thewrap.com/images/2014/05/Halt-and-Catch-Fire-8.jpg -O hacf.jpg
  • Change $PATH to include ~/Projects/iterm/imgcat
  • Reload your shell
  • imgcat hacf.jpg

Halt and Catch Fire


set-upstream-to

Hello friends! Are you tired of this message:

There is no tracking information for the current branch.

I am too! So I searched the OhMyZSH repo for set-upstream-to and re-discovered this command: ggsup. Calling ggsup with the name of the branch you want to track will get you to the place you want to be. W00t!

To recap. Call

1
2
3
ggsup master
```
...to track `master`. Call

ggsup dev
```
…to track dev. Get trrrrrracking team!


Definition: The Zone (Programming)

(The) Zone

noun

The state in which all resistance to progress is non-present. Easy flow of information from subconscious to conscious mind, characterized by clarity of purpose, speed of achievement and the full architecture of your project being held intact at the front of your mind. “Peak zone” is typically sustainable for 2-4 hours but takes 15-30 minutes to “boot up” into and is easily knocked down like a deck of cards if the “zonee” is disturbed by someone outside the zone.


Dev Letters: TMZ for Developers

Some of the most useful and lasting content has come from letters between colleagues. In this tradition, I
will post some developer insight that’s shared between myself and other developers.

Tim

You’ve sent out some good stuff lately [on our JavaScript DL]. What’s your source? Is there a site I can check daily—a TMZ for developers?

James

  1. I’ve decided to share even when I’m really “in the zone”, whereas previously I shared when I was bored
  2. I make liberal use of IFTTT. I let the computers monitor the web and ping me when something “interesting” happens. E.g. I have Facebook’s Github profile monitored for new repos
  3. I listen to the “5 Minutes of JavaScript” podcast. 3/4 of their content is too junior, but the 1/4 that’s not is worth it

Capitalization of modules in Node.js

Tradition in Node.js dictates you import core modules using this style:

1
2
var fs = require('fs');
fs.readFile(packageJSONPath, readOperationDidFinish);

I’ve adhered to that style for the most part, but it’s always rubbed me the wrong way.
As a core modules that points to a collection of static methods, capitalization is more appropriate.

1
2
var FS = require('fs');
FS.readFile(packageJSONPath, readOperationDidFinish);

Where the correct decision becomes most apparent is when using the path module:

1
2
3
var Path = require('path');
var join = Path.join;
var path = join(process.cwd(), 'package.json');

We used lowercase for local values, and using lowercase for the path module easily results in naming conflicts.


git pug

I am an idiot who subconciously likes pugs, so I often type git pug instead of git push or git pull. Is this truly a problem?
Note if I execute the following:

1
npm install pugme -g

Then place this in my ZSH aliases file:

1
2
3
4
5
6
7
git() {
if [[ $@ == "pug" ]]; then
command pugme
else
command git "$@"
fi
}

Which results in