Skip to content

chore(clerk-js): Deprecate FormControl#1912

Merged
panteliselef merged 3 commits into
mainfrom
elef/SDK-674-form-control-provider
Oct 31, 2023
Merged

chore(clerk-js): Deprecate FormControl#1912
panteliselef merged 3 commits into
mainfrom
elef/SDK-674-form-control-provider

Conversation

@panteliselef

@panteliselef panteliselef commented Oct 18, 2023

Copy link
Copy Markdown
Contributor

Description

This is PR starts the refactoring process for our forms. The main focus is refactoring how our fields are structure, starting the PlainInput which represents a simple input element.

In the immediate feature we want to completely drop Form.Control and offer these alternatives

  • Form.PasswordInput
  • Form.Checkbox
  • Form.RadioGroup
  • Form.InputGroup

Their API will remain simple and those will be opinionated about the UI they represent, the underlying implementation will allow for easy changes tho.

  • Replace Form.Control with Form.PlainInput (example usage)
  • Top level API remains simple, but the internally Form.PlainInput is very modular.
  • Renaming contexts and hooks with the field prefix in order to clearly indicate that the internal state reflects to a field not the entire form
    • FormFieldContextProvider replaces FormControlContextProvider (both need to co-exist until the refactor is complete)
  • Force the usage of isDisabled, isRequired over the native html attributes

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

@panteliselef
panteliselef requested a review from a team as a code owner October 18, 2023 10:49
@changeset-bot

changeset-bot Bot commented Oct 18, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b59249e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

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

@panteliselef panteliselef self-assigned this Oct 18, 2023
@panteliselef
panteliselef force-pushed the elef/SDK-674-form-control-provider branch from fd3d8b7 to bddf7ad Compare October 18, 2023 10:55
LabelRow: FieldLabelRow,
Input: InputElement,
Action: FieldAction,
AsOptional: FieldOptionalLabel,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe rename this to OptionalLabel ?

Comment thread packages/clerk-js/src/ui/components/SignUp/SignUpForm.tsx Outdated
Comment thread packages/clerk-js/src/ui/elements/FieldControl.tsx Outdated
Comment thread packages/clerk-js/src/ui/elements/RadioGroup.tsx Outdated
Comment thread packages/clerk-js/src/ui/elements/RadioGroup.tsx Outdated
Comment thread packages/clerk-js/src/ui/primitives/hooks/useFormControl.tsx

@anagstef anagstef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@panteliselef great stuff! just commit the changes we talked about and it's good to go.

@panteliselef
panteliselef changed the base branch from main to main-v4 October 26, 2023 18:01
@panteliselef
panteliselef force-pushed the elef/SDK-674-form-control-provider branch 4 times, most recently from 3964035 to c7f4085 Compare October 26, 2023 18:35

@anagstef anagstef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💯

@panteliselef
panteliselef changed the base branch from main-v4 to main October 30, 2023 09:57
@panteliselef
panteliselef force-pushed the elef/SDK-674-form-control-provider branch from c7f4085 to 7318421 Compare October 30, 2023 19:08
@panteliselef
panteliselef added this pull request to the merge queue Oct 30, 2023
@panteliselef
panteliselef removed this pull request from the merge queue due to a manual request Oct 30, 2023
@panteliselef
panteliselef force-pushed the elef/SDK-674-form-control-provider branch from 7318421 to e8a36d1 Compare October 31, 2023 10:56

@dimkl dimkl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add the deprecation of the FormControl in the main-v4 branch and open a clean-up PR from the main.

* Stand-alone express middlewares bound to the pre-initialised clerkClient
*/
export const ClerkExpressRequireAuth = (...args: any) => {
export const ClerkExpressRequireAuth = (...args: Parameters<ReturnType<typeof createClerkExpressRequireAuth>>) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this meant to be in this PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no! Should be dropped from this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is now dropped 🔥

@panteliselef
panteliselef force-pushed the elef/SDK-674-form-control-provider branch from e8a36d1 to b59249e Compare October 31, 2023 17:07
@panteliselef
panteliselef added this pull request to the merge queue Oct 31, 2023
Merged via the queue into main with commit 3ba3f38 Oct 31, 2023
@panteliselef
panteliselef deleted the elef/SDK-674-form-control-provider branch October 31, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants