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

remove platform-specific dependencies from issuer #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aryasaatvik
Copy link
Contributor

@aryasaatvik aryasaatvik commented Jan 6, 2025

resolves #137

using dependency injection for storage adapter would improve bundling for runtimes other than node. It would also decouple the issuer from dynamodb if users are not deploying to dynamo.

This change improves the package's platform agnosticism by:

  • Reducing bundle size for non-AWS platforms (e.g., Cloudflare Workers)
  • Allowing storage implementations to be imported separately
  • Following dependency injection pattern for better testing and flexibility

cloudflare repro steps:

before Total Upload: 278.02 KiB / gzip: 60.67 KiB
after Total Upload: 230.52 KiB / gzip: 49.33 KiB

TODO:

  • update examples and other usage
  • add breaking change changeset

- Removed unused AWS Lambda handler import.
- Changed `storage` property in `IssuerInput` interface from optional to required.
- Simplified storage initialization logic by directly using `input.storage`.
- Cleaned up commented-out code related to Dynamo and Memory storage.

These changes enhance clarity and enforce the necessity of providing a storage option.
Copy link

changeset-bot bot commented Jan 6, 2025

⚠️ No Changeset found

Latest commit: af353b4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

use dependency injection for storage adapters
1 participant