-
Notifications
You must be signed in to change notification settings - Fork 33
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
feature: make package environment agnostic #81
feature: make package environment agnostic #81
Conversation
Your contribution is very appreciated @f5io! Some unfortunate timing that we are currently in the process of moving this SDK source code to the Magic JS monorepo. We expect to have completed the transition next week. At that time we would love to help you translate this PR to the new repo! |
@@ -1,5 +1,6 @@ | |||
import fetch, { RequestInit } from 'node-fetch'; | |||
import { RequestInit } from 'node-fetch'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be updated to import type {...
now that an async shim is being used instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did attempt to change type imports with the following in the tsconfig.json...
...
"importsNotUsedAsValues": "error",
...
however, it seems like your current linting set up does not support this syntax :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can look at this as a follow-up on our side, in that case!
absolutely happy to transition these changes into the new monorepo, just let me know when you are ready 👍 |
Priorities shifted a bit and we'll be delaying the merging of this package into our JS monorepo for now. Just a heads up that I'll be reviewing your change shortly and hopefully we can cut a release by end-of-week! |
@f5io We have updated our test framework to use Jest in order to align this repository with the code standards in our monorepo. This change does create a few minor conflicts in your PR. Once we can get those sorted, I'm happy to ship this one! |
@smithki on it... will sort asap |
a88c7c1
to
c79b704
Compare
@smithki rebased my branch from your master, everything seems to be passing as intended 👍 |
hey @smithki, just bumping this... we're planning on going into production with this approach in a couple of weeks. obviously, i'm more than happy to roll with pointing at my fork for now. |
I'd like to bump this as well, I think this'll get me unblocked from using Magic with Convex |
@smithki Don't want to annoy anybody, but I've been encountering similar issues with Remix on Cloudflare Pages (running on dynamic workers functions, which don't run full-blown Node.js for efficiency). Would greatly appreciate having this integrated! |
🚀 PR was released in |
📦 Pull Request
This PR makes the
@magic-sdk/admin
package environment agnostic byeth-sig-util
andethereumjs-util
that rely heavily onnode
internals.ethereum-cryptography
and some inlined functionality.Buffer
in favour of typed arrays.node-fetch
only where no globalfetch
implementation is available.commonjs
andesm
outputs of the package.✅ Fixed Issues
deno
although I have not tested.🚨 Test instructions
All tests pass and coverage is maintained.
I have also created an example of this new
@magic-sdk/admin
running in asveltekit
application: https://github.com/f5io/magic-link-cloudflare-demoHere it is actually deployed on cloudflare workers 🎉 : https://magic-link-demo.trustshare.workers.dev/
minor
: New Feature