Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full modularization by its functionality #756

Closed
netil opened this issue Jan 31, 2019 · 5 comments
Closed

Full modularization by its functionality #756

netil opened this issue Jan 31, 2019 · 5 comments
Assignees
Milestone

Comments

@netil
Copy link
Member

netil commented Jan 31, 2019

Description

Make each module as independent, to be more loose coupled.
This task should have:

  • Split as separate module by its functionality.
  • An non-breaking interface to use them.

    This should come with the capability to import only used modules to cut the bundling size.

@netil netil added this to the 2.0-next milestone Jan 31, 2019
@netil netil self-assigned this Jan 31, 2019
@stof
Copy link
Contributor

stof commented Aug 21, 2019

this would be great. Do you have an idea how the new interface should look like ?

@stof
Copy link
Contributor

stof commented May 24, 2020

@netil is there any progress on that front in the upcoming v2 ? billboard.js is currently the biggest contributor to my bundle size, and I only use some of the supported chart types. Being able to import only the one I use would be great (the current API indeed does not fit that, it would require building a new tree-shakeable API and then rebuilding the current API on top of it for BC for people preferring ease of use over smaller size)

netil added a commit that referenced this issue Jun 8, 2020
BREAKING CHANGE: v2 updates

Ref #758, #757, #756, #36
netil pushed a commit that referenced this issue Jun 8, 2020
# [2.0.0-next.1](1.12.0-next.5...2.0.0-next.1) (2020-06-08)

### Bug Fixes

* **all:** Fix test cases ([2e1ad79](2e1ad79))
* **point:** Correct focus.only to work in mobile env ([67eea16](67eea16))
* **point:** Correct point.focus.only ([1686594](1686594))

### Code Refactoring

* **all:** v2 updates ([e23998f](e23998f)), closes [#758](#758) [#757](#757) [#756](#756) [#36](#36)
* **module:** implement ESM index ([85caf71](85caf71))

### Features

* **point:** Intent to ship point.focus.only ([bb70347](bb70347))

### BREAKING CHANGES

* **all:** v2 updates
* **module:** new index for ESM build

- split Axis releated size from size.ts --> size.axis.ts
- split common main option from Options.ts --> ./common/main.ts
- Instead export Axis class, add .getAxisInstance() to make beneficial
  from tree-shaking
@netil
Copy link
Member Author

netil commented Jun 8, 2020

@stof, just released the first RC of v2.

# you can install '@next' tagged version via following command
npm i billboard.j@next

Using v2, can reduce bundle size from 10 ~ 43%.
Checkout the changelog for the details

@stof
Copy link
Contributor

stof commented Jun 8, 2020

Making type callbacks extend the internal APIs with necessary config looks like a nice trick to implement this without redoing the whole API.

@netil
Copy link
Member Author

netil commented Jul 9, 2020

Restructured whole file system based on its functionality and grouped by its type (shape & interaction).

Close for now, but looking a continuous improvements on this.

@netil netil closed this as completed Jul 9, 2020
netil pushed a commit that referenced this issue Jul 16, 2020
# [2.0.0](1.12.11...2.0.0) (2020-07-16)

### Bug Fixes

* **all:** Fix test cases ([2e1ad79](2e1ad79))
* **arc:** fix applying data.labels.colors ([#1448](#1448)) ([c128fad](c128fad)), closes [#1440](#1440)
* **axis:** fix incorrect clip node handling ([a8c6f96](a8c6f96)), closes [#1449](#1449)
* **axis:** make axis clip-path to fit real axis size ([7419f44](7419f44)), closes [#1449](#1449)
* **bar:** fix bar width scale on zoom ([59073bd](59073bd)), closes [#1476](#1476)
* **data:** fix for data.labels=false ([b7a0972](b7a0972)), closes [#1444](#1444)
* **data.selection:** fix selection.isselectable value check ([9d41a04](9d41a04))
* **gauge:** fixed wrong bottom padding calculation ([0542586](0542586)), closes [#1441](#1441) [#1471](#1471)
* **legend:** Don't bind event when interaction is false ([4546c00](4546c00))
* **point:** Correct focus.only to work in mobile env ([67eea16](67eea16))
* **point:** Correct point.focus.only ([1686594](1686594))
* **point:** update point generation ([da63e39](da63e39))
* **subchar:** correct subchart rendering ([44ed216](44ed216)), closes [#1458](#1458)

### Code Refactoring

* **all:** v2 updates ([e23998f](e23998f)), closes [#758](#758) [#757](#757) [#756](#756) [#36](#36)
* **module:** implement ESM index ([85caf71](85caf71))

### Features

* **axis:** Intent to ship log scale  ([6fdf3e4](6fdf3e4)), closes [#1351](#1351)
* **bar:** Intent to ship bar.label.threshold ([72a7b7f](72a7b7f)), closes [#1427](#1427)
* **gauge:** Intent to ship gauge.label.threshold ([#1443](#1443)) ([9a0807e](9a0807e)), closes [#1439](#1439)
* **interaction:** split selection, subchart & zoom ([ba1e4f2](ba1e4f2))
* **point:** Intent to ship point.focus.only ([bb70347](bb70347))

### BREAKING CHANGES

* **all:** v2 updates
* **module:** new index for ESM build

- split Axis releated size from size.ts --> size.axis.ts
- split common main option from Options.ts --> ./common/main.ts
- Instead export Axis class, add .getAxisInstance() to make beneficial
  from tree-shaking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants