Skip to content

Commit

Permalink
chore(backend): Drop deserialize from top-level export
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl committed Dec 15, 2023
1 parent 077642b commit d225d56
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .changeset/fifty-snakes-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@clerk/clerk-sdk-node': major
---

Internal top-level BAPI resources was dropped to resolve some issues with our type resolution and also make our exposed API cleaner.
```typescript
// Before
import { users } from "@clerk/clerk-sdk-node"
// After
import { clerkClient } from "@clerk/clerk-sdk-node"
clerkClient.users
```
23 changes: 23 additions & 0 deletions .changeset/tasty-terms-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@clerk/clerk-sdk-node': major
'@clerk/backend': major
'@clerk/nextjs': major
---

Changes in `@clerk/backend` exports:
- Drop Internal `deserialize` helper
- Introduce `/errors` subpath export, eg:
```typescript
import {
TokenVerificationError,
TokenVerificationErrorAction,
TokenVerificationErrorCode,
TokenVerificationErrorReason } from '@clerk/backend/errors';
```
- Drop errors from top-level export
```typescript
// Before
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend';
// After
import { TokenVerificationError, TokenVerificationErrorReason } from '@clerk/backend/errors';
```
1 change: 0 additions & 1 deletion packages/backend/src/__tests__/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export default (QUnit: QUnit) => {
'createIsomorphicRequest',
'debugRequestState',
'decodeJwt',
'deserialize',
'hasValidSignature',
'makeAuthObjectSerializable',
'prunePrivateMetadata',
Expand Down
1 change: 0 additions & 1 deletion packages/backend/src/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export * from './AllowlistIdentifier';
export * from './Client';
export * from './DeletedObject';
export * from './Deserializer';
export * from './Email';
export * from './EmailAddress';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ exports[`module exports should not change unless explicitly set 1`] = `
"createIsomorphicRequest",
"debugRequestState",
"decodeJwt",
"deserialize",
"hasValidSignature",
"makeAuthObjectSerializable",
"prunePrivateMetadata",
Expand Down

0 comments on commit d225d56

Please sign in to comment.