Replay one TypeScript execution where a typed client request calls a typed worker response module.

Project Entry

request_client.ts
type ClientRequest = {
    command: "status" | "refresh" | "archive";
    label: string;
};

function buildRequest(command: ClientRequest["command"]): ClientRequest {
    let label = command;

    if (command === "refresh") {
        label = "cache";
    } else if (command === "archive") {
        label = "records";
    }

    return {
        command,
        label
    };
}

const command: ClientRequest["command"] = ;
const request: ClientRequest = buildRequest(command);
const response = require("./request_worker.ts").handleRequest(request.command);
const ticket = 40 + request.command.length;

console.log(`command=${request.command}`);
console.log(`label=${request.label}`);
console.log(`ticket=${ticket}`);
console.log(`${response.access}:${response.message}`);
type ClientRequest = {
    command: "status" | "refresh" | "archive";
    label: string;
};

function buildRequest(command: ClientRequest["command"]): ClientRequest {
    let label = command;

    if (command === "refresh") {
        label = "cache";
    } else if (command === "archive") {
        label = "records";
    }

    return {
        command,
        label
    };
}

const command: ClientRequest["command"] = ;
const request: ClientRequest = buildRequest(command);
const response = require("./request_worker.ts").handleRequest(request.command);
const ticket = 40 + request.command.length;

console.log(`command=${request.command}`);
console.log(`label=${request.label}`);
console.log(`ticket=${ticket}`);
console.log(`${response.access}:${response.message}`);
type ClientRequest = {
    command: "status" | "refresh" | "archive";
    label: string;
};

function buildRequest(command: ClientRequest["command"]): ClientRequest {
    let label = command;

    if (command === "refresh") {
        label = "cache";
    } else if (command === "archive") {
        label = "records";
    }

    return {
        command,
        label
    };
}

const command: ClientRequest["command"] = ;
const request: ClientRequest = buildRequest(command);
const response = require("./request_worker.ts").handleRequest(request.command);
const ticket = 40 + request.command.length;

console.log(`command=${request.command}`);
console.log(`label=${request.label}`);
console.log(`ticket=${ticket}`);
console.log(`${response.access}:${response.message}`);
source panels When an example has more than one source file, replay keeps each file in its own panel while preserving one ordered trace stream. The Variables panel follows the actual typed request call into the worker module and the returned response back to the client.
typed boundary The client owns the selected command and visible summary. The worker owns the typed response rule for that command.