Skip to content

Commit c67e154

Browse files
committed
feat(wasm): Adds a WASM integration
1 parent 1353c13 commit c67e154

File tree

18 files changed

+4682
-1
lines changed

18 files changed

+4682
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"packages/tracing",
3636
"packages/types",
3737
"packages/typescript",
38-
"packages/utils"
38+
"packages/utils",
39+
"packages/wasm"
3940
],
4041
"devDependencies": {
4142
"@google-cloud/storage": "^2.5.0",

packages/types/src/debugMeta.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Holds meta information to customize the behavior of sentry's event processing.
3+
**/
4+
export interface DebugMeta {
5+
images?: Array<DebugImage>;
6+
}
7+
8+
/**
9+
* Possible choices for debug images.
10+
*/
11+
export type DebugImageType = 'wasm' | 'macho' | 'elf' | 'pe';
12+
13+
/**
14+
* References to debug images.
15+
*/
16+
export interface DebugImage {
17+
type: DebugImageType;
18+
debug_id: string;
19+
code_id?: string | null;
20+
code_file: string;
21+
debug_file?: string | null;
22+
}

packages/types/src/event.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Breadcrumb } from './breadcrumb';
22
import { Contexts } from './context';
3+
import { DebugMeta } from './debugMeta';
34
import { Exception } from './exception';
45
import { Extras } from './extra';
56
import { Request } from './request';
@@ -41,6 +42,7 @@ export interface Event {
4142
type?: EventType;
4243
spans?: Span[];
4344
measurements?: Measurements;
45+
debug_meta?: DebugMeta;
4446
}
4547

4648
/** JSDoc */

packages/types/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export { Breadcrumb, BreadcrumbHint } from './breadcrumb';
22
export { Client } from './client';
33
export { Context, Contexts } from './context';
44
export { Dsn, DsnComponents, DsnLike, DsnProtocol } from './dsn';
5+
export { DebugImage, DebugImageType, DebugMeta } from './debugMeta';
56
export { ExtendedError } from './error';
67
export { Event, EventHint } from './event';
78
export { EventProcessor } from './eventprocessor';

packages/types/src/stackframe.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ export interface StackFrame {
1111
pre_context?: string[];
1212
post_context?: string[];
1313
in_app?: boolean;
14+
instruction_addr?: string;
15+
addr_mode?: string;
1416
vars?: { [key: string]: any };
1517
}

packages/wasm/.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
},
6+
parserOptions: {
7+
ecmaVersion: 2018,
8+
},
9+
extends: ['@sentry-internal/sdk'],
10+
ignorePatterns: ['build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**'],
11+
overrides: [
12+
{
13+
files: ['*.ts', '*.tsx', '*.d.ts'],
14+
parserOptions: {
15+
project: './tsconfig.json',
16+
},
17+
},
18+
{
19+
files: ['test/**'],
20+
rules: {
21+
'@typescript-eslint/no-explicit-any': 'off',
22+
'@typescript-eslint/no-non-null-assertion': 'off',
23+
},
24+
},
25+
],
26+
rules: {
27+
'max-lines': 'off',
28+
},
29+
};

packages/wasm/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.js.map
2+
*.d.ts
3+
*.js
4+
!.eslintrc.js

packages/wasm/.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
!*.js.map
3+
!*.d.ts
4+
!*.js
5+
!/esm/**/*
6+
jest.config.js

packages/wasm/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/wasm/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<p align="center">
2+
<a href="https://sentry.io" target="_blank" align="center">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4+
</a>
5+
<br />
6+
</p>
7+
8+
# Sentry JavaScript WebAssembly Support
9+
10+
[![npm version](https://img.shields.io/npm/v/@sentry/wasm.svg)](https://www.npmjs.com/package/@sentry/wasm)
11+
[![npm dm](https://img.shields.io/npm/dm/@sentry/wasm.svg)](https://www.npmjs.com/package/@sentry/wasm)
12+
[![npm dt](https://img.shields.io/npm/dt/@sentry/wasm.svg)](https://www.npmjs.com/package/@sentry/wasm)
13+
[![typedoc](https://img.shields.io/badge/docs-typedoc-blue.svg)](http://getsentry.github.io/sentry-javascript/)
14+
15+
## Links
16+
17+
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
18+
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)
19+
20+
## General
21+
22+
This package provides support for WebAssembly in stack traces.

0 commit comments

Comments
 (0)