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
Fixes #27074 - Migrate to @theforeman/vendor and @theforeman/vendor-dev pkg #6605
Conversation
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
What's the status of this PR? thanks :) |
I'm working on releasing a new version of |
4ee4b81
to
1f6f9df
Compare
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
|
1f6f9df
to
805807d
Compare
There were the following issues with the commit message:
If you don't have a ticket number, please create an issue in Redmine. More guidelines are available in Coding Standards or on the Foreman wiki. This message was auto-generated by Foreman's prprocessor |
I created a redmine issue for this - https://projects.theforeman.org/issues/27074 |
805807d
to
faa0c31
Compare
faa0c31
to
bd665a8
Compare
Status UpdateI have just released You can test it by simply run: rm -rf node_modules/
rm -rf package-lock.json
npm install
# running test should work
npm test
# running development server should work
foreman start
# building and running production should work
RAILS_ENV=production bundle exec rake assets:precompile
RAILS_ENV=production bundle exec rake webpack:compile
RAILS_ENV=production foreman start rails There is one issue when running
|
bd665a8
to
259d7e2
Compare
This is been fixed in |
#6858 created to fix the linting issue |
259d7e2
to
cde0a5d
Compare
#6748 is merged now so I'm rebasing this PR and the ruby test error should be resolved. |
Looks like the failed test is not related? |
7fb1165
to
8414bf9
Compare
Update
Ready for another session of reviews. |
collections: true, | ||
flattening: true, | ||
shorthands: true | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this plugin's description, i think it may have been the cause of the unexpected hash changes we were seeing in the past:
Create smaller Lodash builds by replacing feature sets of modules with noop, identity, or simpler alternatives.
which is exactly what I discovered when trying to isolate the changes - modules that were being replaced by noop and identity.
Are we still using it in the vendor build? if so, I think we shouldn't - even though we may get a larger build, we want to make all of lodash available to consumers since we can't tell which modules aren't used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, the new vendor don't use this plugin anymore so it contains the full lodash
lib.
Once we stabilize the build, I'm open-minded trying more optimizations.
|
||
FOREMAN_JS_LOCATION="../${FOREMAN_JS_LOCATION}" | ||
FOREMAN_JS_PACKAGES_LOCATION="${FOREMAN_JS_LOCATION}/packages" | ||
FOREMAN_JS_INSTALL_LOCATION="./node_modules/@theforeman" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be "../node_modules/@theforeman"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because you run this script from the root by using npm run foreman-js:link
.
See webpack/stories/docs/addingDependencies.md
8414bf9
to
f8722a9
Compare
@tbrisker can you revisit please? |
exit 1 | ||
fi | ||
|
||
FOREMAN_JS_LOCATION="../${FOREMAN_JS_LOCATION}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will make it ../../foreman-js
with the default, and add a ../
to the path given by the user which would be confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo it will make it easier because you will define FOREMAN_JS_LOCATION
relatively to foreman root so you can have:
home/foreman
home/foreman-js
So inside foreman you can run:
FOREMAN_JS_LOCATION="../foreman-js" npm run foreman-js:lint
imo it will be confusing if you will need to set FOREMAN_JS_LOCATION
relatively to the scripts folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't you reply below that this script runs from the foreman root because it is executed by npm? in that case ../../foreman-js
would be the wrong folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a difference in how the rm
and ln
commands are working and their parameters.
You can try the script, I have just verified it is working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is only the second parameter of the ln
that need to be relative to root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, i see, it's is because ln creates the link relative to the link location, not to the cwd. you could unite this line with the next but not critical.
@@ -25,22 +25,8 @@ import * as configReportsModalDiff from './foreman_config_reports_modal_diff'; | |||
import * as classEditor from './foreman_class_edit'; | |||
import * as dashboard from './dashboard'; | |||
import * as spice from './spice'; | |||
import './bundle_datatables'; | |||
import './bundle_lodash'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be missing it, where are we making window._ available if the bundle is removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lodash put it there automatically once you require it, the bundle_lodash
just replaced the window._
with another leaner object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sharvit ! code looks good, tested and everything seems to work well including several plugins both in development and production mode. This is ready to merge on my side once we figure out the packaging side.
@sharvit looks like there is a conflict in package.json, please rebase on latest develop |
This conflict will be solved only by updating the Notice there is another issue that should get fixed: |
@sharvit besides the packaging issue, this can't be merged right now because of a merge conflict with the current package.json in develop branch. rebasing should fix that. |
2266dcb
to
2fb0959
Compare
Thanks @tbrisker
|
c8eb72e
to
123e561
Compare
123e561
to
ba5d3e4
Compare
Updates
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sharvit !
Uses packages from:
https://github.com/sharvit/foreman-js