Skip to content
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

Refactor: dropzone context #355

Closed
wants to merge 5 commits into from

Conversation

4leite
Copy link
Contributor

@4leite 4leite commented Feb 27, 2024

Use discriminated union type for DropZoneContext to provide a better typed context.

Facilitates the removal of a bunch of guard clauses and better documents the expected use.

Export DropZoneContext inside useDropZoneContext, useDropZoneEditContext and useDropZoneRenderContext.
Throw error on incorrect mode - we could add an ErrorBoundary to catch this, shouldn't be necessary due to:.
The current behaviour of gracefully showing a message on missing context is retained by moving it to the parent component.

Copy link

vercel bot commented Feb 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 25, 2024 7:22am
puck-docs ✅ Ready (Inspect) Visit Preview Mar 25, 2024 7:22am

Copy link

vercel bot commented Feb 27, 2024

@4leite is attempting to deploy a commit to the Measured Team on Vercel.

A member of the Team first needs to authorize it.

@4leite 4leite changed the title Refactor: drop zone context Refactor: dropzone context Feb 27, 2024
Copy link
Member

@chrisvxd chrisvxd left a comment

Choose a reason for hiding this comment

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

Thanks for putting this together! All seem like sensible refactors so I'm pretty happy for this to go in once the latest conflicts are resolved.

@4leite
Copy link
Contributor Author

4leite commented Mar 25, 2024

Thanks for putting this together! All seem like sensible refactors so I'm pretty happy for this to go in once the latest conflicts are resolved.

Yeah you had to go and do all that work on the dnd iframe compat!

Got a bunch on and then it's Easter, so likely won't get back to this for a couple of weeks.

@chrisvxd
Copy link
Member

Closing this until you're ready @4leite

@chrisvxd chrisvxd closed this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants