-
Notifications
You must be signed in to change notification settings - Fork 181
Platform scripts audit #567
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
Conversation
|
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 am going to give this a local test on my workspace, I'll report back. It works well! I have some left some feedback below on a fix things to consider.
|
As an aside, I found when testing this that webpack building In terms of the final bundle that is produced in these two outcomes (deps being either all cjs or all esm) the bundle size is very similar. Building the dev bundle is about 2.4mb on disk vs prod which is 370kb. (As an additional note when I reviewed the GH releases our bundle size does seem to have grown by about 100kb since October last year for no reason? - Maybe we should use: https://www.npmjs.com/package/webpack-bundle-analyzer ) The reason I mention the bundle size is it fine for |
Looking at the release action it uses the |
Quite right! Just ignore that bit then. I still think the growth in bundle size is interesting and should be looked into in a new ticket/PR. But is certainly not a blocker for this one. |
lukehb
left a comment
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.
Some rfc
| "build": "npx webpack --config webpack.prod.js", | ||
| "build:dev": "npx webpack --config webpack.dev.js", | ||
| "build:esm": "npx webpack --config webpack.esmodule.js", | ||
| "build:cjs": "npx webpack --config webpack.common.js", |
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 a funny one actually on closer inspection.
We have the following webpack build configs for the reference frontend:
webpack.common.js - This is the base config used by both webpack.dev.js and webpack.prod.js - but perhaps confusingly named is not actually configuring webpack to build commonjs, but rather umd (which is correct considering you can't run cjs in the browser and webpack transforms the cjs deps into browser compatible umd for us). One solution to avoid this confusion is to rename this file webpack.base.js. Of additional note, because the webpack.common.js configuration does not specify a mode (development or production) webpack emits some warnings saying falling back to development etc, so this config should probably never be called directly.
webpack.dev.js - The dev configuration of the umd build (with inline source maps). This is probably the one we want the start.bat script to use.
webpack.prod.js - The prod configuration of the umd build that does minification etc so you end up with a smaller bundle.
webpack.esmodule.js - A completely different configuration that bundles into an esm module. Which could also be interesting for some usecases (like if someone is an all ESM codebase), but probably umd is the one we and most users will want to use.
| "build:cjs": "npx webpack --config webpack.common.js", | |
| "build:prod": "npx webpack --config webpack.prod.js", |
| pushd "${SCRIPT_DIR}/../../../Frontend/implementations/typescript" > /dev/null | ||
| "${SCRIPT_DIR}/node/bin/npm" install | ||
| "${SCRIPT_DIR}/node/bin/npm" run build | ||
| "${NPM}" run build:cjs |
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.
| "${NPM}" run build:cjs | |
| "${NPM}" run build:dev |
| pushd %CD%\Frontend\implementations\typescript | ||
| call "%SCRIPT_DIR%node\npm" install | ||
| call "%SCRIPT_DIR%node\npm" run build | ||
| call %NPM% run build:cjs |
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.
| call %NPM% run build:cjs | |
| call %NPM% run build:dev |
* Limited the bash script to build cjs * Added a cjs build target * Updating bash script to be a little more friendly with builds. * Added rebuild options to bash script * Updating windows batch script to be inline with bash script. * Cleaned up arguments further for the bash script * Tweaking build behaviour. Updating args * Sorting out webpack configs (cherry picked from commit f7abd33)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
* Limited the bash script to build cjs * Added a cjs build target * Updating bash script to be a little more friendly with builds. * Added rebuild options to bash script * Updating windows batch script to be inline with bash script. * Cleaned up arguments further for the bash script * Tweaking build behaviour. Updating args * Sorting out webpack configs (cherry picked from commit f7abd33) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
* Action audit (#565) (#566) - Removing duplicated push and pull_request triggers - Removing multiple install commands when one root will work. - Removing references to UE5.5 in favor of wildcard matching (cherry picked from commit 4ee5695) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com> * [UE5.5] Moved frontend library from a peer dep to a normal dep in ui-library (#568) (#569) * Moved frontend library from a peer dep to a normal dep in ui-library (#568) (cherry picked from commit e255bc0) # Conflicts: # Frontend/ui-library/package.json # package-lock.json * Fixing package-lock issues * Fixing issue where workspace path doesnt exist in npm publish action (#570) (#571) Trying to also fix issues with the changelog update perms. (cherry picked from commit 4f9b8a7) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com> * Trying to fix changelog update action * Still trying to fix changeset update action * What a nightmare * Updated NPM changelogs (#572) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fixing publish action. * Fixing publish action more. * Wrong package file. * Fix: Various input issues with input into streamed UE widgets (including IME support) (#564) (#575) * Add stub of editTextModal to application * Added events for showing onscreen keyboard, hooked them up to an edit text modal * Added explicitly stopping event propogation on text input into stream UI bleeding into UE keyboard input * Added hidden text box input for desktop IME use * Added config option to not show the modal * Added new docs page about typing into streamed inputs * Remove oncomposition event from keyboard controller as they were only needed for IME input which is now handled via modal * Removed now unused styles from PixelStreamingApplicationStyles.ts * Update Typing into streamed text inputs.md Mentioned the use of software cursor as an option. --------- Co-authored-by: Matthew.Cotton <matt@tensorworks.com.au> (cherry picked from commit 5fb6eb6) Co-authored-by: Luke Bermingham <1215582+lukehb@users.noreply.github.com> * Platform scripts audit (#567) (#577) * Limited the bash script to build cjs * Added a cjs build target * Updating bash script to be a little more friendly with builds. * Added rebuild options to bash script * Updating windows batch script to be inline with bash script. * Cleaned up arguments further for the bash script * Tweaking build behaviour. Updating args * Sorting out webpack configs (cherry picked from commit f7abd33) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com> * Updated NPM changelogs (#576) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Luke Bermingham <1215582+lukehb@users.noreply.github.com>
* Action audit (#565) (#566) - Removing duplicated push and pull_request triggers - Removing multiple install commands when one root will work. - Removing references to UE5.5 in favor of wildcard matching (cherry picked from commit 4ee5695) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com> * [UE5.5] Moved frontend library from a peer dep to a normal dep in ui-library (#568) (#569) * Moved frontend library from a peer dep to a normal dep in ui-library (#568) (cherry picked from commit e255bc0) # Conflicts: # Frontend/ui-library/package.json # package-lock.json * Fixing package-lock issues * Fixing issue where workspace path doesnt exist in npm publish action (#570) (#571) Trying to also fix issues with the changelog update perms. (cherry picked from commit 4f9b8a7) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com> * Trying to fix changelog update action * Still trying to fix changeset update action * What a nightmare * Updated NPM changelogs (#572) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Fixing publish action. * Fixing publish action more. * Wrong package file. * Fix: Various input issues with input into streamed UE widgets (including IME support) (#564) (#575) * Add stub of editTextModal to application * Added events for showing onscreen keyboard, hooked them up to an edit text modal * Added explicitly stopping event propogation on text input into stream UI bleeding into UE keyboard input * Added hidden text box input for desktop IME use * Added config option to not show the modal * Added new docs page about typing into streamed inputs * Remove oncomposition event from keyboard controller as they were only needed for IME input which is now handled via modal * Removed now unused styles from PixelStreamingApplicationStyles.ts * Update Typing into streamed text inputs.md Mentioned the use of software cursor as an option. --------- Co-authored-by: Matthew.Cotton <matt@tensorworks.com.au> (cherry picked from commit 5fb6eb6) Co-authored-by: Luke Bermingham <1215582+lukehb@users.noreply.github.com> * Platform scripts audit (#567) (#577) * Limited the bash script to build cjs * Added a cjs build target * Updating bash script to be a little more friendly with builds. * Added rebuild options to bash script * Updating windows batch script to be inline with bash script. * Cleaned up arguments further for the bash script * Tweaking build behaviour. Updating args * Sorting out webpack configs (cherry picked from commit f7abd33) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com> * Updated NPM changelogs (#576) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Rebuilt package-lock --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Luke Bermingham <1215582+lukehb@users.noreply.github.com>
Relevant components:
Problem statement:
The platform scripts have been problematic for a while, causing multiple builds of the same package, slow startup and failed startups.
Solution
Have gone over the windows and linux scripts and made sure they are focused on what needs to be built and only building that. The usage text has also been updated to properly reflect the options.