-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Deno SDK #9206
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: Deno SDK #9206
Conversation
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 is a first pass. It is quite a bit of feedback but don't let that distract from how awesome this is. Great job man! <3
{ | ||
files: ['./test/*.ts'], | ||
rules: { | ||
'import/no-unresolved': 'off', |
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.
When we get rid of all the npm:
prefixes we can probably enable this rule again.
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.
Everything in /test/*
is Deno typescript.
Some imports use denos URL imports which eslint doesn't understand
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.
Checks out!
const error = new Error(); | ||
|
||
addGlobalEventProcessor((event: Event): Event | null => { | ||
const appRoot = getAppRoot(error); |
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.
h: Can we put this in the surrounding scope? That way we don't have to do the work over and over again.
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.
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.
Ah I am blind. Sorry!
|
||
import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.js'; | ||
import { getNormalizedEvent } from './normalize.ts'; | ||
import { makeTestTransport } from './transport.ts'; |
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.
m: We can configure the tsconfig to adjust the resolution of these imports to allow for .ts
endings. Right now TS is screaming.
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'll have a look. I have the Deno vscode extension installed so don't see these errors!
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.
allowImportingTsExtensions
is TypeScript 5+ and we're on 4.9.5.
For now I've added the Deno vscode extension to the recommended extensions and only enabled if for packages/deno/test
.
I've also had to disable eslint for the ./scripts
directory because the parser can't deal with top level await.
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.
Okok this also makes sense. I briefly discussed in the team whether we should bump the repo TS version to 5 but there are some considerations with regards to how we build types. Let's stick with the extension for now! Thanks for experimenting here.
Co-authored-by: Luca Forstner <[email protected]>
The main thing I've learnt is that at least for TypeScript < v5, it's impossible to create a tsconfig that gives zero errors for valid Deno TypeScript code... |
Closes #3009
This creates a Deno SDK which bundles all code and dependencies into
./build/index.js
along with bundled types at./build/index.d.ts
.There is a console prompt on startup if you haven't granted permissions for net access to the Sentry host:
It might be worth adding another prompt if we can't read the source files otherwise
ContextLines
won't be able to load anything.Other points to note:
@rollup/plugin-commonjs
becauselru_map
is commonjs. Vendoringlru_map
will simplify this"private": true,
since we don't want to publish this to npmTasks:
fetch
instrumentation is not workingconsole
instrumentation will not be working in modules loaded vianpm:*
specifiersimport { GLOBAL_OBJ } from 'npm:@sentry/utils'