-
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
"Buffer" polyfill bloats plugin bundles #107280
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
Pinging @elastic/kibana-core (Team:Core) |
Pinging @elastic/kibana-app-services (Team:AppServices) |
While I agree that we should avoid using it, I created #130877 to move those polyfills to the UI Shared Deps. |
@afharo with the polyfills being included in the shared deps, should we close this issue? |
I wonder if we should keep it open to actually avoid using them and remove them from the shared deps. What do you think? |
Pinging @elastic/kibana-presentation (Team:Presentation) |
Pinging @elastic/fleet (Team:Fleet) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/uptime (Team:uptime) |
Pinging @elastic/kibana-gis (Team:Geo) |
@pgayvallet I just ran an audit of all the places where it's used and pinged all the teams. If we think the effort is not worth it for reducing 40kB of page bundle load. I'd vote for closing the issue. @elastic/kibana-operations what do you think? |
If we can get the work done to remove the buffer usage we could prevent it from being re-added with some basic Webpack config changed. |
@afharo agreed, let's close this. |
When
Buffer
is used in client or common code, webpack bundles a costly ~30kb polyfill. Looks like it does it per each plugin whereBuffer
is used. In some cases, it is possible to avoid using it in clientside code altogether, but probably we at least could share theBuffer
polyfill across plugins.Some clientside usages I found:
kibana/src/core/public/utils/crypto/sha256.ts
Line 164 in 3c30878
kibana/x-pack/plugins/canvas/common/lib/embeddable_dataurl.ts
Lines 10 to 13 in 57a53db
kibana/x-pack/plugins/enterprise_search/public/applications/app_search/components/document_creation/document_creation_logic.ts
Line 172 in 6f5cd00
kibana/x-pack/plugins/fleet/common/services/decode_cloud_id.ts
Line 29 in 4681a80
global.Buffer
to avoid webpack from polyfilling it)kibana/x-pack/plugins/fleet/common/services/is_valid_namespace.ts
Line 39 in 4584a8b
common
dir. Is it actually used in the Browser?)kibana/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.mock.ts
Lines 19 to 21 in 9bf488e
kibana/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts
Line 58 in 3730dd0
kibana/x-pack/plugins/maps/public/routes/map_page/saved_map/saved_map.ts
Line 472 in 3730dd0
kibana/x-pack/plugins/synthetics/public/components/monitor_management/action_bar/action_bar.tsx
Line 68 in 80a2aa1
kibana/x-pack/plugins/synthetics/public/components/monitor_management/monitor_list/actions.tsx
Line 48 in 80a2aa1
kibana/x-pack/plugins/synthetics/public/pages/monitor_management/edit_monitor.tsx
Line 34 in a4a0822
Buffer
in client code #107278 (review)kibana/src/plugins/data/common/field_formats/converters/string.ts
Line 98 in 3c30878
Buffer
in client code #107278 (review)kibana/src/plugins/bfetch/public/streaming/inflate_response.ts
Line 12 in 3c30878
The text was updated successfully, but these errors were encountered: