chore(clerk-js,clerk-react,types): Expose environment for better inter-package development
Description
We're utilizing __unstable__environment a bunch in elements and the current state doesn't enforce type safety and requires us to override types in our own package.
The better facilitate inter-package development, I've made the following changes to Clerk and IsomorphicClerk:
-
__unstable__environmentis now exposed, typed, marked as deprecated, and commented on about its internal state. (To be removed in a future release.) -
__internal_environmentis exposed with the appropriate typing and comments about its internal state.
Notes:
- I left
__unstable__environmentfor now, until it's worked out of bothelementsand the accounts repo.
Checklist
- [x]
npm testruns as expected. - [x]
npm run buildruns 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
- [x] 📖 Refactoring / dependency upgrade / documentation
- [ ] other:
Packages affected
- [ ]
@clerk/backend - [ ]
@clerk/chrome-extension - [x]
@clerk/clerk-js - [ ]
@clerk/clerk-expo - [ ]
@clerk/fastify - [ ]
gatsby-plugin-clerk - [ ]
@clerk/localizations - [ ]
@clerk/nextjs - [x]
@clerk/clerk-react - [ ]
@clerk/remix - [ ]
@clerk/clerk-sdk-node - [ ]
@clerk/shared - [ ]
@clerk/themes - [x]
@clerk/types - [ ]
build/tooling/chore
🦋 Changeset detected
Latest commit: 8ee6298bf19d0df5466dc28abad818d7f59efa5f
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 12 packages
| Name | Type |
|---|---|
| @clerk/clerk-js | Patch |
| @clerk/clerk-react | Patch |
| @clerk/types | Patch |
| @clerk/chrome-extension | Patch |
| @clerk/clerk-expo | Patch |
| @clerk/elements | Patch |
| gatsby-plugin-clerk | Patch |
| @clerk/nextjs | Patch |
| @clerk/remix | Patch |
| @clerk/backend | Patch |
| @clerk/fastify | Patch |
| @clerk/clerk-sdk-node | 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
@tmilewski With the current state of elements and given that we're going to be discussing architecture-level changes to the SDKs, do you believe this is still needed for now?
@nikosdouvlis I'd say that I feel this is appropriate beyond the scope of those projects.
@nikosdouvlis I'd say that I feel this is appropriate beyond the scope of those projects.
I'm worried that making accessing EnvironmentResource easier will lead to coupling the SDKs to the instance config more. Right now, we've only used it outside of clerk-js as an escape hatch as this needs to be designed properly. You mentioned typed safety, can we import EnvironmentResource from clerk/types for now?
Also, we can rename __unstable to __internal without keeping the other prop around as this is an internal and going in v5.
Hey @tmilewski any updates on the above?
It feels like we can import EnvironmentResource from clerk/types for now, close this one and re-iterate once the architecture project is over