Skip to content
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

Optimize Functions and Renderers for Webpack builds #72683

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

clintandrewhall
Copy link
Contributor

Summary

Since Canvas uses an "indexed module" approach to organizing its source code, using our Functions and Renderers in any Webpack build (e.g. Storybook, Shareable Runtime, etc) means importing all Functions and Renderers, (regardless of it they're used). With Embeddables and Filters, that means importing a lot of extraneous code... Embeddables, for example, pulls in a lot of Kibana source code from all over the repo that isn't handled, like html from Angular.

This reorganization of our Functions and Renderers allows us to import from a few new categories:

  • external: functions that import source code from outside Canvas, (e.g. Kibana or other plugins)

  • core: renderers which are core to Canvas, (and simple in nature)

  • filters: renderers that are specific to filtering

@clintandrewhall clintandrewhall added review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort v8.0.0 release_note:skip Skip the PR/issue when compiling release notes impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. v7.10.0 labels Jul 21, 2020
@clintandrewhall clintandrewhall requested a review from crob611 July 21, 2020 16:09
@clintandrewhall clintandrewhall requested review from a team as code owners July 21, 2020 16:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
canvas 884 +1 883

page load bundle size

id value diff baseline
canvas 1.4MB +501.0B 1.4MB

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@clintandrewhall clintandrewhall merged commit b05d3d1 into elastic:master Jul 21, 2020
@clintandrewhall clintandrewhall deleted the webpack-optimize branch July 21, 2020 19:29
clintandrewhall added a commit to clintandrewhall/kibana that referenced this pull request Jul 21, 2020
# Conflicts:
#	x-pack/plugins/canvas/canvas_plugin_src/functions/common/index.ts
clintandrewhall added a commit that referenced this pull request Jul 21, 2020
…72723)

# Conflicts:
#	x-pack/plugins/canvas/canvas_plugin_src/functions/common/index.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:small Small Level of Effort release_note:skip Skip the PR/issue when compiling release notes review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants