Skip to content
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

Make TensorBoard work in raw sources mode #747

Merged
merged 1 commit into from
Nov 18, 2017
Merged

Conversation

jart
Copy link
Contributor

@jart jart commented Nov 17, 2017

With this change we withdraw our support for the ECMA import keyword hitherto
mandated by certain tools. In doing so, TensorBoard compiles in seconds, rather
than taking a minute.

The ES6 import standard only defines / and ./ prefixed paths. All other paths
that exist are undefined. Since most tooling and early-adopter codebases rely
on the undefined behavior, the standard itself is mostly syntactic sugar (that
isn't even sweet.) The true problem is having a world where Closure, Node, and
web server namespaces coexist.

The ES6 import keyword makes JavaScript incompatible with web browsers. The
support added in Chrome 61 is not sufficient, as it only allows the export
keyword on functions and not variables. This is a point of view much different
from early-adopters, which raises concerns that the standard is unlikely to
gain a meaningful consensus.

The ES6 import keyword makes TypeScript incompatible with web browsers. This
keyword is not supported by the TypeScript compiler. All it can do is punt the
problem to rollup. However we can't use rollup since it doesn't support Closure
namespaces.

The only tool that supports all three of Web, Node, and Closure namespaces is
the Closure Compiler. Without it, ES6 TypeScript or JavaScript can't run in any
web browser.

But since the Closure Compiler was designed to create production builds for
google.com, it isn't very fast. Therefore it's unreasonable that developers on
a small project like TensorBoard should be expected to wait on this tool
whenever making one line changes in a development iteration cycle.

Since the Closure Tools were originally designed to be compatible with web
browsers in the absense of tooling, this change seeks to bring TensorBoard back
into accordance with those principles.

@jart jart requested a review from chihuahua November 17, 2017 08:25
With this change we withdraw our support for the ECMA `import` keyword hitherto
mandated by certain tools. In doing so, TensorBoard compiles in seconds, rather
than taking a minute.

The ES6 `import` standard only defines / and ./ prefixed paths. All other paths
that exist are undefined. Since most tooling and early-adopter codebases rely
on the undefined behavior, the standard itself is mostly syntactic sugar (that
isn't even sweet.) The true problem is having a world where Closure, Node, and
web server namespaces coexist.

The ES6 `import` keyword makes JavaScript incompatible with web browsers. The
support added in Chrome 61 is not sufficient, as it only allows the `export`
keyword on functions and not variables. This is a point of view much different
from early-adopters, which raises concerns that the standard is unlikely to
gain a meaningful consensus.

The ES6 `import` keyword makes TypeScript incompatible with web browsers. This
keyword is not supported by the TypeScript compiler. All it can do is punt the
problem to rollup. However we can't use rollup since it doesn't support Closure
namespaces.

The only tool that supports all three of Web, Node, and Closure namespaces is
the Closure Compiler. Without it, ES6 TypeScript or JavaScript can't run in any
web browser.

But since the Closure Compiler was designed to create production builds for
google.com, it isn't very fast. Therefore it's unreasonable that developers on
a small project like TensorBoard should be expected to wait on this tool
whenever making one line changes in a development iteration cycle.

Since the Closure Tools were originally designed to be compatible with web
browsers in the absense of tooling, this change seeks to bring TensorBoard back
into accordance with those principles.
Copy link
Member

@chihuahua chihuahua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this! This will make it easier for developers to prototype and iterate.

I noticed that some TypeScript such as graph logic still uses imports. Is that because we want to make sure that other code that depends on it keeps working?

@chihuahua
Copy link
Member

Oh nvm, those aren't TypeScript imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants