Today’s on the UI group meeting, @sharvit made a deep dive about the @theforeman/vendor
sub-package.
This explains how foreman core and plugins import shared packages from the foreman’s vendor, and also why the test environment is different from development and production by its dependencies usage.
You are welcome to watch -
Thanks, @sharvit for this deep dive!
In summary, development (while running on webpack-dev-server) and production use the compiled version of vendor-core
packages list, these compiled files are located under @theforeman/vendor/dist
folder.
On the other hand, @theforeman/test
and @theforeman/stories
install all vendor-core
packages via npm according to the vendor-core
package.json file (and not from the lock file), hence this explains our test errors and broken snapshots in our test environment from time to time.
I understand why this approach made, during testing we can find issues.
However, when a package doesn’t comply with semantic versioning, then a breaking change might occur even in a minor update, moreover, foreman-js
also uses dependency-bot, so if there’s a patch, it creates a PR automatically.
Due to our experience with patterfnly 4 versioning, I wonder if this approach helps us or just makes us slower.
What do you think? do we benefit from these differences between our environments anymore? do you have any other approach to suggest?
Thanks!