Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mobx from 3.1.12 to 3.1.16 stops work as expected #1066

Closed
6 tasks done
vyemialyanchyk opened this issue Jun 27, 2017 · 19 comments
Closed
6 tasks done

mobx from 3.1.12 to 3.1.16 stops work as expected #1066

vyemialyanchyk opened this issue Jun 27, 2017 · 19 comments

Comments

@vyemialyanchyk
Copy link

vyemialyanchyk commented Jun 27, 2017

Welcome to MobX. Please provide as much relevant information as possible!

I have a:

  1. Issue:
  • Provide error messages including stacktrace
    no error messages in browser, primary browser is Chrome in IE 11 the same problem
  • Provide a minimal sample reproduction. create a reproduction based on this codesandbox
    I've attached screenshot from my TortoiseWorkbench, only updated files in not workable configuration
  • Did you check this issue wasn't filed before?
    the issue is reproducible starting from 3.1.12, i.e. I've checked all versions 3.1.12, 3.1.13, 3.1.14, 3.1.15, 3.1.16
    delete
    package-lock.json and node_modules folder, then
    npm install
    npm run ...
  • Elaborate on your issue. What behavior did you expect?
    I expect MobX workable as in versions 3.1.10 and 3.1.11
  • State the versions of MobX and relevant libraries. Which browser / node / ... version?
    all such infor presented here

I've did renew libraries dependances for my frontend project which use React, MobX, TypeScript, Webpack.
I updated
react from 15.5.4 to 15.6.1
and
mobx from 3.1.10 to 3.1.16
My project start to work incorrectly. I.e. it display initial page and that is it. Even login input field stops work.
I spent 2 days to locate the reason. The reason is mobx version update.
mobx 3.1.11 is workable.
mobx from 3.1.12 to 3.1.16 not workable releases. 3.1.12-3.1.13 I can't even build/run my application.

I've attached screenshot which prove the reason is only mobx not other libs dependences.

mobix-3 1 12-3 1 16-bug-locate

@Knacktus
Copy link

Knacktus commented Jun 28, 2017

Same here. I haven't checked all previous versions but can confirm that 3.1.11 works whereas 3.1.16 doesn't seem to trigger updates. I'm using MobX with React integration. State can be changed but no updates occur.

@vyemialyanchyk: Thanks, you've saved me a lot of time!

@andykog
Copy link
Member

andykog commented Jun 28, 2017

@vyemialyanchyk have you tried to update mobx-react package as well? Could you share npm ls depth=1 output?
Doesn't mobx.extras.shareGlobalState() help, by any chance?
May be related to #1027

@vyemialyanchyk
Copy link
Author

I used
"mobx-react": "4.2.1",
which is latest version.
In my project it was updated 4 weeks ago from version 4.1.8, i.e. mobx-react is not a reason, I think.
I provided screenshot with exact files in project, which were updated, and mobx stoped work...

npm ls depth=1
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "depth=1": Tags may not have any characters that encodeURIComponent encodes.

Doesn't mobx.extras.shareGlobalState() help, by any chance?
May be related to #1027

checking...

@vyemialyanchyk
Copy link
Author

@Knacktus yes exactly the same problem,

I'm using MobX with React integration. State can be changed but no updates occur.

@vyemialyanchyk
Copy link
Author

vyemialyanchyk commented Jun 28, 2017

@andykog this is snippet from configuration:

package.json

...
		"babel-core": "6.24.1",
		"babel-eslint": "7.2.3",
		"babel-loader": "7.0.0",
		"babel-plugin-transform-class-properties": "6.24.1",
-----		"babel-plugin-transform-decorators-legacy2": "1.3.5", -- removed
		"babel-preset-es2015": "6.24.1",
		"babel-preset-react": "6.24.1",
		"babel-runtime": "6.23.0",
		"babili-webpack-plugin": "0.1.1",
		"mobx-react-devtools": "4.2.13",
		"webpack": "2.6.1",
		"webpack-bundle-analyzer": "2.8.2",
		"webpack-dev-server": "2.4.5"
...

.babelrc:

	"presets": [
		"react",
		"es2015"
	],
	"plugins": [
-----		"transform-decorators-legacy2", -- removed
		"transform-class-properties"
	]

@vyemialyanchyk
Copy link
Author

@andykog
mobx.extras.shareGlobalState()
is something what after mobX 3.0.0 per this doc from google:
http://admin.mysocialreach.net/ng2/node_modules/angular2-tree-component/node_modules/mobx/CHANGELOG.md

I used practically all latest versions of libs, 1 month ago all was updated.
MobX 3.1.10 and 3.1.11 works as expected. So do not see a sense with
mobx.extras.shareGlobalState().

I had classes with properties marked as
@observable & @computed in file1.tsx for example
and React component with
@observer
in file2.tsx for example.
This was working in 3.1.10 and working in 3.1.11.

@mweststrate
Copy link
Member

What is the difference between "babel-plugin-transform-decorators-legacy2" and ""babel-plugin-transform-decorators-legacy"? Can someone produce a minimal reproduction project?

@vyemialyanchyk
Copy link
Author

@mweststrate please disregard transform-decorators-legacy2 I've removed this from the config, now this have no sense for the project, this was a legacy old setting. The problem with 3.1.16 persist.

@mweststrate
Copy link
Member

mweststrate commented Jun 30, 2017 via email

@vyemialyanchyk
Copy link
Author

That working without transform-decorators-legacy and transform-decorators-legacy2.. @mweststrate , can you share your small test project example, so I'll try to update it, so get problem reproducible?

@andykog
Copy link
Member

andykog commented Jun 30, 2017

@vyemialyanchyk
Copy link
Author

one, first glance difference: in my case all files with *.ts and *.tsx extensions...

@vyemialyanchyk
Copy link
Author

@andykog also, from the second glance: in the example project I do not see
import { action } from 'mobx/lib/mobx'; action use

@mweststrate
Copy link
Member

mweststrate commented Jun 30, 2017 via email

@mweststrate
Copy link
Member

mweststrate commented Jun 30, 2017 via email

@andykog
Copy link
Member

andykog commented Jun 30, 2017

Thats why a asked @vyemialyanchyk to try mobx.extras.shareGlobalState()

@mweststrate
Copy link
Member

check!

@vyemialyanchyk
Copy link
Author

great! thank you.
import { ... } from 'mobx/lib/mobx';
replace to
import { ... } from 'mobx';
and mobx 3.1.16 workable.

@mweststrate
Copy link
Member

Version 3.2 will warn about this in the future (if all mobx versions are on 3.2+)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants