Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Multiple instances of mobx in the UI #2461

Closed
aptmac opened this issue Mar 5, 2018 · 9 comments
Closed

Multiple instances of mobx in the UI #2461

aptmac opened this issue Mar 5, 2018 · 9 comments

Comments

@aptmac
Copy link
Collaborator

aptmac commented Mar 5, 2018

When running unit tests in the UI, I've been seeing the following warning:

2018-03-05-162908_1440x116_scrot

PhantomJS 2.1.1 (Linux 0.0.0) WARN: '[mobx] Warning: there are multiple mobx instances active. This might lead to unexpected results. See mobxjs/mobx#1082 for details.'

There are supposedly multiple instances of mobx running, and I just wanted to verify if this is intended/proper behaviour.

From rolling back commits, it appears this was introduced with the latest app-launcher commit [0]. There are some potential solutions provided by the mobx issue [1]. After a bit of digging, mobx is a dependency of angular-tree-component [2], which is a dependency for patternfly-ng.

[0] fabric8-ui/fabric8-ui@f91cb7b
[1] mobxjs/mobx#1082
[2] https://github.com/500tech/angular-tree-component/blob/master/package.json#L67

@joshuawilson
Copy link
Member

@dlabrecq this looks like a question for you.

@dlabrecq
Copy link
Collaborator

dlabrecq commented Mar 6, 2018

The Planner UI uses TreeList from patternfly-ng, which is a wrapper for angular-tree-component. The app-launcher only uses the toolbar and a truncation pipe from patternfly-ng. Will try to dig into it

@dlabrecq
Copy link
Collaborator

dlabrecq commented Mar 6, 2018

I believe there is a problem with how ngx-forge is built. I see a ngx-forge.js bundle with its own copy of patternfly-ng. The package.json also defines "module": "bundles/ngx-forge.js" -- that probably should be index.js.

This appears to be why the platform build is slower. Instead of the build completing in 7:30, it only takes about 2:30 with the index.js change. Unfortunately, the tests fail to compile, so we'll have to work on a fix for that, too

@dlabrecq
Copy link
Collaborator

dlabrecq commented Mar 6, 2018

I believe this PR will resolve the warning.
fabric8-ui/fabric8-ui#2610

@aptmac
Copy link
Collaborator Author

aptmac commented Mar 6, 2018

I'm still seeing a mobx warning, but that PR has made the build time much shorter.

@dlabrecq
Copy link
Collaborator

dlabrecq commented Mar 6, 2018

In that case, this is an issue with how ngx-forge.js is bundled. See: fabric8-launcher/ngx-launcher#93

@aptmac
Copy link
Collaborator Author

aptmac commented Mar 6, 2018

Great, thanks for looking into this!

@gastaldi
Copy link
Member

gastaldi commented Mar 7, 2018

@edewit any thoughts?

@edewit
Copy link
Member

edewit commented Mar 7, 2018

I'm fine with moving the asciidoctor stuff back to launch created issue 129 to track that

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

No branches or pull requests

5 participants