Skip to content

[8.18] Remove @paralleldrive/cuid2 (#230293)#231349

Merged
legrego merged 2 commits intoelastic:8.18from
legrego:backport/8.18/pr-230293
Aug 12, 2025
Merged

[8.18] Remove @paralleldrive/cuid2 (#230293)#231349
legrego merged 2 commits intoelastic:8.18from
legrego:backport/8.18/pr-230293

Conversation

@legrego
Copy link
Member

@legrego legrego commented Aug 11, 2025

Backport

This will backport the following commits from main to 8.18:

Questions ?

Please refer to the Backport tool documentation

## Attention Code Owners!

Please test these changes before approving. Your know your domains much
better than I do, and I need your help to ensure I did not cause any
regressions. Thank you!

-------

This pull request removes the dependency on `@paralleldrive/cuid2` and
replaces it with alternatives (`uuid` and `crypto`) for generating
unique IDs. The changes primarily focus on dependency management and
updating the code to use the new ID generation methods.

### Dependency Management:
* Removed `@paralleldrive/cuid2` from `package.json` and `renovate.json`
to eliminate its usage in the project.
[[1]](diffhunk://#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L1147)
[[2]](diffhunk://#diff-7b5c8955fc544a11b4b74eddb4115f9cc51c9cf162dbffa60d37eeed82a55a57L761)

### Code Updates:
* Replaced `createId` from `@paralleldrive/cuid2` with `uuidv4` from the
`uuid` package in `sample_client_readme.tsx`. This change affects the
`Generate API key` functionality.
[[1]](diffhunk://#diff-19ec5ab675709969feeeaaa0b0549d8926f49e3115166426a17370bc6a98d673L13-R13)
[[2]](diffhunk://#diff-19ec5ab675709969feeeaaa0b0549d8926f49e3115166426a17370bc6a98d673L148-R148)
* Updated `content_stream.ts` to use `randomUUID` from the `crypto`
module instead of `createId` for generating IDs in the `ContentStream`
class.
[[1]](diffhunk://#diff-a7545f2aab64e1136452bd37f3388ae269f64761b19c80cc007be7e7c97f511dL10-R10)
[[2]](diffhunk://#diff-a7545f2aab64e1136452bd37f3388ae269f64761b19c80cc007be7e7c97f511dL227-R227)
* Updated `file_client.ts` to use `randomUUID` from the `crypto` module
instead of `createId` for generating IDs in the `FileClientImpl` class.
[[1]](diffhunk://#diff-ffbfbe730b81183661bb18b6b78bbb3903496b5716598f4284531fe31390358aL13-R13)
[[2]](diffhunk://#diff-ffbfbe730b81183661bb18b6b78bbb3903496b5716598f4284531fe31390358aL133-R133)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 35f311d)

# Conflicts:
#	package.json
@legrego legrego requested a review from kibanamachine as a code owner August 11, 2025 18:13
@legrego legrego added the backport This PR is a backport of another PR label Aug 11, 2025
@legrego legrego enabled auto-merge (squash) August 11, 2025 18:13
Copy link
Contributor

@kc13greiner kc13greiner left a comment

Choose a reason for hiding this comment

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

Backport LGTM!

@legrego legrego merged commit 9cf2896 into elastic:8.18 Aug 12, 2025
8 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
customIntegrations 41 34 -7

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
customIntegrations 82.8KB 72.1KB -10.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
customIntegrations 10.4KB 10.4KB +55.0B

History

@legrego legrego deleted the backport/8.18/pr-230293 branch August 12, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants