elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.67k stars 8.23k forks source link

[chore] update cheerio to 1.0.0 #201216

Open dmlemeshko opened 20 hours ago

dmlemeshko commented 20 hours ago

Summary

Related to https://github.com/elastic/kibana/pull/200791

Updating the cheerio dependency separately due to issues with globally bumping it to version 1.0.0:

The enzyme library, which we use in many Jest tests, has pinned cheerio to 1.0.0-rc.3. This is because later releases of cheerio no longer export the lib folder, which enzyme relies on.

If we globally update cheerio to version 1.0.0, Jest tests running in jest-environment-jsdom fail with the error:

Cannot find module 'cheerio/lib/utils' from 'node_modules/enzyme/build/Utils.js'

To resolve this issue, I applied dependency resolution to ensure compatibility:

cheerio@1.0.0-rc.12 is still supported by enzyme@3.11.0 and passes our snyk check (1.0.0-rc.3 fails)

├─ cheerio@1.0.0
└─ enzyme@3.11.0
   └─ cheerio@1.0.0-rc.12

I believe it is a temporary solution because enzyme will be removed with future React updates.

elasticmachine commented 20 hours ago
:robot: Jobs for this PR can be triggered through checkboxes. :construction: :information_source: To trigger the CI, please tick the checkbox below :point_down: - [ ] Click to trigger **kibana-pull-request** for this PR! - [ ] Click to trigger **kibana-deploy-project-from-pr** for this PR!
elasticmachine commented 28 minutes ago

:broken_heart: Build Failed

Failed CI Steps

History