Skip to content

fix: trick build into including dependencies - #27858

Merged
w33ble merged 1 commit into
elastic:masterfrom
w33ble:fix/build-graph
Jan 3, 2019
Merged

w33ble merged 1 commit into
elastic:masterfrom
w33ble:fix/build-graph

Conversation

@w33ble

@w33ble w33ble commented Dec 28, 2018 •

Copy link
Copy Markdown
Contributor

Closes #27729

Tricks webpack into including dependencies it wouldn't normally pick up from canvas_plugin_src. I tested this, and it fixes the issue with the pointseries function in the build.

This is the simplest (and ugliest) fix for the issue. @mistic if you have a better idea for something simple and less ugly, I'd love to hear it.

@w33ble w33ble added review v7.0.0 Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v6.6.0 v6.7.0 labels Dec 28, 2018
@w33ble
w33ble requested review from mistic and spalger December 28, 2018 23:11
@w33ble
w33ble requested a review from a team as a code owner December 28, 2018 23:11
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-canvas

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@mistic mistic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@w33ble this LGTM as a quick fix for the problem we're having right now. Can we just fix the description inside the server/build_fix.js file?

For the long term, do you think we can make the canvas_plugin_src able to be statically analysed ? Maybe we can create an index file for canvas_plugin_src and import at least one time from there on canvas?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to note that Kibana build is already statically analyzing each x-pack plugin starting from their index files and looking for the dependencies in every files imported from those plugins starting from the index files.

The problem here is that canvas_plugin_src will be built with the webpack and canvas files are importing canvas_plugin and not canvas_plugin_src. Can we only fix the description here @w33ble ? 😃

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mistic Sure. I think you mentioned previously that we could update the build to look in other paths to resolve the dependencies for the build, would that be hard to add? Basically, everything under canvas_plugin_src besides functions/browser needs to end up in the build.

@mistic mistic Jan 2, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you think we could create an index file for the canvas_plugin_src server code and import from it at least one time on canvas @w33ble ? If we achieve that I think we'll have a better solution as we will use the same method to search across every x-pack plugin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can do that. Seems like a better quick fix anyway. It'll make the server bundle larger than it needs to be I think, but that doesn't seem like a big deal.

@mistic mistic Jan 3, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Humm, we are not bundling server side code right? And maybe we can create the index only for the common and server side code like we are doing for the other xpack plugins. What do you think @w33ble 😃 ?

EDIT: I just saw you already made the changes 🎉

import server and common functions so the build correctly includes their
dependencies
@w33ble

w33ble commented Jan 3, 2019 •

Copy link
Copy Markdown
Contributor Author

Can confirm that the most recent changes do still fix the build.

screenshot 2019-01-02 17 34 50

@mistic Mind giving me an LGTM comment if this looks good? It's changed since you originally approved it, and I'm guessing based on this comment you like it, but confirmation would be good.

@mistic mistic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🎉

@elasticmachine

Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@w33ble
w33ble merged commit dcc01f7 into elastic:master Jan 3, 2019
@w33ble
w33ble deleted the fix/build-graph branch January 3, 2019 17:38
w33ble added a commit that referenced this pull request Jan 3, 2019
import server and common functions so the build correctly includes their
dependencies
w33ble added a commit that referenced this pull request Jan 3, 2019
import server and common functions so the build correctly includes their
dependencies
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
import server and common functions so the build correctly includes their
dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v6.6.0 v6.7.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding point series elements on Canvas workpads is failing with error [pointseries] > (0 , _lodash2.default) is not a function

3 participants