Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
New features and bug fixes
- Remove the
//# sourceMappingURLcomment. We aren’t serving source maps, so this comment was causing 404 errors sometimes (#137 by @iamakulov)
Hey there. Likely 2.2 is large, prepare for the cool stuff!
With this release, we bring a much better support for single-page applications.
History API support
Most modern single-page apps use History API which allows developers navigate between pages without refreshing them. Since 2.2, Likely supports this API out of the box! If you place the buttons on a page and then do
history.replaceState(), Likely will automatically catch these changes and update itself. (Navigating backwards and forwards is also supported, of course.)
If you don’t use History API, don’t worry, Likely will continue to work for you the same way.
Fixes for repeated
likely.initiate() behavior was buggy: once you initialized the buttons for the first time, it was really hard to re-initialize them again. Now, this method works just like you’d expect: each time you run it, it always gets the freshest options and updates Likely. If you develop an SPA but don’t use the History API, this is exactly for you.
and by setting the DOM attributes:<div class="likely" data-url="http://ilyabirman.net" data-counters="no">
We thought Likely 2.2 would be only SPA-related, but unexpectedly, @350d came in and brought us a new LinkedIn button:
Use it just like the other buttons:
Decreased file size
likely.js is 19.3 Kb in Likely 2.2 – almost twice smaller than Likely 2.1.3 with 36.2 Kb.
Starting with Likely 2.2, we deprecate two methods:
likely.initate() (note the typo). The only supported method for initializing is now
likely.initiate(). The reasoning behind this is that between
likely.initiate(), only the latter was documented, and
likely.initate() was just a typo that accidentally made itself into API.
likely.initate() will continue to work, but start printing warnings about deprecation. We’re going to remove them when we reach v3.0.0.
Instead of this, we extend
likely.initiate() to accept not only options, but also a node or a list of nodes. Use it either way:
likely.initiate(); likely.initiate(nodes); likely.initiate(options); likely.initiate(nodes, options);
Finally, we’re near the end.
- Tests. We brought automated tests to Likely. This means that every functionality covered with the tests (and it’s a lot of it) will be stable and won’t experience accidental bugs. (#73 and others by @iamakulov)
- Migration to ES2015+. We migrated our codebase to ES2015+ with Babel so Likely are now easier and more pleasant to develop. Contribute! (#79 by @7rulnik)
- Migration to Webpack. This lets us use all the modern tools for development, and this was one of the things that helped us to decrease the files size. (#58 by @andrew--r)
- ESLint. This was made earlier, but it’s worth mentioning here. With ESLint, all our code follows the same style, and we can catch some programming errors early. (#29 by @vitkarpov)
This is a (mostly) bugfix release.
2.1.1 because we got into a trouble and had to unpublish it.
- Now, all Likely services use HTTPS instead of HTTP. This is the only non-bugfix change in this release
- Twitter and VK (and probably other services) now receive the page title even when Likely is dropped before the
<title>tag (@vitkarpov, #70)
- Text on the buttons is now properly aligned when Minimal font size is enabled in Firefox (@vitkarpov, #80)
- When there’re several Likely blocks on the page, each with a different sharing url, running
likely.initiate()multiple times broke the counters on these widgets. Now it doesn’t (@vitkarpov, #84)
- A new Telegram button was added (@sofiia-hlyniana, #23). Check out the Readme for the extended options.
- The Odnoklassniki button now uses HTTPS connection if the page is served under HTTPS (@Corey-Maler, #21)
- If there’s a
<link rel="canonical">tag on the page, Likely will now prefer an URL specified in it over the page URL. The
data-urloption still has higher priority than the canonical link (@vitkarpov, #19)
- Previously, when a Likely button was tapped on an iOS device, it was remaining looking as pressed after a tap. This was a default iOS behavior, but it was confusing users, so we fixed it (@iamakulov, #38)
- Likely now specifies proper dependency versions in
package.json, so it won’t accidentally break when something updates (@iamakulov, #42)
Important: as we’re currently transferring ownership of the package on npm, the package isn’t yet updated to 2.1.0. See #54 (comment) for more details and a workaround.