-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[browser] add and load empty ES6 module dotnet.diag.js when FeaturePerfTracing #112787
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
f440e23
wip
pavelsavara c76dd88
more
pavelsavara 556502c
more
pavelsavara ebc7505
Merge branch 'main' into browser_diag_js
pavelsavara f8c1382
more
pavelsavara 019d6d2
more
pavelsavara 0b6b080
Merge branch 'main' into browser_diag_js
pavelsavara ddf4999
more
pavelsavara 12553b2
more
pavelsavara 4f67aef
Update src/mono/wasm/Wasm.Build.Tests/DiagnosticsTests.cs
pavelsavara 7631177
Merge branch 'main' into browser_diag_js
pavelsavara 066db18
feedback
pavelsavara d275bce
more
pavelsavara add8bac
fix
pavelsavara 0e875e7
better
pavelsavara 7a435cc
feedback
pavelsavara 953b8f6
more
pavelsavara 3650c6e
more
pavelsavara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| import type { CharPtr, VoidPtr } from "./types/emscripten"; | ||
|
|
||
| import { diagHelpers } from "./globals"; | ||
|
|
||
| export function ds_rt_websocket_create (urlPtr :CharPtr):number { | ||
| return diagHelpers.ds_rt_websocket_create(urlPtr); | ||
| } | ||
|
|
||
| export function ds_rt_websocket_send (client_socket :number, buffer:VoidPtr, bytes_to_write:number):number { | ||
| return diagHelpers.ds_rt_websocket_send(client_socket, buffer, bytes_to_write); | ||
| } | ||
|
|
||
| export function ds_rt_websocket_poll (client_socket :number):number { | ||
| return diagHelpers.ds_rt_websocket_poll(client_socket); | ||
| } | ||
|
|
||
| export function ds_rt_websocket_recv (client_socket :number, buffer:VoidPtr, bytes_to_read:number):number { | ||
| return diagHelpers.ds_rt_websocket_recv(client_socket, buffer, bytes_to_read); | ||
| } | ||
|
|
||
| export function ds_rt_websocket_close (client_socket :number):number { | ||
| return diagHelpers.ds_rt_websocket_close(client_socket); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
|
|
||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| import type { DiagHelpers, GlobalObjects, LoaderHelpers, RuntimeHelpers, DotnetModuleInternal } from "../types/internal"; | ||
|
|
||
| export let _diagModuleLoaded = false; // please keep it in place also as rollup guard | ||
|
|
||
| export let diagHelpers: DiagHelpers = null as any; | ||
| export let runtimeHelpers: RuntimeHelpers = null as any; | ||
| export let loaderHelpers: LoaderHelpers = null as any; | ||
| export let Module: DotnetModuleInternal = null as any; | ||
|
|
||
| export function setRuntimeGlobalsImpl (globalObjects: GlobalObjects): void { | ||
| if (_diagModuleLoaded) { | ||
| throw new Error("Diag module already loaded"); | ||
| } | ||
| _diagModuleLoaded = true; | ||
| diagHelpers = globalObjects.diagHelpers; | ||
| runtimeHelpers = globalObjects.runtimeHelpers; | ||
| loaderHelpers = globalObjects.loaderHelpers; | ||
| Module = globalObjects.module; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| import type { GlobalObjects } from "../types/internal"; | ||
| import type { CharPtr, VoidPtr } from "../types/emscripten"; | ||
|
|
||
| import { diagHelpers, setRuntimeGlobalsImpl } from "./globals"; | ||
|
|
||
| /* eslint-disable @typescript-eslint/no-unused-vars */ | ||
| export function setRuntimeGlobals (globalObjects: GlobalObjects): void { | ||
| setRuntimeGlobalsImpl(globalObjects); | ||
|
|
||
| diagHelpers.ds_rt_websocket_create = (urlPtr :CharPtr):number => { | ||
| throw new Error("Not implemented"); | ||
| }; | ||
|
|
||
| diagHelpers.ds_rt_websocket_send = (client_socket :number, buffer:VoidPtr, bytes_to_write:number):number => { | ||
| throw new Error("Not implemented"); | ||
| }; | ||
|
|
||
| diagHelpers.ds_rt_websocket_poll = (client_socket :number):number => { | ||
| throw new Error("Not implemented"); | ||
| }; | ||
|
|
||
| diagHelpers.ds_rt_websocket_recv = (client_socket :number, buffer:VoidPtr, bytes_to_read:number):number => { | ||
| throw new Error("Not implemented"); | ||
| }; | ||
|
|
||
| diagHelpers. ds_rt_websocket_close = (client_socket :number):number => { | ||
| throw new Error("Not implemented"); | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| import { loaderHelpers } from "./globals"; | ||
|
|
||
| /* eslint-disable no-console */ | ||
|
|
||
| const prefix = "MONO_WASM: "; | ||
|
|
||
| export function mono_log_debug (messageFactory: string | (() => string)) { | ||
| if (loaderHelpers.diagnosticTracing) { | ||
| const message = (typeof messageFactory === "function" | ||
| ? messageFactory() | ||
| : messageFactory); | ||
| console.debug(prefix + message); | ||
| } | ||
| } | ||
|
|
||
| export function mono_log_info (msg: string, ...data: any) { | ||
| console.info(prefix + msg, ...data); | ||
| } | ||
|
|
||
| export function mono_log_warn (msg: string, ...data: any) { | ||
| console.warn(prefix + msg, ...data); | ||
| } | ||
|
|
||
| export function mono_log_error (msg: string, ...data: any) { | ||
| if (data && data.length > 0 && data[0] && typeof data[0] === "object") { | ||
| // don't log silent errors | ||
| if (data[0].silent) { | ||
| return; | ||
| } | ||
| if (data[0].toString) { | ||
| console.error(prefix + msg, data[0].toString()); | ||
| return; | ||
| } | ||
| } | ||
| console.error(prefix + msg, ...data); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.