kitze / mobx-router

A simple router for MobX + React apps
509 stars 66 forks source link

Remove all mobx annotations for compatibility with mobx 6 #114

Closed rdgco closed 3 years ago

rdgco commented 3 years ago

This is attempt number 1 at upgrading mobx-router to the latest default conventions for mobx. This is working fine for me using mobx 6.3.3 and react 17, but my usage and testing may be limited.

The latest default mobx configuration removes all usage of annotations for observable, observer, computed, and actions. This is replaced by either wrapping functions with the function call or calling makeObservable in a class constructor.

This addresses the issues brought up here: https://github.com/kitze/mobx-router/issues/106.

thdk commented 3 years ago

Hi @rdgco I just published a version 1.0.0 of mobx-router that should have support for mobx-6. Seems I forgot to push it to the master branch though :(

rdgco commented 3 years ago

Hi @thdk, sounds good. Is there a PR? I'd be interested to compare and learn.

Hi @rdgco I just published a version 1.0.0 of mobx-router that should have support for mobx-6. Seems I forgot to push it to the master branch though :(

thdk commented 3 years ago

Hi @thdk, sounds good. Is there a PR? I'd be interested to compare and learn.

Hi @rdgco I just published a version 1.0.0 of mobx-router that should have support for mobx-6. Seems I forgot to push it to the master branch though :(

See the latest commit on the master branch 4fafdb4286f12eaef11700624567ad378aab0dc1.

Unfortunately it contains also linting and formatting changes (my bad) so its a bit ugly.

I mainly followed the mobx upgrade guide with the additional remarks for typescript projects.

Let me know if anything is unclear or does not work as expected.