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

[IE11] Kibana doesn't transpile correctly in development mode #58771

Closed
wants to merge 1 commit into from

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Feb 27, 2020

Closes: #58684

Summary

@joshdover @lukeelmers
Unfortunately, due to another API and the lack of TypeScript types in the v5 version of query-string library, we cannot easily downgrade it.

But some time ago we already faced with very similar issue here #35804. Looks like we can use the same approach for query-string lib

I prepared some screens from our dll bundles to show you that this approach should help. Please see

Before:
image

After:
image

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@alexwizp alexwizp added the release_note:skip Skip the PR/issue when compiling release notes label Feb 28, 2020
@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

@lukeelmers
Copy link
Member

lukeelmers commented Feb 28, 2020

I'm cool with this approach as long as @elastic/kibana-operations is on board, especially considering we did the same thing in #35804 so it is not without precedent.

If for some reason this isn't viable, perhaps a next step would be looking further into Jason's idea about using querystring on the client & the built in node core querystring on the server.
(Edit: the main issue with querystring is that it is currently unmaintained)

This would be a much more involved change though -- so if dropping IE11 support in the future is inevitable, I prefer the simplicity of this solution.

@wylieconlon
Copy link
Contributor

wylieconlon commented Feb 28, 2020

I just tested this in IE11 and am still seeing syntax errors in ./node_modules/query-string/node_modules/strict-uri-encode/index.js. It seems like the problem is that the query-string module is not bundling its dependencies.

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

I know this is a draft, but let's make sure this solution works in IE11

src/optimize/dynamic_dll_plugin/dll_config_model.js Outdated Show resolved Hide resolved
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@lukeelmers
Copy link
Member

lukeelmers commented Feb 28, 2020

Feedback from @elastic/kibana-operations was that we should not change the config like this to allow for compiling additional node_modules dependencies.

This leaves a few other options:

  1. Select a different library. Options are limited here since we need something well-maintained, with the right APIs, which also has IE11 and TS support. Wondering if qs would be a possibility here, but would need to investigate further.
  2. Revert the original PR. Functionally this would be pretty much the same as option 1, and we'd still need to get rid of the legacy ui/public/utils/query_string
  3. Contribute changes back upstream. I don't think this is a possibility in this case as the maintainer had made it abundantly clear that they no longer intend to support older browsers as of v6 (see release notes).
  4. Fork query-string until such a time as we don't need to support IE11. I don't love this idea because the only customization we require is having a single 340-line JS file run through babel, and duplicating the code creates an unnecessary maintenance burden.

After thinking about option 4, one other idea I had is creating an "empty" package in Kibana that basically exists to run node_modules/query-string through babel. This avoids the maintenance overhead of having duplicate code, without requiring us to change libraries (just import statements to use @kbn/query-string).

I put up a POC illustrating this. The only material difference between that technique and this PR is that babel will transpile up front during yarn kbn bootstrap. Otherwise it is basically the same thing.

I'm going to discuss pros & cons of our options with the team on Monday and will follow up here.

@lukeelmers
Copy link
Member

I chatted again with our friendly neighborhood ops team today. The conclusion was:

Wylie's PR basically reverts parts of the original PR, including the querystring webpack alias for querystring-browser. This way the lib can be imported consistently on the client and server. He also kept the changes that were made in kibana_utils.

IMO this is the better hybrid approach -- the POC I made works, but feels hacky and brittle. Whereas we know things we working well with querystring-browser before, even if it meant things were a bit more scattered.

Longer term, we should definitely still explore our options once it's safe to drop IE11 support -- maybe at that point it makes sense to go back to query-string. But shorter term, I'd rather keep things simple than fork query-string or build a special package as a workaround.

@alexwizp alexwizp closed this Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration IE11 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Downgrade to query-string v5.1.1
5 participants