svg-to-geojson icon indicating copy to clipboard operation
svg-to-geojson copied to clipboard

Maintenance: Upgrade to React v16

Open fahad19 opened this issue 6 years ago • 4 comments

Currently

Our API of frint-react is based on the context API of React v15.

React v16 still supports the old (v15) context API in deprecated mode, but also makes room for additional improvements.

It has also introduced APIs like getDerivedStateFromProps , making way for better async rendering (while also deprecating componentWillReceiveProps).

Proposal

We already have some additional proposals which make the API of FrintJS more simpler and stays close to the Component lifecycle where possible. Making it even easier to migrate to React v16:

  • [ ] #424: Access to app instance synchronously
  • [x] #428: Region component with render prop support
  • [ ] #433: MountApp component
  • [x] #436: Pass Region's props to Child Apps' root Components directly

While migrating to React v16, we can:

  • Drop observe HoC
  • Drop data prop in Region component
  • Drop RegionService

Because parent props as a stream would be difficult to access, since componentWillReceiveProps is already deprecated and will be gone in React v17.

It will have to be a breaking change.

fahad19 avatar Jul 16 '18 12:07 fahad19

Sounds cool :) I'm working on this now... Please let me know if anyone else is interested. Is this project "dead"??

I'm trying to make frintjs work with atomico which uses reactive custom elements (aka web components) and seems a more modern and natural fit for frintjs.

Would much appreciate some advice for how to make a frint adapter for custom elements

kristianmandrup avatar Feb 02 '20 20:02 kristianmandrup

Hey @kristianmandrup,

Thanks for the interest!

I don't work at the same company any more, therefore not actively maintaining this project. Feature-wise, the project is complete. And nothing more is intended to be added. Except for maintenance, upgrades, etc.

If it is reactive components that you are after, agnostic of any specific components library, you can check out another project of mine here: https://proppyjs.com/

fahad19 avatar Feb 03 '20 12:02 fahad19

Hi @fahad19 , thanks for replying so quickly. I thought as much, that the project is "done and dusted" for now. Could be good to at least update the deps to React 16.x and perhaps convert it to TS. I've started this in my fork.

I'll check out proppyjs as suggested. Have you looked at MeiosisJS by any chance?

I saw that you mentioned there was no need for observe HoC with React 16. This would make it much easier to wrap other rendering engines I believe. Was exactly my concern when I was trying to wrap a render function, rendering VDOM or even DOM elements directly as output, without any "life cycle" logic (except for hooks perhaps).

Do you have any suggestion for how a "modern" wrapper interface might look like?

  • Drop observe HoC
  • Drop data prop in Region component
  • Drop RegionService

How could FrintJS best support both variants? make these optional?

Cheers

kristianmandrup avatar Feb 03 '20 15:02 kristianmandrup

Do you have any suggestion for how a "modern" wrapper interface might look like?

@kristianmandrup: I explored some radically different ideas before here: https://github.com/frintjs/frint/issues/415

may help.

Could be good to at least update the deps to React 16.x and perhaps convert it to TS.

PRs welcome :)

I am sure I can bring in folks like @rbardini to help out with the release.

How could FrintJS best support both variants? make these optional?

I always saw the entire project very decoupled. If you look at the core frint package, it's really nothing much more than a DI container library.

If someone wants to take a different direction with the same core principles supporting new rendering libraries (or even existing ones with different APIs), you are completely free to do so.

Just create new frint-* packages :D

fahad19 avatar Feb 03 '20 17:02 fahad19