mobx: App broken after upgrading mobx to 2.3.1

Hi,

after upgrading mobx to 2.3.1 from 2.2.2 my app is somehow broken. Simple autoruns dont work and components are not reactive anymore. It has been discussed at gitter and this issue should keep attention on this as long as is needed.

Project is at https://github.com/otbe/dwatch/tree/mobx-2.3.1 Just npm i and npm run test. One test will fail, because it relies heavily on autorun().

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (13 by maintainers)

Commits related to this issue

Most upvoted comments

It’s still not always working correctly.

import { action } from "mobx";

function test() {
  class App {
    @action fun = () => {
      "undecorated";
    }
  }
  const a = new App()
  console.log(a.fun.toString());
}

test()
import "reflect-metadata"
test()

will return

function () {
        return executeAction(actionName, fn, this, arguments);
    }
function () {
                "undecorated";
            }

first run is ok, second not

Looked into it and it looks like argument length check is not doing it’s job, because classPropertyDecorator is called with 4 arguments regardless of decorator arguments.

I did 😃