Closed vyemialyanchyk closed 7 years ago
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!
@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
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...
@Knacktus yes exactly the same problem,
I'm using MobX with React integration. State can be changed but no updates occur.
@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"
]
@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.
What is the difference between "babel-plugin-transform-decorators-legacy2"
and ""babel-plugin-transform-decorators-legacy"
? Can someone produce a minimal reproduction project?
@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.
Note that you still need transform-decorators-legacy
. Would you mind
creating a small reproduction repo? I upgraded a babel / webpack project to
the same versions but couldn't reproduce the problem
Op vr 30 jun. 2017 om 09:01 schreef vyemialyanchyk <notifications@github.com
:
@mweststrate https://github.com/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.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx/issues/1066#issuecomment-312191472, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhNlEtY7hnTxgCwGc6_17mykdYCSyks5sJJ0sgaJpZM4OGhgl .
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?
@vyemialyanchyk, https://github.com/mobxjs/mobx-react-todomvc
one, first glance difference: in my case all files with .ts and .tsx extensions...
@andykog also, from the second glance: in the example project I do not see
import { action } from 'mobx/lib/mobx';
action use
You should not be importing from mobx/lib
, but always from 'mobx`.
Probably you are using some VS code extension that produces the wrong
imports...
Op vr 30 jun. 2017 om 16:29 schreef vyemialyanchyk <notifications@github.com
:
@andykog https://github.com/andykog also, from the second glance: in the example project I do not see import { action } from 'mobx/lib/mobx';action use
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx/issues/1066#issuecomment-312282336, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhCCsNF-sCiCmRlwAhkLvH0M8q2d4ks5sJQZIgaJpZM4OGhgl .
Resulting in MobX being bundled twice?
Op vr 30 jun. 2017 om 16:33 schreef Michel Weststrate <mweststrate@gmail.com
:
You should not be importing from
mobx/lib
, but always from 'mobx`. Probably you are using some VS code extension that produces the wrong imports...Op vr 30 jun. 2017 om 16:29 schreef vyemialyanchyk < notifications@github.com>:
@andykog https://github.com/andykog also, from the second glance: in the example project I do not see import { action } from 'mobx/lib/mobx';action use
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx/issues/1066#issuecomment-312282336, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhCCsNF-sCiCmRlwAhkLvH0M8q2d4ks5sJQZIgaJpZM4OGhgl .
Thats why a asked @vyemialyanchyk to try mobx.extras.shareGlobalState()
check!
great! thank you.
import { ... } from 'mobx/lib/mobx';
replace to
import { ... } from 'mobx';
and mobx 3.1.16 workable.
Version 3.2 will warn about this in the future (if all mobx versions are on 3.2+)
Welcome to MobX. Please provide as much relevant information as possible!
I have a:
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.