I had a really difficult time this morning setting up React + Webpack + Mocha + Chai + Enzyme. All roads with Mocha seem to lead to Karma, which I don’t want to use because I don’t want the complexity of a headless browser. And, all past roads with Mocha but without Karma seem to be pre-Webpack/Babel.
A Mocha + Chai test looks like this:
Pretty simple, huh? But, to get the test to actually run, I had to…
1. Define my dependencies
2. Transpile a separate js-tests file
3. Add a bunch of mumbo jumbo to keep Enzyme from breaking while transpiling
4. Set up a Grunt task to run Mocha
I’m using Grunt with Webpack because that’s what I copy and pasted from the Feeling RESTful theme (and Grunt is what I’m used to generally).
JSONAPI.org. Proposed standard for JSON API responses.
Building a WordPress-powered web app. Fun read from Quartz’s Josh Kadis.
selectList jQuery plugin. Select one or more items from a
<select> and have them appear below the dropdown.
It’s About The Hashbangs. On a technical level, exactly why hashbangs for absolute URLs are a bad idea. A little change with a lot of future debt.
For Election 2010, we built an interactive mosaic that tries to emphasize the wide diversity of perspectives NYCity News Service reporters captured before and after. Vistors can filter these faces by relevant metadata, and click on a face to access a short video or audio interview with the person.
In the future, I think it’d be more interesting to filter based on issue instead of demographic. Also, I didn’t think about this at the start, but there is a performance loss on page load when every single piece is a video interview as the browser queues all of the hidden Vimeo players.
Later: Michelle and I took a look at the project this evening and I think it’s the first time I’ve seen it truly from the user’s perspective. Most notably: video embed performance sucks and needs fixing. It would also be useful to have the filter values sorted alphabetically (and numerically). Clicking on a new filter should close the active video player. Clicking on a new mug that’s at the bottom of the page should scroll the user back up to the overlay. Lastly, when activating filters, the informational overlays should only appear on mugs that match the filter.