Skip to content

cmd/trace: the trace command should not contain hardcoded javascript #16377

@jcorbin

Description

@jcorbin

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

Latest master 1.7.

  1. What operating system and processor architecture are you using (go env)?

n/a, but darwin/linux amd64.

  1. What did you do?

I originally tried to use go tool trace in 1.6:

  • found that the bundled catapult trace viewer was so old as to need a deprecated experimental browser api
  • followed the thread from misc/trace/README.md
  • after copying in a newer trace viewer bundle, it turned out that the api had shifted so much that the inline javascript was now broken

From there I started hacking on my copy of the go 1.6 source, eventually I got a hold of the 1.7 source and found that at least all of the assets had already been upgraded (now including a polyfill for the ill-fated Object.observe).

However the future surface area fur such drift had only increased since 1.6; compare:

This is truly unfortunate since the only dynamic part of that entire "template" is a URL parameter for the XHR request to load data.

  1. What did you expect to see?

Principled separation between frontend code and server-side code.

  1. What did you see instead?

A hardcoded html+javascript "template" (not even an html/template

I have a proposed change that I'm working to get into Gerrit now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions