This Is Yak Shaving
Join the DZone community and get the full member experience.Join For Free
i sat down to write about a rendering technique i use to quickly wrap random d3 code in react components. i call them "blackbox components" because they're a black box.
then i thought, " this is dumb. people shouldn't keep rewriting this. it should be an npm module."
so, i started making a library.
so, i went to copy config files from an
old transition library i did
. but the files were old and out of date. possibly copied from a 0.2.x version of
so i looked for a
version creates too much stuff that libraries don't need. like all the setup for
and assets and webpack dev and webpack prod and eslint and jest and a default app page and…
couldn't find one. used
, ejected, copied config files, removed the parts i don't need.
30 minutes in: no post, no library, but i’ve got the config i need to get started.
so, i copied the code from codepe, cleaned it up, and added some imports & exports. made it real code.
then i thought, "you know, this technique can work for things that aren't svg. there's plenty of stuff people might wanna use."
so i added a version that uses
then i compiled.
node_modules/babel-cli/bin/babel.js src --out-dir lib
. it worked!
now, how do i test this?
so, i started writing an example project. create react app and all of that.
to use unpublished library. neat trick, that.
i started with the same axis example from codepen.
, use it to make an
component, render in an
error. files not found.
investigate, find a typo in the filename, fix, reload, renders default react app.
waitaminute! where's my example axis? how am i gonna add more awesome examples if i can't even load an axis?
sigh. there's a nasty error in the console. pretty sure i've never seen this one before.
how do you even debug that?
so i went to play dirt3 for 20 minutes.
then i wrote this story. and i wish i was kidding, but it took me an hour. twitter is distracting.
three hours after i started: no article, no library, no working code, no example project.
this is yak shaving . don't do this.
you should follow me on twitter, here .
Published at DZone with permission of Swizec Teller, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.