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_bundle: stop --silent rollup to let it report all build errors #459

Closed
wants to merge 5 commits into from

Conversation

ashi009
Copy link
Contributor

@ashi009 ashi009 commented Dec 6, 2018

This CL removes --silent flag when running rollup to let it report all the warnings and errors (due to rollup/rollup#2582) during the build. The warning message now contains location info when available.

As a result of this change, some config errors are found and fixed as well:

  • set banner with config.output.banner instead of config.banner as the latter is deprecated in rollup/rollup@ffe4e5b.
  • removed config.experimentalDynamicImport as rollup/rollup@4d4ec4c made it default and removed it.
  • stop exporting resolveBazel in config to avoid triggering unknown config error, and let the test to find it in plug-in list by name.

Updates #447

Copy link
Collaborator

@mgechev mgechev left a comment

Choose a reason for hiding this comment

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

LGTM. @alexeagle any final comments before we merge? // cc @gregmagolan

#
# TODO(https://github.com/rollup/rollup/issues/2582): Uncomment the following
# line once rollup stops reporting build errors with onwarn.
# args.add("--silent")
Copy link
Collaborator

Choose a reason for hiding this comment

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

my concern is what does an execution of bazel look like now? Does rollup print a bunch of stuff to the terminal? as said in the original comment, a well-behaved bazel rule prints nothing on success. Can we somehow throw away the stdout from rollup if the compilation is successful?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally understand. However, in this case I'd prioritize the correctness over the noise made by rollup. OTOH, this is actually inevitable in the nodejs world, even if the rollup is silenced, some poorly written plugin may console.log something from nowhere . So I think we can replace this comment with a more descriptive message pointing to a bug in rules_nodejs saying we should fix the log spam in the future. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively, we can write a wrapper tool to filter the messages -- but does it worth the effort? As rollup is almost certainly the last step in a release cycle. So it won't be run that frequently and the spam it made should not be that bad.

Copy link
Collaborator

@alexeagle alexeagle left a comment

Choose a reason for hiding this comment

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

I don't want to start spamming the console with rollup success messages

@ashi009
Copy link
Contributor Author

ashi009 commented Dec 21, 2018

PTAL @alexeagle

@filipesilva
Copy link
Collaborator

Now we can use --silent together with a custom onwarn handler, and still get the errors/warnings: rollup/rollup#2981

@alexeagle
Copy link
Collaborator

Not planning to add features to old rollup-bundle rule, will be deleted by 1.0

you were right though, --silent was causing other problems...

@alexeagle alexeagle closed this Sep 20, 2019
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

4 participants