[chore] Bundle fp-ts into the shared bundle#217034
Merged
dej611 merged 18 commits intoelastic:mainfrom Apr 16, 2025
Merged
Conversation
dej611
commented
Apr 4, 2025
src/platform/packages/private/kbn-ui-shared-deps-src/src/entry.js
Outdated
Show resolved
Hide resolved
Contributor
|
Pinging @elastic/kibana-operations (Team:Operations) |
miltonhultgren
approved these changes
Apr 11, 2025
yctercero
approved these changes
Apr 11, 2025
angorayc
approved these changes
Apr 14, 2025
Contributor
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
|
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
Apr 17, 2025
## Summary Just had some fun and made fp-ts available in the shared bundle, with support for partial imports. Changes in this PR: * aligned `fp-ts` direct imports to the format: `fp-ts/<module>` * Mapped the direct imports into the shared bundle re-using the same `fp-ts` module under the hood
dej611
added a commit
that referenced
this pull request
Apr 17, 2025
## Summary After #217202 and #217034 this the another attempt with `lodash` and `lodash/fp`. In short: `lodash` and `lodash/fp` have a special webpack treatment as they are imported within the shared bundle. Now webpack is not smart enough to understand that `import camelCase from 'lodash/camelCase';` is still pointing to `lodash` and it thinks that `lodash/camelCase` is a different package, de-optimizing the bundling caching system. So I’ve tweaked the import to make it point to the shared bundle and save few kbs here and there
This was referenced Apr 17, 2025
davismcphee
pushed a commit
to davismcphee/kibana
that referenced
this pull request
Apr 22, 2025
## Summary After elastic#217202 and elastic#217034 this the another attempt with `lodash` and `lodash/fp`. In short: `lodash` and `lodash/fp` have a special webpack treatment as they are imported within the shared bundle. Now webpack is not smart enough to understand that `import camelCase from 'lodash/camelCase';` is still pointing to `lodash` and it thinks that `lodash/camelCase` is a different package, de-optimizing the bundling caching system. So I’ve tweaked the import to make it point to the shared bundle and save few kbs here and there
dej611
added a commit
that referenced
this pull request
Apr 23, 2025
## Summary This PR is the counter part of #217034 to avoid making the same mistake again in the future.
dej611
added a commit
that referenced
this pull request
Apr 24, 2025
## Summary Similar to #217034, #217202 and #217467 this time applied to `react-use`. This is a slightly different approach than #217034 as we're caching here only the most common/frequently used methods from the `react-use` library and leaving the rest to be loaded within the specific plugin chunks. What this PR does it fundamentally: * adds `7.x kb` to the shared bundle * overall the startup bundle size shrinks about `3.5 kb` * the async bundle size shrinks of about `350 kb` (mainly due to 3 imports which were targeting `react-use/lib`). An alternative approach would be to just fix the async import strings in there, but I thought to it was worth it to make the long step here. Feedback appreciated.
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
May 29, 2025
## Summary Just had some fun and made fp-ts available in the shared bundle, with support for partial imports. Changes in this PR: * aligned `fp-ts` direct imports to the format: `fp-ts/<module>` * Mapped the direct imports into the shared bundle re-using the same `fp-ts` module under the hood
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
May 29, 2025
## Summary After elastic#217202 and elastic#217034 this the another attempt with `lodash` and `lodash/fp`. In short: `lodash` and `lodash/fp` have a special webpack treatment as they are imported within the shared bundle. Now webpack is not smart enough to understand that `import camelCase from 'lodash/camelCase';` is still pointing to `lodash` and it thinks that `lodash/camelCase` is a different package, de-optimizing the bundling caching system. So I’ve tweaked the import to make it point to the shared bundle and save few kbs here and there
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
May 29, 2025
## Summary This PR is the counter part of elastic#217034 to avoid making the same mistake again in the future.
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
May 29, 2025
) ## Summary Similar to elastic#217034, elastic#217202 and elastic#217467 this time applied to `react-use`. This is a slightly different approach than elastic#217034 as we're caching here only the most common/frequently used methods from the `react-use` library and leaving the rest to be loaded within the specific plugin chunks. What this PR does it fundamentally: * adds `7.x kb` to the shared bundle * overall the startup bundle size shrinks about `3.5 kb` * the async bundle size shrinks of about `350 kb` (mainly due to 3 imports which were targeting `react-use/lib`). An alternative approach would be to just fix the async import strings in there, but I thought to it was worth it to make the long step here. Feedback appreciated.
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
dej611
added a commit
to dej611/kibana
that referenced
this pull request
Jun 26, 2025
## Summary Just had some fun and made fp-ts available in the shared bundle, with support for partial imports. Changes in this PR: * aligned `fp-ts` direct imports to the format: `fp-ts/<module>` * Mapped the direct imports into the shared bundle re-using the same `fp-ts` module under the hood (cherry picked from commit 0a6bc1b) # Conflicts: # src/core/packages/saved-objects/migration-server-internal/src/actions/bulk_overwrite_transformed_documents.ts # src/core/packages/saved-objects/migration-server-internal/src/actions/create_index.ts # src/core/packages/saved-objects/migration-server-internal/src/actions/read_with_pit.ts # src/core/packages/saved-objects/migration-server-internal/src/actions/wait_for_task.ts # x-pack/solutions/observability/plugins/inventory/common/rt_types.ts # x-pack/solutions/security/plugins/security_solution/server/lib/timeline/saved_object/pinned_events/index.ts
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Just had some fun and made fp-ts available in the shared bundle, with support for partial imports.
Changes in this PR:
fp-tsdirect imports to the format:fp-ts/<module>fp-tsmodule under the hood