-
Notifications
You must be signed in to change notification settings - Fork 31
feat: vercel edge sdk #77
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
feat: vercel edge sdk #77
Conversation
|
This pull request has been linked to Shortcut Story #194414: Update the SDK to pull in config from Vercel. |
| // TODO: Investigate if we can actually send events | ||
| sendEvents: false, |
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.
Leaving this for a follow up PR as it's a nice to have
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.
If vercel has fetch, then it should be possible. Not sure on the value, because I have not really been in the loop how we use these edge SDKs and why it is fine for them to not send events.
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 left a slack comment for @yusinto in regards to Cloudflare. When we go to enable events we want to also add in the track call. I'm not sure if it's waiting until sendEvents is usable to add that in.
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.
Yeah, we probably wouldn't want to add it before it actually sends events.
|
We figured we would need a shared folder for some potentially common edge provider items, but it is hard to say for sure until you make 2. :-) |
|
Please take a look at #83 which has the common code for cloudflare and vercel refactored to packages/shared/sdk-server-edge. |
Got it thanks! Actually had a scroll through already and will be making sure to get this updated today/tomorrow latest Thanks for doing all the heavy lifting with the shared stuff! |
No worries! Thank you for doing the Vercel sdk. I have merged #83 now so you'll be able to use it from main which makes it easier. |
|
Please take a look at #87 for producing cjs and esm bundles for the cloudflare sdk which you will need for Vercel also. TLDR your build command should use "type": "module",
"exports": {
"require": "./dist/cjs/src/index.js",
"import": "./dist/esm/src/index.js"
},
"main": "./dist/cjs/src/index.js",
"types": "./dist/cjs/src/index.d.ts",
"files": [
"/dist"
],
"scripts": {
"build": "../../../scripts/build-package.sh", |
|
The Cloudflare SDK 0.0.1 has been published. All code are in main now so you can safely follow the cloudflare sdk for vercel. Let me know if everything makes sense. Good luck! |
…n-config-from-vercel
|
I've made the changes that we talked about and adapted everything to use the new common modules where possible. |
yusinto
left a comment
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.
Nice work! I requested some changes but nothing serious.
You will also need to modify release-please-config.json for the initial publishing of this package. See this.
…n-config-from-vercel
[sc-194414]
This adds an Edge SDK for Vercel to be used with Vercel Edge Configs.
I've added some basic testing, and using the built package in a vercel project using npm link works as expected.