Skip to content

v2.0.0: new auto-init, CSS export, smaller bundle

Compare
Choose a tag to compare
@kytta kytta released this 13 Feb 15:16
· 178 commits to main since this release
v2.0.0
c07f013

Added

  • BREAKING: new (auto-)init behaviour, inspired by petite-vue

    • require, import, or use <script> to include Shareon without
      initialization

    • use exported initializeShareon function in Node to initialize Shareon

    • use init attribute in script to initialize Shareon in-browser

      <script src="path/to/shareon.js" init>
  • CSS export for use in Webpack/Rollup/etc. (#35)

    import "shareon/css";
    require("shareon/css");

Changed

  • BREAKING: default version of the package doesn't auto-initialize buttons
  • BREAKING: instead of default export, named exports are now used. If IIFE
    is used, the global object's name is now Shareon, and it has one init()
    method
  • updated logos and colours for some social networks
  • removed mixins, defining the code/styles directly in the files
  • use Vite for building, reducing the devDependencies
    tree and build times drastically
    • BREAKING: newly built files offer worse browser support
  • change code style to Prettier

Removed

  • BREAKING: noinit version of the package is removed