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
LPS-124871 Propagate NODE_ENV to YUI loader #632
LPS-124871 Propagate NODE_ENV to YUI loader #632
Conversation
Our other resources are toggled between minified and non-minified form based on the value of `NODE_ENV`, so we do the same here in the name of consistency for resources that are loaded via the YUI loader. This means we effectively ignore the old logic: https://github.com/liferay/liferay-portal/blob/012adf4b2836179a5478bf04b5337955917fccb8/portal-web/docroot/html/common/themes/top_js.jspf#L329-L342 that consults `themeDisplay.isThemeJsFastLoad()` and the `javascript.log.enabled` property, in order to return 'raw', 'min' or 'debug' as a filter type. Now, we only ever return 'raw' or 'min'. If you're curious, how these filter types are used can be seen in the loader source: https://alloyui.com/api/files/yui3_src_loader_js_loader.js.html
CI is automatically triggering the following test suites:
|
I'm still testing this manually, but sending this here early so that I can give CI a head-start on it. I'll report back with my findings. |
✔️ ci:test:sf - 1 out of 1 jobs passed in 4 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: wincent/LPS-124871/aui-minification 1 Successful Jobs:For more details click here. |
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.
Jenkins Build:test-portal-source-format#4482 |
ci:stop |
❌ ci:test:relevant - 0 out of 1 jobs passed in 52 minutesClick here for more details.Base Branch:Branch Name: master Copied in Private Modules Branch:Branch Name: master-private ci:test:relevant - 0 out of 1 jobs PASSED1 Failed Jobs:For more details click here.Failures unique to this pull:For upstream results, click here. |
Huh... I would've fell for the same |
Fixes: modules.js:52 Uncaught ReferenceError: process is not defined caused by: filter: process.env.NODE_ENV === 'development' ? 'raw' : 'min' not getting appropriately transformed in the source. This is because, while the code _does_ go through Babel (thanks to npm-scripts), this old AUI code does _not_ go through the Bundler (due to the `.npmbundlerrc` config), and it's the bundler which is responsible for this particular transform (we may want to reconsider that though... especially as we move away from v2 to v3). Test plan: Inspect built source and see no `process` reference; note that the filter code has been minified and inlined to: !function(){var e=Liferay.AUI/* etc.. */,filter:"min",
Fixed in b9db3c1 and made a note in there that we might want to move this particular plugin ( |
ci:test:sf |
ci:test:relevant |
ci:test:bundle |
✔️ ci:test:sf - 1 out of 1 jobs passed in 5 minutesClick here for more details.Base Branch:Branch Name: master Sender Branch:Branch Name: wincent/LPS-124871/aui-minification 1 Successful Jobs:For more details click here. |
Jenkins Build:test-portal-acceptance-pullrequest(master)#7477 |
Jenkins Build:test-portal-source-format#4854 |
✔️ ci:test:bundle - 1 out of 1 jobs passed in 1 hour 3 minutesClick here for more details.Base Branch:Branch Name: master Copied in Private Modules Branch:Branch Name: master-private ci:test:bundle - 1 out of 1 jobs PASSEDFor more details click here.Test bundle downloads:
|
Jenkins Build:test-portal-acceptance-pullrequest(master)#6697 |
Failure is spurious (see: #636) so going to manual forward. |
Manual forward: brianchandotcom#97050 |
Our other resources are toggled between minified and non-minified form based on the value of
NODE_ENV
, so we do the same here in the name of consistency for resources that are loaded via the YUI loader.This means we effectively ignore the old logic that consults
themeDisplay.isThemeJsFastLoad()
and thejavascript.log.enabled
property, in order to return'raw'
,'min'
or'debug'
as a filter type. Now, we only ever return'raw'
or'min'
.If you're curious, how these filter types are used can be seen in the loader source.