-
Notifications
You must be signed in to change notification settings - Fork 381
chore(clerk-js): Remove unused pieces #6636
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
Conversation
🦋 Changeset detectedLatest commit: 6803a8e The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR removes multiple UI components, hooks, utilities, a commerce resource and related type/interfaces and barrel exports; converts several exported functions/types to module-private; and adds placeholder changesets. No new features or runtime control-flow changes. Changes
Sequence Diagram(s)(No sequence diagrams provided — changes are deletions and export visibility adjustments without new control-flow interactions.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
packages/clerk-js/src/ui/hooks/useScrollLock.ts (1)
17-65
: Harden for SSR and fix style typing for paddingPropIf enableScrollLock is called in a non-DOM environment, it will throw. Also, typing bodyStyle[paddingProp] is safer if paddingProp is explicitly narrowed.
Apply:
-function enableScrollLock() { +function enableScrollLock(): () => void { + if (typeof document === 'undefined' || typeof window === 'undefined') { + // No-op cleanup in SSR/non-DOM environments + return () => {}; + } const isIOS = /iP(hone|ad|od)|iOS/.test(getPlatform()); const bodyStyle = document.body.style; // RTL <body> scrollbar const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft; - const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight'; + const paddingProp: 'paddingLeft' | 'paddingRight' = scrollbarX ? 'paddingLeft' : 'paddingRight'; const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX; const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY; @@ - if (scrollbarWidth) { - bodyStyle[paddingProp] = `${scrollbarWidth}px`; - } + if (scrollbarWidth) { + bodyStyle[paddingProp] = `${scrollbarWidth}px`; + }packages/clerk-js/src/ui/hooks/useFetch.ts (3)
36-76
: Internalizing useCache is OK — but add a safe default snapshot to avoid undefined statesScoping useCache internally makes sense. However, returning undefined from getCache can cause downstream consumers to spread an undefined snapshot. Provide a default state when no cache exists yet.
-const useCache = <K = any, V = any>( +const useCache = <K = any, V = any>( key: K, serializer = serialize, ): { getCache: () => State<V> | undefined; @@ } => { const serializedKey = serializer(key); - const get = useCallback(() => requestCache.get(serializedKey), [serializedKey]); + const get = useCallback(() => requestCache.get(serializedKey), [serializedKey]);And pair with the return-path fix below (lines 180-186).
180-186
: Bug: spreading possibly-undefined cached snapshot throws at first renderIf no entry exists yet for cacheKey, getCache() returns undefined, useSyncExternalStore returns undefined, and
{ ...cached }
throws. Provide a safe default.- return { - ...cached, - setCache, - invalidate: clearCache, - revalidate, - }; + const defaultState: State<T, Error> = { + data: null, + error: null, + isLoading: false, + isValidating: false, + cachedAt: undefined, + }; + return { + ...(cached ?? defaultState), + setCache, + invalidate: clearCache, + revalidate, + };
109-114
: Fetcher ref never updates when fetcher changesfetcherRef is only initialized; it never updates if fetcher prop changes, leading to stale requests.
const fetcherRef = useRef(fetcher); + useEffect(() => { + fetcherRef.current = fetcher; + }, [fetcher]);packages/clerk-js/src/ui/elements/AvatarUploader.tsx (1)
60-64
: Bug: card stays loading after removehandleRemove sets loading and calls handleFileDrop(null), which early-returns and never resets the card state. Ensure we always setIdle.
- const handleRemove = async () => { - card.setLoading(); - await handleFileDrop(null); - return onAvatarRemove?.(); - }; + const handleRemove = async () => { + card.setLoading(); + try { + await handleFileDrop(null); + await Promise.resolve(onAvatarRemove?.()); + } catch (err) { + handleError(err as Error, [], card.setError); + } finally { + card.setIdle(); + } + };packages/clerk-js/src/ui/elements/FormControl.tsx (1)
20-49
: Internalizing useFormTextAnimation: add missing dependency and (optionally) explicit return type
- The callback depends on appearanceAnimations but it’s not in the dependency array; theme/layout animation updates won’t propagate. Add it to avoid stale closures.
- Optional: add an explicit return type for the hook to improve readability and satisfy “explicit return types” guidance even for internal hooks.
Apply this diff:
-function useFormTextAnimation() { +function useFormTextAnimation(): { + readonly getFormTextAnimation: ( + enterAnimation: boolean, + options?: { inDelay?: boolean }, + ) => ThemableCssProp; +} { const prefersReducedMotion = usePrefersReducedMotion(); const { animations: appearanceAnimations } = useAppearance().parsedLayout; const getFormTextAnimation = useCallback( (enterAnimation: boolean, options?: { inDelay?: boolean }): ThemableCssProp => { if (prefersReducedMotion || !appearanceAnimations) { return { animation: 'none', }; } ... - [prefersReducedMotion], + [prefersReducedMotion, appearanceAnimations], ); return { getFormTextAnimation, }; }
🧹 Nitpick comments (9)
packages/clerk-js/src/ui/hooks/useScrollLock.ts (1)
79-85
: Make disableScrollLock idempotent and prevent negative lock countsUnbalanced calls can drive lockCount negative. Clamp and guard cleanup to run only once.
- disableScrollLock: () => { - lockCount--; - if (lockCount === 0) { - cleanup(); - } - }, + disableScrollLock: () => { + if (lockCount > 0) { + lockCount--; + if (lockCount === 0) { + cleanup(); + cleanup = () => {}; + } + } + },packages/clerk-js/src/ui/hooks/useFetch.ts (3)
157-167
: Avoid negative setTimeout delays when throttlingIf (n - d) > throttleTime, waitTime becomes negative. Normalize to 0 to avoid relying on browser coercion.
- const waitTime = throttleTime - (n - d); + const waitTime = Math.max(0, throttleTime - (n - d)); @@ - setTimeout(() => { + setTimeout(() => { setCache({
30-33
: Tests-only helper clearFetchCache doesn’t notify subscribersIf tests depend on re-render from clearing cache, consider notifying subscribers after reset.
export const clearFetchCache = () => { requestCache = new Map<string, State>(); + subscribers.forEach(cb => cb()); };
1-15
: Prefer unknown over any in public types (if feasible)State<Data = any, Error = any> and generic defaults use any. If public type compatibility allows, default to unknown and narrow where used.
-export type State<Data = any, Error = any> = { +export type State<Data = unknown, Error = unknown> = {Note: keep as-is if this causes downstream breakage.
packages/clerk-js/src/ui/elements/AvatarUploader.tsx (3)
16-23
: Privatizing fileToBase64 is fine — add error handling for read failuresThe promise rejection from FileReader is currently unhandled at the call site.
- void fileToBase64(file).then(setObjectUrl); + void fileToBase64(file) + .then(setObjectUrl) + .catch(err => handleError(err, [], card.setError));
33-35
: Rename objectUrl to previewUrl for clarityThe value is a data URL, not an object URL. Nit, but improves readability.
No diff provided to avoid churn; consider renaming in a follow-up.
108-119
: Remove showUpload gate from “Remove” button or reset it properlyshowUpload toggles on successful upload but isn’t used elsewhere to actually “show upload.” This can hide the Remove button unexpectedly.
- Either remove the showUpload condition:
- {!!onAvatarRemove && !showUpload && ( + {!!onAvatarRemove && (
- Or reset showUpload to false after finishing upload/removal.
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx (1)
27-31
: Tighten types for interleaveElementInArray to avoid any and preserve array typingCurrent typing returns A but casts via any. Suggest a stricter signature.
-const interleaveElementInArray = <T, A extends T[]>(arr: A, generator: (i: number) => any): A => { - return arr.reduce((acc, child, i) => { - return i === arr.length - 1 ? [...acc, child] : [...acc, child, generator(i)]; - }, [] as any); -}; +const interleaveElementInArray = <T>( + arr: T[], + generator: (i: number) => React.ReactNode, +): Array<T | React.ReactNode> => { + return arr.reduce<Array<T | React.ReactNode>>((acc, child, i) => { + return i === arr.length - 1 ? [...acc, child] : [...acc, child, generator(i)]; + }, []); +};packages/clerk-js/src/ui/elements/FormControl.tsx (1)
51-67
: Internalizing useCalculateErrorTextHeight: add explicit return type; reconsider height math (optional)
- Add an explicit return type to align with project guidance and aid maintenance.
- Optional: Using element.offsetTop as a proxy for vertical padding can be inaccurate. If you intended to include vertical padding/margins, prefer scrollHeight + computed paddings, or getBoundingClientRect for actual rendered height.
Apply this diff for typing:
-const useCalculateErrorTextHeight = ({ feedback }: { feedback: string }) => { +const useCalculateErrorTextHeight = ( + { feedback }: { feedback: string }, +): { + height: number; + calculateHeight: (element: HTMLElement | null) => void; +} => {If you’d like to refine the measurement, here’s a drop-in alternative for calculateHeight:
const calculateHeight = useCallback((element: HTMLElement | null) => { if (element) { const style = getComputedStyle(element); const paddingY = parseFloat(style.paddingTop || '0') + parseFloat(style.paddingBottom || '0'); setHeight(element.scrollHeight + paddingY); } }, [feedback]);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (23)
.changeset/long-owls-yawn.md
(1 hunks)packages/clerk-js/src/core/resources/CommerceProduct.ts
(0 hunks)packages/clerk-js/src/core/resources/internal.ts
(0 hunks)packages/clerk-js/src/ui/common/BlockButtons.tsx
(0 hunks)packages/clerk-js/src/ui/common/index.ts
(0 hunks)packages/clerk-js/src/ui/elements/AvatarUploader.tsx
(1 hunks)packages/clerk-js/src/ui/elements/BlockWithTrailingComponent.tsx
(0 hunks)packages/clerk-js/src/ui/elements/Disclosure.tsx
(0 hunks)packages/clerk-js/src/ui/elements/FormControl.tsx
(2 hunks)packages/clerk-js/src/ui/elements/NavigateToFlowStartButton.tsx
(0 hunks)packages/clerk-js/src/ui/elements/Pagination.tsx
(0 hunks)packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
(1 hunks)packages/clerk-js/src/ui/elements/TileButton.tsx
(0 hunks)packages/clerk-js/src/ui/hooks/index.ts
(0 hunks)packages/clerk-js/src/ui/hooks/useDelayedVisibility.ts
(0 hunks)packages/clerk-js/src/ui/hooks/useFetch.ts
(1 hunks)packages/clerk-js/src/ui/hooks/useResizeObserver.ts
(0 hunks)packages/clerk-js/src/ui/hooks/useScrollLock.ts
(1 hunks)packages/clerk-js/src/utils/componentGuards.ts
(0 hunks)packages/clerk-js/src/utils/passwords/strength.ts
(1 hunks)packages/clerk-js/src/utils/runtime.ts
(0 hunks)packages/clerk-js/src/utils/url.ts
(0 hunks)packages/types/src/json.ts
(0 hunks)
💤 Files with no reviewable changes (16)
- packages/clerk-js/src/core/resources/internal.ts
- packages/clerk-js/src/utils/runtime.ts
- packages/clerk-js/src/ui/common/index.ts
- packages/types/src/json.ts
- packages/clerk-js/src/ui/elements/NavigateToFlowStartButton.tsx
- packages/clerk-js/src/ui/hooks/index.ts
- packages/clerk-js/src/utils/componentGuards.ts
- packages/clerk-js/src/core/resources/CommerceProduct.ts
- packages/clerk-js/src/utils/url.ts
- packages/clerk-js/src/ui/hooks/useResizeObserver.ts
- packages/clerk-js/src/ui/elements/Disclosure.tsx
- packages/clerk-js/src/ui/elements/TileButton.tsx
- packages/clerk-js/src/ui/elements/Pagination.tsx
- packages/clerk-js/src/ui/hooks/useDelayedVisibility.ts
- packages/clerk-js/src/ui/elements/BlockWithTrailingComponent.tsx
- packages/clerk-js/src/ui/common/BlockButtons.tsx
🧰 Additional context used
📓 Path-based instructions (10)
packages/clerk-js/src/ui/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)
packages/clerk-js/src/ui/**/*.{ts,tsx}
: Element descriptors should always be camelCase
Use element descriptors in UI components to enable consistent theming and styling via appearance.elements
Element descriptors should generate unique, stable CSS classes for theming
Element descriptors should handle state classes (e.g., cl-loading, cl-active, cl-error, cl-open) automatically based on component state
Do not render hard-coded values; all user-facing strings must be localized using provided localization methods
Use the useLocalizations hook and localizationKeys utility for all text and error messages
Use the styled system (sx prop, theme tokens, responsive values) for custom component styling
Use useCardState for card-level state, useFormState for form-level state, and useLoadingStatus for loading states
Always use handleError utility for API errors and use translateError for localized error messages
Use useFormControl for form field state, implement proper validation, and handle loading and error states in forms
Use localization keys for all form labels and placeholders
Use element descriptors for consistent styling and follow the theme token system
Use the Card and FormContainer patterns for consistent UI structure
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
packages/clerk-js/src/utils/passwords/strength.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
packages/clerk-js/src/utils/passwords/strength.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
packages/clerk-js/src/utils/passwords/strength.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
packages/clerk-js/src/utils/passwords/strength.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
packages/clerk-js/src/utils/passwords/strength.ts
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{jsx,tsx}
: Use error boundaries in React components
Minimize re-renders in React components
**/*.{jsx,tsx}
: Always use functional components with hooks instead of class components
Follow PascalCase naming for components:UserProfile
,NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/hooks/useFetch.ts
packages/clerk-js/src/ui/hooks/useScrollLock.ts
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
packages/clerk-js/src/utils/passwords/strength.ts
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/react.mdc)
**/*.tsx
: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering
Files:
packages/clerk-js/src/ui/elements/AvatarUploader.tsx
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
packages/clerk-js/src/ui/elements/FormControl.tsx
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/long-owls-yawn.md
🪛 LanguageTool
.changeset/long-owls-yawn.md
[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---
(QB_NEW_DE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Build Packages
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: pr-title-lint
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
packages/clerk-js/src/ui/hooks/useScrollLock.ts (1)
6-14
: Privatization of getPlatform Verified—No Remaining External ImportsAll checks passed:
- Confirmed packages/clerk-js/src/ui/hooks/useScrollLock.ts exists.
- Verified getPlatform is not exported from that module.
- Searched the entire codebase—no references to getPlatform outside of useScrollLock.ts.
Privatizing getPlatform is safe. No further action needed.
packages/clerk-js/src/ui/hooks/useFetch.ts (1)
36-76
: No external imports ofuseCache
remain
All searches forimport { useCache }
outside ofpackages/clerk-js/src/ui/hooks/useFetch.ts
returned no matches. It’s safe to proceed with makinguseCache
internal.packages/clerk-js/src/ui/elements/AvatarUploader.tsx (1)
72-77
: Safe cloning: ensure avatarPreview supports imageUrl propAssuming avatarPreview expects imageUrl, this is fine. If not guaranteed, add a guard or use a context-specific prop.
Please confirm avatarPreview always accepts an imageUrl prop; otherwise this clone could pass unused props silently.
packages/clerk-js/src/ui/elements/ReversibleContainer.tsx (1)
22-25
: No external references to ReversibleContainer remain—changes approved
- A project-wide search confirmed that
ReversibleContainer
is only used within its own file (packages/clerk-js/src/ui/elements/ReversibleContainer.tsx
) and is not imported elsewhere.- All external imports now reference only
SocialButtonsReversibleContainerWithDivider
, as intended.packages/clerk-js/src/utils/passwords/strength.ts (1)
5-15
: No external imports ofPasswordStrength
detected
I ran a repo-wide search and the only occurrences ofPasswordStrength
are:
- Its definition in
packages/clerk-js/src/utils/passwords/strength.ts
- A coincidentally similarly named type in
packages/types/src/passwords.ts
(no import from Clerk)- Internal calls to
createValidatePasswordStrength
(but not to thePasswordStrength
type itself)So privatizing the type won’t break any direct imports elsewhere.
Next step: confirm no declaration-emit errors
Please run the type-check/build for theclerk-js
package (e.g.npm run build
ortsc
) and ensure you don’t see errors like
“has or is using private name ‘PasswordStrength’”
If you do encounter that error, either:
- Export
PasswordStrength
from your public API (e.g. add it to your barrel), or- Change the exported function’s signature so it doesn’t expose the private type.
Once that’s green, update your Changeset if this constitutes a breaking change. I’m happy to help craft that entry.
packages/clerk-js/src/ui/elements/FormControl.tsx (1)
20-20
: ✅ No external deep imports detectedI searched the entire repository (excluding build artifacts) for:
- Imports of
useFormTextAnimation
- Imports of
useCalculateErrorTextHeight
- Any deep imports from
ui/elements/FormControl
No occurrences were found, so removing these exports will not break external consumers.
--- | ||
--- |
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.
💡 Verification agent
🧩 Analysis chain
Empty changeset will fail release automation — fill in package and bump type or remove the file
The file only contains frontmatter delimiters. Changesets expects at least one package with a bump type and a short summary. Given this PR removes/privatizes exports, please either mark as "none" (if truly no public surface change) or "patch/minor" with a clear note.
Apply one of the following:
Option A — publish a patch (replace PACKAGE_NAME after verifying from packages/clerk-js/package.json):
----
----
+---
+'PACKAGE_NAME': patch
+---
+
+chore(clerk-js): remove unused internal pieces and privatize non-public helpers. No public API changes.
Option B — no release (documentation-only/internal cleanup):
----
----
+---
+'PACKAGE_NAME': none
+---
+
+Internal cleanup: remove unused pieces and privatize helpers (no public API changes).
Run to confirm the actual package name and whether any removed symbols were part of the public export map:
🏁 Script executed:
#!/bin/bash
# Find package name
cat packages/clerk-js/package.json | jq -r '.name,.exports'
# Check if removed/privatized symbols were publicly exported (should return no matches)
rg -nP -C2 "(export\\s+\\*\\s+from\\s+['\"]/ui/(elements|hooks)/|CommerceProduct|CommerceProductJSON|useCache\\b|ReversibleContainer\\b|getPlatform\\b|fileToBase64\\b)" packages/clerk-js
Length of output: 6399
🏁 Script executed:
#!/bin/bash
# Inspect package.json entry points for clerk-js
echo "package.json entry points:"
jq '{main, module, types, exports}' packages/clerk-js/package.json
echo
# Locate any index.ts files in the clerk-js package
echo "Index files:"
fd --type f index.ts packages/clerk-js
echo
# Print the first 50 lines of each index.ts to see what is publicly re-exported
for file in $(fd --type f index.ts packages/clerk-js); do
echo "==> $file <=="
head -n 50 "$file"
echo
done
Length of output: 66782
🏁 Script executed:
#!/bin/bash
# Inspect package.json for entry points
echo "Package entry points:"
jq '.name, .main, .module, .types, .exports' packages/clerk-js/package.json
echo
# Search public index.ts exports for removed symbols
echo "Searching public exports for removed symbols:"
rg -nP 'fileToBase64|ReversibleContainer|useCache|getPlatform|CommerceProduct|CommerceProductJSON' -g 'packages/clerk-js/src/**/index.ts' -n
Length of output: 462
Fill in bump type for @clerk/clerk-js
The current changeset file (.changeset/long-owls-yawn.md
) is empty and will break the release automation. Since none of the removed symbols are part of the public API, please mark this as a “none” release.
• File needing update:
.changeset/long-owls-yawn.md
• Replace its contents with:
---
'@clerk/clerk-js': none
---
Internal cleanup: remove unused internal pieces and privatize non-public helpers (no public API changes).
🧰 Tools
🪛 LanguageTool
[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: --- ---
(QB_NEW_DE)
🤖 Prompt for AI Agents
In .changeset/long-owls-yawn.md around lines 1-2 the file is empty which will
break release automation; replace the file contents with a changeset that sets
'@clerk/clerk-js' to "none" and includes the provided rationale line ("Internal
cleanup: remove unused internal pieces and privatize non-public helpers (no
public API changes).") so the changeset YAML is valid and marks this as a none
release.
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.
👏
Description
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit
Chores
Refactor
Documentation
Impact