How I learned javascript creating npm package.πŸ”₯πŸ”₯

I did it. You can do it too!

A detailed thread so, set back and enjoy πŸ§΅πŸ‘‡
1/ What I have learned:

πŸ”₯ My first #opensource project ever.
πŸ“ˆ Charting and #DataVisualization using D3.js.
πŸ§ͺ Testing using Jest.
πŸ“¦ Bundling using rollup.
πŸ—’οΈ Writing high quality comments.
✍️ Writing Readme docs.
⚑️ More ES6 practise.
⬆️ Deploy demos on github pages.
2/ Backstory πŸ“˜, (if not interested ❌ skip to tweet #4).

Creating packages requires a lot of advance learning and docs diving.

I was working on basecamp clone using laravel when I needed to implement their hill charts. πŸ“ˆ

github.com/nagi1/hill-cha…
3/ My javascript wasn't that good (who is πŸ˜…), but I made it my goal to implement hill charts using pure #javascript to allow wrapping it using any front-end framework.

More about hill-charts πŸ‘‡
basecamp.com/features/hill-…
4/ It was the first time I merge PRs and creating tags, I felt happy 😌.

Someone PRed a new feature (Dark mode). I had to go through all his code fix alignments and suggest better solutions.
5/ D3js was damn hard 😬!

Some d3.js courses were 7 weeks long!
I learned good portion in just 7 hours. 😎
Just because I had problem and I needed a very specific solution to solve it.
6/ I fell in love with jest πŸ’™.

@fbjest it was breeze to learn and use.

I loved the way it describes code like writing poetry.

BTW I didn't follow any youtube tutorial. Just read the documentation and I was ready to go.
7/ The code needed to be clear to my future self and to others so I had to learn how to properly structure comments.

I adore @taylorotwell's way of writing comments it feels like care and love.

⭐️ 3 lines, every line 3 character less than the next one. From hill-chart codebase https://github.com/nagi1/hill-chart
8/ Surprisingly this way of writing comments gave me the opportunity to explain and summarize better.

Like what twitter does with it's 140 chars!
9/ I wrote few readme docs before, but this one I spent the most with!

I had to perfect this one, so I created a little demo took a screenshot it looked beautiful.

πŸ‘‡πŸ‘‡
github.com/nagi1/hill-cha…
10/

βœ… Logo or screenshot 😎
βœ… Table of contents for easy navigation.
βœ… Interactive demo.
βœ… Multiple bundles options and a freaking cdnπŸ”₯
βœ… Examples and API.
βœ… Explain theory.
βœ… Copyright notice.
βœ… Roadmap (Todo List).

I had fun!
11/ It was a great chance to improve my ES6 skills.

I didn't know that you can make OOP class using javascript!
12/ Bundling is compiling your ES6 code to format that all browsers can understand!

Rollupjs didn't play nice with me. Neither d3.js it was huge that it took me 12 hours of tinkering with rollup options and read every blog post about it to produce reasonable bundle size.
13/ CI integration πŸ”„

I had a lot of fun configuring @travisci and @scrutinizerci that gave me insights about my code and test coverage.

I didn't stop tuning my code until it reached 10.00/10 code quality!
14/ You don't need hosting or domain to deploy your demo. @github's pages got you covered.

πŸ”₯ Combined with github actions it can build and deploy the demo automatic with every push/release.
15/ Final thought...

I didn't plan any of this. I learned a lot just by following the natural path of trial and error.

It all started with my unfinished project and my desire to learn javascript and they had me! Hi I'm Hill-Chart and my life is kinda crazy!
Oh Did I forget to mention that I wrote a blog post about it?

If you're interested to know I built hill charts and the math behind it. πŸ‘‡πŸ‘‡

ahmednagi.com/hill-chart/

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Ahmed Nagi

Ahmed Nagi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(