HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
segmentio
canonical
JavaScript2013–2020
segmentio / canonical

canonical

Component: returns the canonical URL for the page.

2Distinct people
2Mentions
0Explicit recommenders
7GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Component: returns the canonical URL for the page.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year2 dated mentions

Observed mentions: 2013-10-02 21:54:42 UTC to 2020-04-29 18:17:06 UTC.

012013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20132014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC101
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101

What Hacker News says

2 sources
If you take a look at some of Segment's open source code, it isn't hard to see why they wound up struggling with microservices. It looks like they subscribe to the "left-pad" style of software development. They have tons of repositories that have less than 10 lines of code. They have a two line repository for calling preventDefault[0], a four line repository for getting the url of a page[1], and a eight line repository for clearing the browser state that calls into eight different packages[2]. Disclaimer: I run a Segment competitor. I'm pretty biased, but still... [0] https://github.com/segmentio/prevent-default/blob/master/lib... [1] https://github.com/segmentio/canonical/blob/master/lib/index... [2] https://github.com/segmentio/clear-env/blob/master/lib/index...
In Why Segment Went Back to a Monolith
TL;DR - Runnable only solves the small-picture problem. The best solution to the bigger-picture problem would make Runnable obsolete, because it's an anti-pattern to begin with. --- The small version of the problem is that it's hard to find these snippets spread out across the internet, and then figure out if they work, and then copy-paste them into your program. Runnable solves the finding problem. But the bigger version of the problem is that you shouldn't be copy-pasting these snippets into your codebase all the time, no matter how small they are. If they are useful enough that you find yourself looking them up often, or they are useful enough that they merited being posted on someone's blog, then they are useful enough to make into a package and share them properly. The node.js module system with npm gets extremely close to this goal.
Read the rest
And for client-side Javascript, component[1] does the same thing. [1]: https://github.com/component/component This is one place where other client-side Javascript package managers completely fall over. There are multiple different "types" of packages. 1. There are the typical "big libraries" - jQuery - superagent - mocha - d3 - backbone - underscore - angular.js - etc. 2. Then there are "plugins", which are pretty big in scope themselves. They have to be big enough to be "plugin-worthy", influenced mostly by how annoying it has been to install plugins in the jQuery days, via copy and pasting them into your /libs folder. These are things like: - backbone marionette - jQuery waypoints - underscore string - any jquery plugin - any angular plugin - etc. Most package managers, with that kind of thinking in mind, stop there, at the "big library" and "plugins" level. Bower has this shortcoming. It's great for quickly grabbing a copy of jQuery and a few jQuery plugins, but it doesn't actively encourage making smaller modules, which is critical to solving the big-picture need Runnable is trying to solve. 3. The third type of package are tiny modules that at first glance you are tempted to just stick right into your /utils folder. These are so small that in old-school package managers it would be more hassle just to make them into packages. (This is why it's crucial for package managers to have as little beaurocracy as possible by the way, to avoid that line of thinking.) These are things like: - https://github.com/matthewmueller/uid - https://github.com/yields/has-transitions - https://github.com/pazguille/shuffle-array - https://github.com/ianstormtaylor/to-snake-case - https://github.com/jwerle/to-csv - https://github.com/segmentio/canonical Those tiny modules are the kinds of things you find StackOverflow answers for all the time. People keep having the same problems over and over again, and eventually the answers get voted up. Things like, "how do I convert a camel case string into a snake case string?". As soon as you take those simple tasks and package them up in a way that installing them is as easy as: $ component install ianstormtaylor/to-snake-case Then you start to see crazy gains in productivity and quality of your code. When you do that you aren't copy-pasting some shoddy StackOverflow answer into your codebase, so that the onus is now on you to maintain it. Instead, you're just dependning on an open-source component that is packaged along with tests to make sure it continues to work. It's visible by tons of others, can be improved when bugs crop up, and you don't need to maintain yourself if you don't want to.
In Runnable Wants To Become The “YouTube Of Code”

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.