Uh oh!
There was an error while loading. Please reload this page.
feat: Deno SDK - #9206
Conversation
lforst
left a comment
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| { | ||
| files: ['./test/*.ts'], | ||
| rules: { | ||
| 'import/no-unresolved': 'off', |
There was a problem hiding this comment.
When we get rid of all the npm: prefixes we can probably enable this rule again.
There was a problem hiding this comment.
Everything in /test/* is Deno typescript.
Some imports use denos URL imports which eslint doesn't understand
Uh oh!
There was an error while loading. Please reload this page.
| const error = new Error(); | ||
| addGlobalEventProcessor((event: Event): Event | null => { | ||
| const appRoot = getAppRoot(error); |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
| 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.
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.
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.
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.
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 <luca.forstner@gmail.com>
timfish
commented
Oct 12, 2023
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.jsalong 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
ContextLineswon't be able to load anything.Other points to note:
@rollup/plugin-commonjsbecauselru_mapis commonjs. Vendoringlru_mapwill simplify this"private": true,since we don't want to publish this to npmTasks:
fetchinstrumentation is not workingconsoleinstrumentation will not be working in modules loaded vianpm:*specifiersimport { GLOBAL_OBJ } from 'npm:@sentry/utils'