MapStore2 icon indicating copy to clipboard operation
MapStore2 copied to clipboard

Plan and estimate libs updates

Open offtherailz opened this issue 6 years ago • 7 comments

Description

We need to evaluate some libs updates. This because:

  • Old documentation is missing or going to be dismissed
  • New feature and syntax are used and documented well, and used around the world

Here a list of the libs that need an update:

  • [x] React 16 (17): need to check what dependencies have to be updated (Some depending libs did not updated to react 16). 17 (still in alpha) has breaking changes that need a big refactor
  • [ ] Redux-Observable Need an update more for RxJS doc issues. See troubleshooting to check how to
    • RxJS: documentation is going to disappear (now is hard to find, expecially for rxjs) and the lib became fully functional. We can use old code with compatibility tier 'rxjs-compat' while start using new syntax. See guide
    • Redux: needed to have to redux-observable new feature
  • [ ] React Bootstrap - Missing doc
    • Bootstrap 4 (used in beta): to analyze. Probably very hard
  • [x] openlayers 5: we re at 4.6.4
  • [x] babel 7: needed for code splitting?
  • [ ] JSDOC/Docma: Need to fix issue with links to specific file document and allow to support new syntax. We may decide to skip docma in favor of simple jsdoc ,now that markdown doc is separated
  • [ ] recompose: We need to deprecate usage of this in favor of hooks and try to exclude it somehow.
  • [ ] Testing libs Migrate to Jest to speed up tests writing and simplify maintainance. A first PR to migrate to recente expect lib (sub-set of jest) is here

offtherailz avatar Feb 14 '19 11:02 offtherailz

For React 16 / 17, we surely need to check the following ones (from React 15.5 migration):

  • react-pdf (commits on master, no release yet)
  • react-widgets (PR on master, no release yet)
  • react-selectize
  • ag-grid (we are removing it)
  • react-nouislider (We can do a PR and wait for merge - release, not difficult)
  • react-router (migrated to 4.x)
  • react-sortable-items

mbarto avatar Feb 14 '19 13:02 mbarto

For OpenLayers 5:

  • if we continue using the CDN version the migration is trivial (@allyoucanmap already did it in a custom project, with a couple of fixes)
  • if we want to move to ES6 modules, the effort is bigger

mbarto avatar Feb 14 '19 13:02 mbarto

Did a first experiment of upgrading to React 16.8.4. It looks most of it is working (not tried to run tests yet).

Available here: https://github.com/geosolutions-it/MapStore2/tree/react_16

Succesfully migrated:

  • React / ReactDOM (16.8.4)
  • Babel (7.2.2)
  • Webpack (4.29.3)
  • react-redux (6.0.0)

Had to update also (to be compatible with React 16):

  • qrcode.react
  • react-color
  • react-nouislider
  • react-overlays
  • connected-react-router (used instead of react-router-redux)
  • react-selectize
  • react-widgets
  • reselect
  • react-sortable-items (created 16.x version on our fork)
  • react-pdf

Had to update also (to be compatible with webpack 4):

  • babel-loader
  • json-loader
  • copy-webpack-plugin
  • mini-css-extract-plugin (used instead of extract-text-webpack-plugin)
  • postcss, postcss-loader, postcss-prefix-selector
  • webpack-dev-server
  • webpack-parallel-uglify-plugin
  • webpack-cli (new)

Had to update also (for tests):

  • karma
  • ag-grid -> ag-grid-community + ag-grid-react
  • istanbul-instrumenter-loader
  • jsonix --> @boundlessgeo/jsonix

Could not update (without a refactor of the current code):

  • Recompose (dead project)
  • redux-observable (to 1.x) due to dependency to RxJS 6, succesfully upgraded to 0.19.0
  • RxJS 6 (due to incompatible API)
  • Redux (to 4.x) due to incompatibilities with redux-observable

Not tried other migrations.

mbarto avatar Mar 27 '19 09:03 mbarto

About libs that can not be updated:

  • Redux, RxJS redux-observable: did you try rxjs-compat ? It should keep compatibility with old API
  • Recopose: Future compatibility will be maintained. No new features, to encourage the usage of hooks

offtherailz avatar Mar 27 '19 10:03 offtherailz

@offtherailz I tried rxjs-compat, but I couldn't make it work in any way. If you want to do further testing, please do it. About recompose: what I found was an incompatibility with RxJS 6, and I don't think those kind of things will be implemented, but I would be happy if they will.

mbarto avatar Mar 27 '19 10:03 mbarto

@mbarto Ok, thanks for clarification, now I understood

offtherailz avatar Mar 27 '19 11:03 offtherailz

My estimate for React16 update is 13 points

mbarto avatar Apr 04 '19 13:04 mbarto