-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[build] rewrite source as transpiled JS later in the process #73749
[build] rewrite source as transpiled JS later in the process #73749
Conversation
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/kibana-operations (Team:Operations) |
Note to reviewers, the |
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.
LGTM
…#73749) Co-authored-by: spalger <[email protected]>
…73749) (#73765) Co-authored-by: spalger <[email protected]> Co-authored-by: spalger <[email protected]>
* master: [Vega][Inspector] Request panel should show correct names for requests (elastic#73655) [Security Solution] Update filter (elastic#73350) TSVB Inaccurate Group By (elastic#73683) [Vega][Inspect panel] Write tutorials and reference (elastic#73262) [ML] Removing node info check for file data viz import (elastic#73717) check that pathname has been updated. ignore other parts (elastic#73689) [build] rewrite source as transpiled JS later in the process (elastic#73749) Fix Snapshot Restore /policies/indices API endpoint on Cloud (elastic#73734) skip flaky suite (elastic#69783) (elastic#70043) [Security Solution][Exceptions] - Updates exception hooks and viewer (elastic#73588) skip failing suite (elastic#58815) [Canvas][fatal bug] Fix props confusion in TextStylePicker (elastic#73732) [DOCS] Changes level offset of monitoring pages (elastic#73573) Added close button to toast notifications by migrating to different API that is more widely used in Kibana and Security solution in particular. (elastic#73662) [ML] Transforms/DFA: Change action button size back to 'xs'. [Metrics UI] Fix evaluating rate-aggregated alerts when there's no normalized value (elastic#73545) [Metrics UI] Fix formatting of values in inventory context.reason (elastic#73155) [maps] rename GisMap to MapContainer and convert to TS (elastic#73690) [APM] docs: remove watcher documentation (elastic#73485)
In the current build process we transpile JS source code with babel and replace the original source files with the babel output before running much of the build process. This causes webpack to receive CommonJS versions of code in
common
directories when it could be receiving ESM source that allows webpack to do some optimizations like module concatenation and module elimination.Moving the babel transpilation after the
BuildKibanaPlatformPlugins
step allows the KP bundles to be built against the ESM version of source files. Those files are then converted to CommonJS in the next step of the build.Doing this raised awareness of the fact that webpack ConcatenatedModules are really multiple modules for the same of the "module count" metric we're tracking, so I'm proposing that we start to add the number of modules which are being concatenated too. The module count being tracked is a proxy for the "build difficulty" of the bundle, and just because modules are shortened for faster execution in the browser doesn't change the fact that they're actually multiple files handled separately by the webpack loaders with their own work being done.