-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Discover] Switch from "at" to "charAt" for better browser support #156474
Conversation
💚 Build Succeeded
Metrics [docs]Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: cc @jughosta |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
This is interesting, since the .at was introduced in #137147, so 8.5 was the version (users says it was upgraded from 8.6.1) |
@@ -216,7 +217,7 @@ describe('tabify_docs', () => { | |||
}, | |||
}, | |||
}, | |||
metaFields: ['_id', '_index', '_score', '_type', '_size'], | |||
metaFields: ['_id', '_index', '_score', '_type', '_size', 'invalid_meta'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this add-on , because now the test even makes more sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Special thx for improving the unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, I mostly did a code review as I dont have an older version to test but the change makes sense to me 👍
…lastic#156474) From the community forum: users can't access Discover on older browsers. ``` TypeError: t.at is not a function at http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992 at Array.forEach () at n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956) at s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138) at http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215 at Array.map () at a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207) at http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442 at http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724 at t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456) ``` - https://discuss.elastic.co/t/update-to-8-7-0/329525 - https://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2 ## Summary This PR replaces `String` `.at` usage with `.charAt` so it does not require a polyfill for older browsers. (cherry picked from commit 396a2b6)
…lastic#156474) From the community forum: users can't access Discover on older browsers. ``` TypeError: t.at is not a function at http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992 at Array.forEach () at n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956) at s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138) at http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215 at Array.map () at a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207) at http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442 at http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724 at t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456) ``` - https://discuss.elastic.co/t/update-to-8-7-0/329525 - https://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2 ## Summary This PR replaces `String` `.at` usage with `.charAt` so it does not require a polyfill for older browsers. (cherry picked from commit 396a2b6)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ort (#156474) (#156656) # Backport This will backport the following commits from `main` to `8.7`: - [[Discover] Switch from "at" to "charAt" for better browser support (#156474)](#156474) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-04T09:11:18Z","message":"[Discover] Switch from \"at\" to \"charAt\" for better browser support (#156474)\n\nFrom the community forum: users can't access Discover on older browsers.\r\n\r\n```\r\nTypeError: t.at is not a function\r\nat http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992\r\nat Array.forEach ()\r\nat n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956)\r\nat s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215\r\nat Array.map ()\r\nat a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442\r\nat http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724\r\nat t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456)\r\n```\r\n\r\n- https://discuss.elastic.co/t/update-to-8-7-0/329525\r\n-\r\nhttps://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2\r\n\r\n## Summary\r\n\r\nThis PR replaces `String` `.at` usage with `.charAt` so it does not\r\nrequire a polyfill for older browsers.","sha":"396a2b63d461102cb312168adf9303265919c16c","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:fix","Team:DataDiscovery","v8.7.0","v8.8.0","v8.9.0"],"number":156474,"url":"https://github.com/elastic/kibana/pull/156474","mergeCommit":{"message":"[Discover] Switch from \"at\" to \"charAt\" for better browser support (#156474)\n\nFrom the community forum: users can't access Discover on older browsers.\r\n\r\n```\r\nTypeError: t.at is not a function\r\nat http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992\r\nat Array.forEach ()\r\nat n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956)\r\nat s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215\r\nat Array.map ()\r\nat a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442\r\nat http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724\r\nat t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456)\r\n```\r\n\r\n- https://discuss.elastic.co/t/update-to-8-7-0/329525\r\n-\r\nhttps://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2\r\n\r\n## Summary\r\n\r\nThis PR replaces `String` `.at` usage with `.charAt` so it does not\r\nrequire a polyfill for older browsers.","sha":"396a2b63d461102cb312168adf9303265919c16c"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.8"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156474","number":156474,"mergeCommit":{"message":"[Discover] Switch from \"at\" to \"charAt\" for better browser support (#156474)\n\nFrom the community forum: users can't access Discover on older browsers.\r\n\r\n```\r\nTypeError: t.at is not a function\r\nat http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992\r\nat Array.forEach ()\r\nat n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956)\r\nat s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215\r\nat Array.map ()\r\nat a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442\r\nat http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724\r\nat t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456)\r\n```\r\n\r\n- https://discuss.elastic.co/t/update-to-8-7-0/329525\r\n-\r\nhttps://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2\r\n\r\n## Summary\r\n\r\nThis PR replaces `String` `.at` usage with `.charAt` so it does not\r\nrequire a polyfill for older browsers.","sha":"396a2b63d461102cb312168adf9303265919c16c"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <[email protected]>
…ort (#156474) (#156657) # Backport This will backport the following commits from `main` to `8.8`: - [[Discover] Switch from "at" to "charAt" for better browser support (#156474)](#156474) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-04T09:11:18Z","message":"[Discover] Switch from \"at\" to \"charAt\" for better browser support (#156474)\n\nFrom the community forum: users can't access Discover on older browsers.\r\n\r\n```\r\nTypeError: t.at is not a function\r\nat http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992\r\nat Array.forEach ()\r\nat n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956)\r\nat s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215\r\nat Array.map ()\r\nat a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442\r\nat http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724\r\nat t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456)\r\n```\r\n\r\n- https://discuss.elastic.co/t/update-to-8-7-0/329525\r\n-\r\nhttps://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2\r\n\r\n## Summary\r\n\r\nThis PR replaces `String` `.at` usage with `.charAt` so it does not\r\nrequire a polyfill for older browsers.","sha":"396a2b63d461102cb312168adf9303265919c16c","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:fix","Team:DataDiscovery","v8.7.0","v8.8.0","v8.9.0"],"number":156474,"url":"https://github.com/elastic/kibana/pull/156474","mergeCommit":{"message":"[Discover] Switch from \"at\" to \"charAt\" for better browser support (#156474)\n\nFrom the community forum: users can't access Discover on older browsers.\r\n\r\n```\r\nTypeError: t.at is not a function\r\nat http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992\r\nat Array.forEach ()\r\nat n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956)\r\nat s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215\r\nat Array.map ()\r\nat a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442\r\nat http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724\r\nat t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456)\r\n```\r\n\r\n- https://discuss.elastic.co/t/update-to-8-7-0/329525\r\n-\r\nhttps://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2\r\n\r\n## Summary\r\n\r\nThis PR replaces `String` `.at` usage with `.charAt` so it does not\r\nrequire a polyfill for older browsers.","sha":"396a2b63d461102cb312168adf9303265919c16c"}},"sourceBranch":"main","suggestedTargetBranches":["8.7","8.8"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/156474","number":156474,"mergeCommit":{"message":"[Discover] Switch from \"at\" to \"charAt\" for better browser support (#156474)\n\nFrom the community forum: users can't access Discover on older browsers.\r\n\r\n```\r\nTypeError: t.at is not a function\r\nat http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312992\r\nat Array.forEach ()\r\nat n (http://xxx:5601/61109/bundles/plugin/data/kibana/data.plugin.js:1:312956)\r\nat s (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10138)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10215\r\nat Array.map ()\r\nat a (http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:10207)\r\nat http://xxx:5601/61109/bundles/plugin/discover/kibana/discover.chunk.0.js:1:8442\r\nat http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:334:27724\r\nat t.s._next (http://xxx:5601/61109/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:33456)\r\n```\r\n\r\n- https://discuss.elastic.co/t/update-to-8-7-0/329525\r\n-\r\nhttps://discuss.elastic.co/t/elastic-8-7-0-error-in-discover-tab/332329/2\r\n\r\n## Summary\r\n\r\nThis PR replaces `String` `.at` usage with `.charAt` so it does not\r\nrequire a polyfill for older browsers.","sha":"396a2b63d461102cb312168adf9303265919c16c"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <[email protected]>
From the community forum: users can't access Discover on older browsers.
Summary
This PR replaces
String
.at
usage with.charAt
so it does not require a polyfill for older browsers.