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

[Canvas] Relocate pieces of buildEmbeddableFilters which are required by the client. #52343

Closed
lukeelmers opened this issue Dec 5, 2019 · 2 comments
Labels
chore Feature:Canvas Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@lukeelmers
Copy link
Member

TL;DR: canvas/server/lib/build_embeddable_filters is imported by client-side code, and probably should be refactored so it isn't all located in the server directory.

More details:

In #52248, we addressed an issue that was causing Kibana to crash in IE11 due to a syntax error. (More details on the issue in that PR).

The problem arose when an import inside canvas/server/lib/build_embeddable_filters.ts was changed as follows:

-  // eslint-disable-next-line @kbn/eslint/no-restricted-paths
-  import { TimeRange, esFilters } from '../../../../../../src/plugins/data/common';
+  import { TimeRange, esFilters } from '../../../../../../src/plugins/data/server';

This change was technically correct in that new platform-style plugins should only be exporting static code & types via the top level server/index and public/index (as there is no notion of common in the new platform).

However, because buildEmbeddableFilters are imported by some common functions, which are in turn imported in the browser registry, it meant that browser code was indirectly importing static server code from data/server/index. As a result, a bunch of server code was bundled up and sent to the client, and IE11 didn't know WTF to do with it 😄

So even though the import was reverted in #52248, this is really only a temporary workaround. Ideally the pieces of buildEmbeddableFilters that are imported by the common functions should be extracted and relocated in a public directory somewhere... then the data plugin code it is relying on can be imported from data/public instead, which should mitigate this issue.

cc @elastic/kibana-app-arch

@lukeelmers lukeelmers added chore Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Dec 5, 2019
@elasticmachine
Copy link
Contributor

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

@crob611
Copy link
Contributor

crob611 commented Mar 6, 2020

Closed by #59087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Canvas Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

4 participants