refactor: add es-toolkit#3652
Open
tegan-temporal wants to merge 3 commits into
Open
Conversation
- swap lodash/isEmpty for es-toolkit/compat isEmpty in oidc-server util - replace just-debounce with es-toolkit debounce (trailing default matches) - replace just-throttle with es-toolkit throttle (now leading+trailing) - replace kebab-case with es-toolkit kebabCase - drop lodash, just-debounce, just-throttle, kebab-case deps; add es-toolkit
- replace local omit util with es-toolkit omit (array key signature) - convert search-attribute decode reduce-with-spread to es-toolkit mapValues (also removes an O(n^2) accumulator spread) - delete dead unique util and now-unused local omit util
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| type Request, | ||
| type Response, | ||
| urlencoded, | ||
| } from 'express'; |
Contributor
There was a problem hiding this comment.
⚠️ Could not find a declaration file for module 'oidc-provider'. '/home/runner/work/ui/ui/node_modules/.pnpm/oidc-provider@9.8.6/node_modules/oidc-provider/lib/index.js' implicitly has an 'any' type.
| urlencoded, | ||
| } from 'express'; | ||
| import isEmpty from 'lodash/isEmpty.js'; | ||
| import type Provider from 'oidc-provider'; |
Contributor
There was a problem hiding this comment.
⚠️ Could not find a declaration file for module 'oidc-provider'. '/home/runner/work/ui/ui/node_modules/.pnpm/oidc-provider@9.8.6/node_modules/oidc-provider/lib/index.js' implicitly has an 'any' type.
Contributor
|
It is imported by bundled/published frontend code (debounce, throttle, kebabCase, omit, mapValues), and the packages it replaced (just-debounce/just-throttle/kebab-case) were regular dependencies too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates several small third-party utility packages and hand-rolled helpers onto
es-toolkit. Note: es-toolkit was already present in the tree as a transitive dependency (via@storybook/addon-svelte-csf, at 1.43.0); this PR promotes it to a directdependency(^1.49.0) — it's imported by bundled/published frontend code, matching the classification of thejust-*/kebab-casepackages it replaces — and dedupes the version.lodash,just-debounce,just-throttle,kebab-case; addedes-toolkit.lodash/isEmpty→es-toolkit/compatisEmpty(oidc-server dev util; server-only)just-debounce→ es-toolkitdebouncejust-throttle→ es-toolkitthrottlekebab-case→ es-toolkitkebabCase(cleaner output; only affects a fallbackidinsearch.svelte, no test depends on the old leading-dash format)omit→ es-toolkitomit(array-key signature; 5 call sites)reduce-with-spread →mapValues(also removes an O(n²) accumulator spread) inworkflow-execution.tsandstandalone-activity-workers.svelteuniqueutil and the now-unused localomitutil (+ their testsBundle impact
Full production build compared before/after: net-neutral — raw JS +253 B, gzipped −92 B. Tree-shaking pulls only the used functions.
Testing
pnpm check→ 0 errorspnpm test -- --run→ all passingpnpm lintclean