GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: align console.table row to the left by MrJithil · Pull Request #50135 · nodejs/node

Conversation

@MrJithil

@MrJithil MrJithil commented Oct 11, 2023 •
edited by RaisinTen
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes: #50117

Screenshot 2023-10-11 at 7 51 18 pm

MDN: https://developer.mozilla.org/en-US/docs/Web/API/console/table

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss and p3k reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 11, 2023
@Uzlopak

Uzlopak commented Oct 11, 2023

Copy link
Copy Markdown
Contributor

I am fine with this, but I checked the "spec" and it says nothing regarding the output. Its even worse, LOL

See

https://console.spec.whatwg.org/#table

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MrJithil

MrJithil commented Oct 11, 2023

Copy link
Copy Markdown
Member Author

I am fine with this, but I checked the "spec" and it says nothing regarding the output. Its even worse, LOL

See

https://console.spec.whatwg.org/#table

Yeah. The WHATWG, is not suppose mention the standards in very detail. They have the links to MDN.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Uzlopak

Uzlopak commented Oct 11, 2023

Copy link
Copy Markdown
Contributor

Yes and the mdn does not state that the entries are left aligned but just contains a screenshot.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@meyfa

meyfa commented Oct 11, 2023

Copy link
Copy Markdown
Contributor

What was the original reason for centering it in Node.js? Is there a git blame?

Kifzy, p3k, and bburns reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

meyfa
meyfa reviewed Oct 11, 2023
View reviewed changes
Comment thread lib/internal/cli_table.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@MrJithil
MrJithil force-pushed the fix-50117-console-table-alignment branch from 6bbf779 to 2684d81 Compare October 11, 2023 14:38
@marco-ippolito

marco-ippolito commented Oct 22, 2023

Copy link
Copy Markdown
Member

I have the feeling this might break some stuff based on snapshots/benchmarks

wvanderdeijl reacted with thumbs down emoji
All reactions
  • 👎 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

benjamingr
benjamingr approved these changes Oct 22, 2023
View reviewed changes

@benjamingr benjamingr left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM this aligns with browser behavior for a primarily browser-compat-reasons API.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MrJithil
lib: align console.table row to the left
92ad82b
@MrJithil
MrJithil force-pushed the fix-50117-console-table-alignment branch from 2684d81 to 92ad82b Compare October 25, 2023 13:08
@H4ad H4ad added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 25, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 25, 2023
@nodejs-github-bot

nodejs-github-bot commented Oct 25, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55236/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Uzlopak
Uzlopak approved these changes Oct 25, 2023
View reviewed changes

@Uzlopak Uzlopak left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Oct 26, 2023
CI Reliability 2023-10-26 nodejs/reliability#698
Open
CI Reliability 2023-10-27 nodejs/reliability#699
Open
trivikr
trivikr approved these changes Oct 27, 2023
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Oct 27, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/55265/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Oct 28, 2023
CI Reliability 2023-10-28 nodejs/reliability#700
Open
22 tasks
@H4ad H4ad added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 28, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 28, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 14af167 into nodejs:main Oct 28, 2023
@nodejs-github-bot

nodejs-github-bot commented Oct 28, 2023

Copy link
Copy Markdown
Collaborator

Landed in 14af167

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Oct 29, 2023
CI Reliability 2023-10-29 nodejs/reliability#701
Open
CI Reliability 2023-10-30 nodejs/reliability#702
Open
CI Reliability 2023-10-31 nodejs/reliability#703
Open
@pluris pluris mentioned this pull request Nov 4, 2023
doc: update to align console.table row to the left #50553
Merged
@RafaelGSS

RafaelGSS commented Nov 8, 2023

Copy link
Copy Markdown
Member

AFAICT the change is only visual.

Output changes are considered semver-major. Marco tagged it because we've just mentioned it during the collab summit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito

marco-ippolito commented Nov 8, 2023

Copy link
Copy Markdown
Member

It hasn't released yet. Thanks for catching up @marco-ippolito.

Update: Wait, if this is now following the SPEC I wonder if this should be considered semver-major.

There is no SPEC, now it just has the same behavior of browser

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

AFAICT the change is only visual.

Output changes are considered semver-major. Marco tagged it because we've just mentioned it during the collab summit.

I don’t think that’s true, for example changing an error message technically changes the output, yet we don’t consider it semver-major. Also the output of console.table is not observable from JavaScript without watching directly the stdout.

RaisinTen and bburns reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RafaelGSS

RafaelGSS commented Nov 10, 2023

Copy link
Copy Markdown
Member

I don’t think that’s true, for example changing an error message technically changes the output, yet we don’t consider it semver-major

We do consider error message changes as semver-major or at least, we should.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Nov 11, 2023

Copy link
Copy Markdown
Contributor

@RafaelGSS that's not what we say in our documentation:

node/doc/api/errors.md

Lines 285 to 289 in 7c1b1f4

The `error.code` property is a string label that identifies the kind of error.
`error.code` is the most stable way to identify an error. It will only change
between major versions of Node.js. In contrast, `error.message` strings may
change between any versions of Node.js. See [Node.js error codes][] for details
about specific codes.

We also recommend testing only the error code, not the message:

node/doc/contributing/writing-tests.md

Lines 315 to 325 in 260092e

In the case of internal errors, prefer checking only the `code` property:
```js
assert.throws(
() => {
throw new ERR_FS_FILE_TOO_LARGE(`${sizeKiB} Kb`);
},
{ code: 'ERR_FS_FILE_TOO_LARGE' },
// Do not include message: /^File size ([0-9]+ Kb) is greater than 2 GiB$/
);
```

AFAICT, it's always been the case that we have been treating error message update as semver-patch, and recommend users to use the code property to detect errors.

Anyway, to come back to this PR, I really think this is not semver-major, but it's not a hill I'll die on.

meyfa and bburns reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RafaelGSS

RafaelGSS commented Nov 11, 2023

Copy link
Copy Markdown
Member

Oh, I haven't seen or I don't remember these sections, thanks for pointing that out. If we have a doc or a precedence, I won't object to it. @marco-ippolito I will remove the label. In case you strong believe it should be semver-major, ping me.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RafaelGSS RafaelGSS removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Nov 11, 2023
@RafaelGSS

RafaelGSS commented Nov 11, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

FWIW a resource I found in a quick search #3374.

UPDATE: It was discussed when error.code didn't exist at the time (that is what I understood from this discussion: https://github.com/nodejs/node/pull/4664/files#diff-bbed55d3167db7c16baf3ee2c51acb1b09f7740ab1399ab015226c3df488753aR46). So it's not a fair discussion.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Nov 11, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The reason why we have this entire error.code system (and a former strategic initiative involving years of work assigning these codes) was to prevent having to treat error.message changes as server major. Only errors that are known to have their messages captured in the user land (mostly system errors) can still get the semver major treatment but otherwise error message changes are considered semver patch.

mcollina reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito

marco-ippolito commented Nov 11, 2023

Copy link
Copy Markdown
Member

I believe @mcollina mentioned output changes in console were semver major.
I'm not sure the comparison it's fair between error.message and console.table,
console.table is widely used for benchmarks and snapshots, in documentation etc..., the output actually matters.
but I'm not gonna insist if it's something documented

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MrJithil
MrJithil deleted the fix-50117-console-table-alignment branch November 11, 2023 11:20
@MrJithil
MrJithil restored the fix-50117-console-table-alignment branch November 11, 2023 11:20
@MrJithil
MrJithil deleted the fix-50117-console-table-alignment branch November 11, 2023 11:20
@MrJithil
MrJithil restored the fix-50117-console-table-alignment branch November 11, 2023 11:20
@mcollina

mcollina commented Nov 11, 2023

Copy link
Copy Markdown
Member

output changes can breaking. Maybe let's await backporting to LTS for a bit?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos pushed a commit that referenced this pull request Nov 11, 2023
@MrJithil @targos
lib: align console.table row to the left
3615a61
PR-URL: #50135
Fixes: #50117
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
targos pushed a commit that referenced this pull request Nov 11, 2023
Jungku Lee @targos
doc: update to align console.table row to the left
e4a82c2
PR-URL: #50553
Refs: #50135
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
@targos targos mentioned this pull request Nov 12, 2023
v21.2.0 release proposal #50681
Merged
targos pushed a commit that referenced this pull request Nov 14, 2023
Jungku Lee @targos
doc: update to align console.table row to the left
1668798
PR-URL: #50553
Refs: #50135
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
@MrJithil @UlisesGascon
lib: align console.table row to the left
e7551d5
PR-URL: #50135
Fixes: #50117
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
UlisesGascon pushed a commit that referenced this pull request Dec 11, 2023
Jungku Lee @UlisesGascon
doc: update to align console.table row to the left
1b2dab8
PR-URL: #50553
Refs: #50135
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Deokjin Kim <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Dec 12, 2023
v20.11.0 proposal #51124
Merged
@sosukesuzuki sosukesuzuki mentioned this pull request Dec 31, 2023
chore: update pkgjs/action from 0.1.7 to 0.1.9 nodejs/undici#2567
Closed
2 of 5 tasks
@sosukesuzuki sosukesuzuki mentioned this pull request Jan 11, 2024
Fix tests for Node.js v21 nodejs/undici#2609
Merged
7 tasks
@mcollina

mcollina commented Jan 17, 2024

Copy link
Copy Markdown
Member

This should likely not have been backported to v20, it broke our tests.
It also broke Undici tests.

tniessen reacted with thumbs up emoji marco-ippolito reacted with confused emoji
All reactions
  • 👍 1 reaction
  • 😕 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito

marco-ippolito commented Jan 17, 2024

Copy link
Copy Markdown
Member

This should likely not have been backported to v20, it broke our tests.
It also broke Undici tests.

Can we clearly add to the documentation that console output changes should be semver major?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito marco-ippolito mentioned this pull request Jan 17, 2024
doc: document console changes as breaking #51503
Closed
robobun added a commit to oven-sh/bun that referenced this pull request Oct 6, 2026
@robobun
console: left-align Console#table cells to match Node
7d86567
The Console class's renderRow split the leftover width across both sides
of the cell, which centers it. That is Node's behavior up to v20.10 and
v21.1. Node has padded only on the right since v20.11.0 and v21.2.0
(nodejs/node#50135), and Bun reports a newer Node version than that.

Every other part of the output (box frame, column widths, quoting)
already matched, so a byte comparison of Console#table output against
Node differed in the padding alone.
@robobun robobun mentioned this pull request Oct 6, 2026
console: left-align Console#table cells to match Node oven-sh/bun#33453
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@benjamingr benjamingr benjamingr approved these changes
@trivikr trivikr trivikr approved these changes
+2 more reviewers
@meyfa meyfa meyfa left review comments
@Uzlopak Uzlopak Uzlopak approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

console.table text alignment always centered

Uh oh!

There was an error while loading. Please reload this page.

12 participants

@MrJithil @Uzlopak @meyfa @marco-ippolito @nodejs-github-bot @RafaelGSS @aduh95 @joyeecheung @mcollina @benjamingr @trivikr @H4ad
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.