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

Apply D3 v6 updates #1641

Closed
netil opened this issue Aug 31, 2020 · 16 comments
Closed

Apply D3 v6 updates #1641

netil opened this issue Aug 31, 2020 · 16 comments
Assignees
Labels
Milestone

Comments

@netil
Copy link
Member

netil commented Aug 31, 2020

Description

D3 new major release v6 came out, and need to look for the support & migration.

The main affected will be:

  • D3 v6 dropped the old ES support moving to ES6.
  • Dropped the global event object d3.event, replacing it by passing as event param.

Refs.

@netil netil added enhancement refactoring dependencies Pull requests that update a dependency file labels Aug 31, 2020
@netil netil self-assigned this Aug 31, 2020
@michkami
Copy link
Collaborator

I assume this will make billboard also drop the old ES support? Or are you looking for a way to update and still support IE11?

@netil
Copy link
Member Author

netil commented Aug 31, 2020

Not for in near future, but as the D3.js goes to the direction dropping the old legacy support, it will come the moment of the decision.

I already wrote a guide about this before, but seems not really effective, because it needs some work from the user level.

Maintaining "as-is" isn't a long term solution also. @michkami what's your opinion?

@michkami
Copy link
Collaborator

Not for in near future, but as the D3.js goes to the direction dropping the old legacy support, it will come the moment of the decision.

Maintaining "as-is" isn't a long term solution also. @michkami what's your opinion?

Personally I completely agree with you. Sooner or later, dropping old browser support will be necessary.
I understood this issue as "will be upgraded asap" which gave me a small heart attack 😂

But from the perspective of our customers, IE11 support is necessary, as many of them still don't want (or can). As soon as Microsoft completely replaces IE with the new chromium based Edge, they will be forced to use atleast the Edge, which supports ES6.
It would be quite interesting to know how many billboard users are forced to support older browsers.

When do you plan to update to v6?

@netil
Copy link
Member Author

netil commented Sep 1, 2020

The worldwide IE market share is just about 1.63%, so sooner or later this will be inevitable.

I can't determine the schedule for that for now. Need to hear more feedbacks from the users.
In a rough estimation the update will be within next year, I guess.

I'll be looking for possible workaround on this, and let me know if you have one :)

@stof
Copy link
Contributor

stof commented Sep 7, 2020

AFAIK, d3 v6 can run fine in IE 11 (at least the parts I tried) if you follow a few steps :

  • you transpile it so that it does not use ES6 syntax anymore
  • you load polyfills for Map and Set (maybe a few more as well)
  • you bundle it (useful for modern browsers too in production to limit the number of files), as IE 11 does not support ES modules.

These steps are reasonable to expect for projects which still need to maintain support for IE 11 IMO. The real issue comes when using non-polyfillable non-transpilable features, but that's few of them. Ideally, the list of necessary polyfills should be documented though

In my opinion, billboard.js should not be loading these polyfills and performing the transpiling (except for the special pkgd build), to keep the benefits of smaller modern code for projects not needing IE 11 (and to avoid loading polyfills multiple times in projects supporting IE 11).

Note however that this might require a new major version of billboard, in case d3 BC breaks leak in the public API (I'm thinking about the d3.event removal and the d3-selection changes for instance)

@stof
Copy link
Contributor

stof commented Sep 11, 2020

For reference, at Incenteev, we currently have 4.6% of IE 11 users (hurray for big companies not migrating to modern browsers...), and we already rely on several libraries which don't ship transpiled code anymore. We only faced once an issue where a library was using a non-polyfillable runtime feature (and they were OK to use a different solution to avoid that). Of course, from times to times, we get issues due to a missing polyfill, but that's easy to fix.

@toitzi
Copy link

toitzi commented Dec 6, 2020

Sorry for the harsh question, but is there any new Information or ETA on this issue?

Imho IE Support ist negligible, i understand that some cooperations still use it (some of our clients, still use it - but they have a second browser installed for "modern" applications / applications which do not support IE).
IE is in kind of a legacy state. I understand that Microsoft has not officially killed it, but even some of their own sites (e.g. Office 365) do not support IE anymore, same as many other popular sites like github.com or trello.com

Also: Just because a new major version of billboard releases (which would be necessary i guess because of breaking changes?), people are not forced to update to this version. You can continue to run the older version as long as you need (you won't get the bugfixes tho)

The reason i ask for this is, that we use d3js for other charts and drawings then billboard, but we can not upgrade since billboard does not support the new version.

I really appriciate your work on billboard, the sentences above are just my opinion and are not meant as criticism, just as additional input to this conversation which might or might not be helpful.

@netil
Copy link
Member Author

netil commented Dec 7, 2020

@toitzi thanks for sharing.
The needs will differ depending for each use cases, but the upgrade will be inevitable.

For those who needs the support for legacy browser, I wrote a guide documentation on "how to".

I can't give an exact ETA, but hopefully to be done within 1 ~ 2 months.

@netil
Copy link
Member Author

netil commented Jan 15, 2021

Currently I'm working on for d3v6 update and did for basic functionality.
Needs for zooming, subchart & etc.

Maybe it can be out for 2.2.0 release.
Sharing the current status of work who are waiting for the d3v6 updates.

netil added a commit to netil/billboard.js that referenced this issue Jan 19, 2021
@netil netil closed this as completed in 6a8e153 Jan 19, 2021
@netil netil pinned this issue Jan 19, 2021
@netil netil reopened this Jan 20, 2021
@netil
Copy link
Member Author

netil commented Jan 20, 2021

@netil what is your plan regarding this ? Releasing it as part of 2.2 or as a 3.0 release (due to the fact that projects wanting to support IE 11 now need to configure their build tool to transpile d3 packages) ?

Note that I'm fine with it being part of 2.2 (with a clear warning in the release notes) but a strict semver could require making it a major version (depends how you consider the support for IE 11, but the node ecosystem seems to treat dropping support for EOL node.js version as deserving a semver-major)
#1889 (comment)

My initial plan was releasing as part or v2.2, but based on the semver guideline and the possible breaking changes for the support of legacy browsers, it looks more reasonable release as v3.

But, aside of the release version, I want hear broad opinions as possible for the support of d3v6, where main possible difficulties for the users will be the dropping legacy browser(ex. IE11) support.

It's clear that whole JS(Node.js) ecosystem's library going to that direction since a while, so the right direction is going forward. But also there're necessities to cover legacy browser environment.

One of the possible alternative will be,

  • release 2.2 as last version having support of d3v5
  • and v3(will be next release of 2.2) for d3v6

Any best ideas/opinions? @michkami @stof @toitzi

@michkami
Copy link
Collaborator

One of the possible alternative will be,

* release 2.2 as last version having support of d3v5

* and v3(will be next release of 2.2) for d3v6

Any best ideas/opinions? @michkami @stof @toitzi

For me personally it would be ok to update to d3v6 asap but I'm with @stof when it comes to semver as updating to d3v6 is a breaking change (dropping IE support in d3 was also breaking change, they went from 5x to 6).

Also releasing 2.2 without d3v6 update would also help us a lot, as 2.2 has all the bug fixes we need to finally migrate from c3 to billboard. It also gives us some time, to implement the new edge dlls into our rich client application so we can drop internet explorer support for our products asap. In this case 2.2 will be the last release we will use until we manage to drop IE support. (don't worry, I will still spam bug reports and make some contributions in my free time :) )

@toitzi
Copy link

toitzi commented Jan 20, 2021

@netil Personally i also would be ok to update to d3v6 asap, but imho i agree with #1889 (comment), and with @michkami. I think it should be treated as "breaking change" and released with the next major v3 release although i am fine with both.

netil added a commit that referenced this issue Jan 20, 2021
- Update to work on d3 v6
- Added getPoint() to get event's position coordinate

https://github.com/d3/d3/blob/master/CHANGES.md
https://observablehq.com/d/f91cccf0cad5e9cb

Ref #1641
@netil
Copy link
Member Author

netil commented Jan 20, 2021

Thanks @michkami @toitzi for the comments and based on that, it gets more clear to release as the above alternative.

Anyway, who wants test or use d3v6 support version, can download the build by:

npm install git+https://github.com/naver/billboard.js.git#d3v6

@stof
Copy link
Contributor

stof commented Jan 20, 2021

Given that there are already a bunch of fixes planned for 2.2, I would suggest making a 2.2 release containing these fixes, and then a 3.0 release with the d3v6 work just after that.

@michkami not that you can still probably use IE 11 with the newer version, if you take care of 2 steps:

  • configure your build tool to transpile the code for d3 packages (and maybe also for the billboard.js package depending on how 3.0 would be built), as they are shipped with ES6 syntax now (intentionally so that they all break in IE 11 if not transpiled)
  • load the necessary polyfills (for sure, Map and Set are used in d3 packages, maybe some other features)
    AFAICT, d3 v6 does not use any feature that cannot be either transpiled or polyfilled for IE 11.
    Of course, this still means that IE-specific bugs will probably not be fixed by maintainers (but that's true also if you stick to an older release which would not receive any fixes anymore)

netil added a commit that referenced this issue Feb 8, 2021
BREAKING CHANGE:
- Update to work on d3 v6
- Added getPoint() to get event's position coordinate

https://github.com/d3/d3/blob/master/CHANGES.md
https://observablehq.com/d/f91cccf0cad5e9cb

Ref #1641
github-actions bot pushed a commit that referenced this issue Feb 8, 2021
# [3.0.0-next.1](2.2.2...3.0.0-next.1) (2021-02-08)

### Features

* **all:** update for d3 v6 ([2752e55](2752e55)), closes [#1641](#1641)

### BREAKING CHANGES

* **all:** - Update to work on d3 v6
- Added getPoint() to get event's position coordinate

https://github.com/d3/d3/blob/master/CHANGES.md
https://observablehq.com/d/f91cccf0cad5e9cb
@netil
Copy link
Member Author

netil commented Feb 8, 2021

now you can download d3 v6 support version, directly from npm registry by:

npm i billboard.js@next

@netil netil added this to the 3.0 milestone Mar 4, 2021
@clounie
Copy link

clounie commented Mar 9, 2021

Thanks for doing this. Updates like this are definitely big positives in considering whether to use Billboard or C3.

github-actions bot pushed a commit that referenced this issue Mar 26, 2021
# [3.0.0](2.2.6...3.0.0) (2021-03-26)

### Bug Fixes

* **axis:** fix axis.x.max error throw ([de06361](de06361)), closes [#1981](#1981)
* **axis:** fix axis.x.tick.tooltip on rotated axis ([eed2f86](eed2f86)), closes [#1990](#1990)
* **subchart:** fix duplicated node generation on data load ([d9a5d9a](d9a5d9a)), closes [#2003](#2003)
* **zoom:** fix zoom on latest chrome ([37edc9b](37edc9b)), closes [/github.com/d3/d3-zoom/issues/231#issuecomment-802305692](https://github.com//github.com/d3/d3-zoom/issues/231/issues/issuecomment-802305692) [#1992](#1992)

### Features

* **all:** update for d3 v6 ([2752e55](2752e55)), closes [#1641](#1641)
* **api:** Enhance .export() option to specify size ([3c2de80](3c2de80)), closes [#815](#815) [#1969](#1969)
* **api:** Intent to ship subchart APIs ([5572dc9](5572dc9)), closes [#1993](#1993)
* **candlestick:** Intent to ship candlestick ([8d37bd8](8d37bd8)), closes [#76](#76) [#1167](#1167)
* **candlestick:** Intent to ship candlestick type ([42307cb](42307cb))

### BREAKING CHANGES

* **all:** - Update to work on d3 v6
- Added getPoint() to get event's position coordinate

https://github.com/d3/d3/blob/master/CHANGES.md
https://observablehq.com/d/f91cccf0cad5e9cb
@netil netil closed this as completed Mar 26, 2021
@netil netil unpinned this issue May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants