Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(bundler): Pass Webpack output to logger in a single record #1414

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

Merged
merged 4 commits into from
May 21, 2024

Conversation

ikonst
Copy link
Contributor

@ikonst ikonst commented May 7, 2024

What was changed

  • Don't include color control characters when logging bundler output.
  • Log bundler multi-line output as a single log record.

Why?

Since we take this output and give it to a logging mechanism:

  • Color should be omitted since the log message might not be written to a color-enabled console or encapsulated in JSON thus turning the control characters into a nuisance for reading.
  • Multi-line message should be logged as a single record to maintain context.

Checklist

  1. Closes: n/a

  2. How was this tested: Locally.

  3. Any docs updates needed? None.

@ikonst ikonst requested a review from a team as a code owner May 7, 2024 20:08
@CLAassistant
Copy link

CLAassistant commented May 7, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mjameswh
Copy link
Contributor

Hello @ikonst!

First of all, sorry for the delay, and thanks for your contribution.

I'm definitely down for emitting Webpack's logs as a single message, rather than split into multiple lines.

We have been a bit hesitant regarding disabling Webpack colors because:

  • We feel that it's preferable to bundle workflow ahead of time for production environment;
  • Cutting down colors completely would be a regression for developers that are working in non-CI environment;
  • We are looking into completely revisit Webpack logging in the near future.

Still, I think we could find a reasonable compromise by only enabling colors if the logger is connected to stderr AND stderr supports colors.

I pushed a quick attempt at that. Would it be possible for you to please confirm that this resolves the pain point from your side?

@ikonst
Copy link
Contributor Author

ikonst commented May 17, 2024

Yep, certainly

@mjameswh mjameswh changed the title bundler: pass webpack output to logger in a single record fix(bundler): Pass Webpack output to logger in a single record May 21, 2024
@mjameswh mjameswh merged commit e3c1574 into temporalio:main May 21, 2024
70 checks passed
@ikonst ikonst deleted the patch-1 branch May 21, 2024 18:51
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.

3 participants