cytoscape.js icon indicating copy to clipboard operation
cytoscape.js copied to clipboard

Cytoscape v4 -- planning for breaking API changes

Open maxkfranz opened this issue 8 years ago • 5 comments

Brainstorming of improvements that would cause breaking changes for a potential, future v4:

Modernising:

  • [ ] Add support for ESM bundles referenced by package.json. This breaks support for CJS code that is bundled by Webpack. See also exports (e.g. is-promise).
  • [ ] Remove internal polyfills. If you want to support old browsers that are missing these objects, use a polyfill like core-js. Note which objects in the stdlib need polyfilling: Promise, Set, Map, etc.
  • [ ] Use browser-friendly module links #2661
  • [ ] Use Rust/WASM for increased performance (e.g. threading) #2799
  • [ ] Use WebGL #2798

Improving formatting & naming:

  • [ ] ele.json() returns classes as an array
  • [ ] Make percent values be specified on [0, 1] when no units are specified, e.g. 0.5 is the same as 50%. In v3, if you specify 0.5, you will get 0.5%.
  • [ ] Make the { nodes: [], edges: [] } elements JSON format no longer the default for cy.json() export. Instead use, the plain array format.
  • [ ] Rename the core selector to cy, by default. The core value should still work, but it won't be returned by cy.json().

Improved defaults:

  • Set the default <position>-arrow-width value to match-line (previously 1px) (#3194 #3191)

Removing deprecated features & other mistakes:

  • [ ] Remove cy.forceRender(). Deprecated long ago.
  • [ ] Remove ele.renderedStyle() (Deprecated in #2223)
  • [ ] Remove cy.batchData(). Deprecated long ago.
  • [ ] Don't set concentric scratch values when running the concentric layout. The programmer can store values themselves.
  • [ ] Remove support for event namespaces. It's not all that useful and it adds complexity.
  • [ ] Remove non-JSON style formats and revise cy.style() to only be a JSON setter. Ref: https://github.com/cytoscape/cytoscape.js/issues/2637#issuecomment-600734097
  • [ ] Remove width: label and height: label. Ref. #2713

Moving features to external extensions or libraries:

  • [ ] Remove cose from the core bundle and make it an external extension. The force-directed layout that a programmer should choose by default is fcose.
  • [ ] Remove selectionType: 'additive' from the core lib and turn it into an extension

maxkfranz avatar Nov 10 '17 21:11 maxkfranz

ele.json() returns classes as an array

Does this mean that it would include classes as well as other data?

Is there any way currently to get the list of classes an element has?

pmackay avatar Jan 31 '18 11:01 pmackay

Does this mean that it would include classes as well as other data?

classes: ['foo', 'bar'] versus classes: 'foo bar'

Is there any way currently to get the list of classes an element has?

ele.json().classes

maxkfranz avatar Jan 31 '18 14:01 maxkfranz

Since a class is a concept in Javascript now, maybe it's better to use classNames? Ecosystem seems to be standardising on this.

StevenLangbroek avatar Mar 13 '18 11:03 StevenLangbroek

Yes, but that wouldn't have to be a breaking (v4) change. The old key could still be supported.

Edit: We may want to use ele.classNames() with the ideal signature in v3 and then in v4 make a breaking change so that ele.classes() matches ele.classNames(). See #2110

maxkfranz avatar Mar 13 '18 14:03 maxkfranz

This issue is for discussing v4 API -- i.e. breaking API changes. If you have a general feature in mind that is additive w.r.t. API, then feel free to make an ordinary feature request and the corresponding pull request.

maxkfranz avatar Dec 19 '19 19:12 maxkfranz