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

rollup: fail on warnings #4069

Merged
merged 6 commits into from
Aug 21, 2020
Merged

rollup: fail on warnings #4069

merged 6 commits into from
Aug 21, 2020

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Aug 21, 2020

Summary:
We’ve recently eliminated all Rollup warnings. This prevents regression.

Rollup upgrade needed for --failAfterWarnings, added recently:
rollup/rollup#3712

Test Plan:
Modify the onwarn handler in our rollup_config.js to remove any of
the early-returns, and note that bazel build //tensorboard fails.

wchargin-branch: rollup-no-warn

Summary:
By default, TypeScript’s downleveling helpers are inlined into each
source file, creating functions like `__decorate` and `__assign`. The
definition of `__decorate` in particular refers to `this` at top level,
which is `window` in non-strict mode and `undefined` in strict mode;
this causes a Rollup warning (or 80). This has been reported upstream,
but hasn’t yet been addressed:
<microsoft/TypeScript#35802>

By setting `"importHelpers": true` in the compiler config, we instruct
`tsc` to instead import these helpers from `tslib`, avoiding this issue.

Test Plan:
A spot-check of both statically loaded plugins and the projector plugin
doesn’t reveal any issues, and decorators are used for all custom
element registration so we know that the wiring is being exercised.
Rollup no longer issues this flavor of warning, as listed in #4046.

A test sync also indicates no issues, which is expected since these
configs and build rules are only used externally.

wchargin-branch: tsc-importhelpers
wchargin-source: 1ef03e5360b2f59f12824f51490713aa83af81bf
Summary:
Rollup complains about circular dependencies and uses of `eval` in our
third-party dependencies. In most cases, we’re not able to work around
these; sometimes, they’re explicitly wontfix upstream. The warnings
aren’t useful, they create spam, and they prevent other, potentially
useful warnings from appearing.

Test Plan:
Building `//tensorboard` no longer prints any warnings, and the built
content of `tensorboard/webapp/tb_webapp_binary.js` is identical before
and after this change.

wchargin-branch: rollup-suppress-3p-warnings
wchargin-source: cecac3bd3d10e6e215af5cf6b1228b984bc65edd
Summary:
We’ve recently eliminated all Rollup warnings. This prevents regression.

Rollup upgrade needed for `--failAfterWarnings`, added recently:
<rollup/rollup#3712>

Test Plan:
Modify the `onwarn` handler in our `rollup_config.js` to remove any of
the early-`return`s, and note that `bazel build //tensorboard` fails.

wchargin-branch: rollup-no-warn
wchargin-source: 8019e8292a51aa9f74cae2d1acc8b0e5ce47cdb2
Copy link
Collaborator

@bileschi bileschi left a comment

Choose a reason for hiding this comment

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

Thanks!

wchargin-branch: rollup-suppress-3p-warnings
wchargin-source: 9d4e8523e7edbcc7ee6de0e39346856423eebfff
wchargin-branch: rollup-no-warn
wchargin-source: 28766247bdb44901d87caf1b684bc4243ccaf2d3
Base automatically changed from wchargin-rollup-suppress-3p-warnings to master August 21, 2020 21:59
wchargin-branch: rollup-no-warn
wchargin-source: 787f4e681dfe02c12e692201682bbde8cdc40968
@wchargin wchargin merged commit 89fc8d0 into master Aug 21, 2020
@wchargin wchargin deleted the wchargin-rollup-no-warn branch August 21, 2020 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants