[FOLIO-1707] platform-complete webpack build is broken Created: 16/Jan/19 Updated: 03/Jun/20 Resolved: 16/Jan/19 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | P3 |
| Reporter: | Wayne Schneider | Assignee: | Matthew Jones |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue links: |
|
||||||||||||||||
| Sprint: | |||||||||||||||||
| Description |
|
Currently, a build of platform-complete results in most (all?) apps displaying an error page: Jeffrey Cherewaty points out that the dependency on platform-core expressed in the platform-complete package.json file resolves to an old npm package of platform core (v1.1.1) when using the npm-folioci repo (see
|
| Comments |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
The old platform-core may be causing grief for platform-complete, but we still have build issues with platform-core#snapshot in isolation. This appears to be due to multiple versions of stripes-* modules unexpectedly leaking into the build. The build provides warnings for this, but they should be errors. Errors would have failed the build catching this slightly sooner. Its a simple configuration change to switch that, but either way we still have the issue. WARNING in @folio/stripes-components
Multiple versions of @folio/stripes-components found:
4.5.1000698 ./~/@folio/stripes-components
5.0.1000700 ./~/@folio/stripes/~/@folio/stripes-smart-components/~/@folio/stripes-form/~/@folio/stripes-components
WARNING in @folio/stripes-core
Multiple versions of @folio/stripes-core found:
2.17.1000488 ./~/@folio/stripes-core
3.0.1000489 ./~/@folio/stripes-connect/~/@folio/stripes-core
WARNING in @folio/stripes-form
Multiple versions of @folio/stripes-form found:
1.2.100039 ./~/@folio/stripes/~/@folio/stripes-form
1.3.100040 ./~/@folio/stripes/~/@folio/stripes-smart-components/~/@folio/stripes-form
|
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Looking into the yarn why output for stripes-components: $ yarn why @folio/stripes-components yarn why v1.12.3 warning package.json: "dependencies" has dependency "react" with range "^16.6.3" that collides with a dependency in "devDependencies" of the same name with version "~16.6.0" warning package.json: "dependencies" has dependency "react-dom" with range "^16.6.3" that collides with a dependency in "devDependencies" of the same name with version "~16.6.0" warning package.json: "dependencies" has dependency "react-redux" with range "^5.1.1" that collides with a dependency in "devDependencies" of the same name with version "~5.1.1" warning package.json: "dependencies" has dependency "redux" with range "^3.7.2" that collides with a dependency in "devDependencies" of the same name with version "~3.7.2" [1/4] Why do we have the module "@folio/stripes-components"...? [2/4] Initialising dependency graph... warning @folio/platform-core@1.1.2-SNAPSHOT: "dependencies" has dependency "react" with range "^16.6.3" that collides with a dependency in "devDependencies" of the same name with version "~16.6.0" warning @folio/platform-core@1.1.2-SNAPSHOT: "dependencies" has dependency "react-dom" with range "^16.6.3" that collides with a dependency in "devDependencies" of the same name with version "~16.6.0" warning @folio/platform-core@1.1.2-SNAPSHOT: "dependencies" has dependency "react-redux" with range "^5.1.1" that collides with a dependency in "devDependencies" of the same name with version "~5.1.1" warning @folio/platform-core@1.1.2-SNAPSHOT: "dependencies" has dependency "redux" with range "^3.7.2" that collides with a dependency in "devDependencies" of the same name with version "~3.7.2" [3/4] Finding dependency... [4/4] Calculating file sizes... => Found "@folio/stripes-components@4.5.1000698" info Has been hoisted to "@folio/stripes-components" info Reasons this module exists - Hoisted from "@folio#stripes-core#@folio#stripes-components" - Hoisted from "@folio#stripes#@folio#stripes-components" - Hoisted from "@folio#stripes#@folio#stripes-form#@folio#stripes-components" - Hoisted from "@folio#stripes#@folio#stripes-smart-components#@folio#stripes-components" info Disk size without dependencies: "8.05MB" info Disk size with unique dependencies: "39.22MB" info Disk size with transitive dependencies: "75.79MB" info Number of shared dependencies: 51 => Found "@folio/stripes-cli#@folio/stripes-components@5.0.1000700" info Reasons this module exists - "@folio#stripes-cli#@folio#stripes-core" depends on it - Hoisted from "@folio#stripes-cli#@folio#stripes-core#@folio#stripes-components" info Disk size without dependencies: "7.79MB" info Disk size with unique dependencies: "38.96MB" info Disk size with transitive dependencies: "75.53MB" info Number of shared dependencies: 51 => Found "@folio/stripes-connect#@folio/stripes-components@5.0.1000700" info Reasons this module exists - "@folio#stripes-connect#@folio#stripes-core" depends on it - Hoisted from "@folio#stripes-connect#@folio#stripes-core#@folio#stripes-components" info Disk size without dependencies: "7.79MB" info Disk size with unique dependencies: "38.96MB" info Disk size with transitive dependencies: "75.53MB" info Number of shared dependencies: 51 => Found "@folio/stripes-smart-components#@folio/stripes-form#@folio/stripes-components@5.0.1000700" info Reasons this module exists - "@folio#stripes#@folio#stripes-smart-components#@folio#stripes-form" depends on it - Hoisted from "@folio#stripes#@folio#stripes-smart-components#@folio#stripes-form#@folio#stripes-core#@folio#stripes-components" Done in 2.38s. |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Given this snippet from the why output: => Found "@folio/stripes-connect#@folio/stripes-components@5.0.1000700" info Reasons this module exists - "@folio#stripes-connect#@folio#stripes-core" depends on it - Hoisted from "@folio#stripes-connect#@folio#stripes-core#@folio#stripes-components" I wonder if the relaxed version range within stripes-connect has something to do with it. "@folio/stripes-core": "^2.15.0 || ^3.0.0", This was chosen in part to help facilitate the transition and deal with a circular dependency that exists within the stripes-* modules. However, it would seem that the version range is acting greedy, pulling in 3.x of core and in turn, 5.x of components, when not necessary. |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
Matthew Jones I can tag a new stripes-connect to resolve that. Should we lock in platform-core's stripes-cli with a ~ instead of >= too? |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
Wait but why was that newer stripes-connect in there |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Good question... We did expect some issues in snapshot to surface during the rollout (in terms of ui-* module peerDependency warnings), but not this mixing of multiple stripes modules. Come to think of it, should our stripes-* depend on each other as peerDependencies? This may be the fundamental issue. For instance, ui-users will pull in whatever stripes framework it was given because of the peerDependency is fulfilled by the platform. Further, any import for stripes-* by ui-modules must go through the framework ensuring all apps use the same version. Stripes modules however, have direct dependencies on each other and it seems that those links may be where the multiple versions are sneaking in. Here is the yarn why for connect: => Found "@folio/stripes-connect@3.4.100059" info Has been hoisted to "@folio/stripes-connect" info Reasons this module exists - Hoisted from "@folio#stripes-core#@folio#stripes-connect" - Hoisted from "@folio#stripes#@folio#stripes-smart-components#@folio#stripes-connect" - Hoisted from "@folio#stripes-cli#@folio#stripes-core#@folio#stripes-connect" - Hoisted from "@folio#stripes-connect#@folio#stripes-core#@folio#stripes-connect" - Hoisted from "@folio#stripes#@folio#stripes-smart-components#@folio#stripes-form#@folio#stripes-core#@folio#stripes-connect" info Disk size without dependencies: "10.64MB" info Disk size with unique dependencies: "19.08MB" info Disk size with transitive dependencies: "327.66MB" info Number of shared dependencies: 332 => Found "@folio/stripes#@folio/stripes-connect@3.3.100058" info This module exists because "@folio#stripes" depends on it. info Disk size without dependencies: "212KB" info Disk size with unique dependencies: "8.64MB" info Disk size with transitive dependencies: "317.22MB" info Number of shared dependencies: 332 The framework has the correct version, but the other stripes-* modules do not. |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
But still, those stripes-* modules should be originating from within stripes framework and therefore we should have all the versions locked down accordingly. |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Oh but wait, stripes-connect 3.4, not being a major version change, can be fulfilled by any carat ^ version ranges requested of it by other stripes-* modules. Jeffrey Cherewaty that must be it. |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
What if we did this with `stripes-cli`?
I think that might stop the newer stripes-core and its resulting cascade from coming in. |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
I don't think that will be the culprit. The CLI has logic to detect and use the ui-module or platform's version of stripes-core rather than its own, for performing builds. Effectively, the CLI will only use its own copy of stripes-core, when no other stripes-core is present (for example, building a brand new app with a global install of the CLI) |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
|
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
I'm doing some more tests, but it looks like stripes-form1.3, not being a major version bump, could equally suffer from the same carat ^ version range issue when requested by other stripes-* modules, allowing its dependency of stripes-components 5.0 to leak. |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Okay, if I lock stripes-connect and stripes-form to their previously published minor versions, my local platform-core builds without any duplicate stripes warnings and appears to render the application without trouble. I did this by adding the following yarn resolutions to platform-core's package.json to simulate rolling back: "resolutions": { "@folio/stripes-connect": "~3.3.1", "@folio/stripes-form": "~1.2.0" } Yarn why still reports duplicates on disk due to stripes-cli allowing for stripes-core 3.x. However, I'm confident the CLI is not pulling in its own copy stripes-core for generating bundles. Long before stripes framework came about, the possible discrepancy of stripes-core version between the CLI and ui-module/platform being built had surfaced. This was address by
|
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
Cool, I'm going to make these PRs/tags: stripes-connect 3.4.1 (reversion) and 4.0.0 |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
https://github.com/folio-org/stripes-connect/pull/70 and https://github.com/folio-org/stripes-form/pull/44 should resolve this when tagged and published. Then I'll make the new major version bumps when confirmed. |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Awesome. FYI, in npm-folioci-speak, the affected artifact versions are: stripes-connect 3.4.100059 stripes-form 1.3.100040 The corrected versions are: stripes-connect 3.4.100060 stripes-form 1.3.100041 I'm running a build with them now. |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
Still getting: |
| Comment by Matthew Jones [ 16/Jan/19 ] |
|
Yes, that's expected because yarn why is only looking at what is available on disk. The duplicate checker plugin will confirm whether or not a duplicate module was pulled into the bundle. In this case, stripes-core is not duplicated. There is, however, one duplicate stripes-form warning upon build: WARNING in @folio/stripes-form
Multiple versions of @folio/stripes-form found:
1.2.100039 ./~/@folio/stripes/~/@folio/stripes-form
1.3.100041 ./~/@folio/stripes/~/@folio/stripes-smart-components/~/@folio/stripes-form
This can be attributed to the stripes framework locking down stripes-form at 1.2.x and smart-components accepting minor version changes. => Found "@folio/stripes-form@1.2.100039" info Reasons this module exists - "@folio#stripes" depends on it - Hoisted from "@folio#stripes#@folio#stripes-form" => Found "@folio/stripes-smart-components#@folio/stripes-form@1.3.100041" info This module exists because "@folio#stripes#@folio#stripes-smart-components" depends on it. The good news is that those two versions, 1.2.100039 and 1.3.100041, should be equivalent with the latter reflecting the rollback. I've installed the latest updates with platform core and aside from that warning everything appears to run fine. |
| Comment by Jeffrey Cherewaty [ 16/Jan/19 ] |
|
Makes sense, yeah, it's fine that those are just on the disk. Major version PRs open for stripes-form https://github.com/folio-org/stripes-form/pull/45 and stripes-connect https://github.com/folio-org/stripes-connect/pull/71 |
| Comment by Wayne Schneider [ 16/Jan/19 ] |
|
Latest CI build is now working...thanks, Jeffrey Cherewaty and Matthew Jones! |