Skip to content

fix(benchmark): fit a last array of exactly 80 columns on one line - #1018

Merged
owjs3901 merged 1 commit into
mainfrom
fix/benchmark-json-last-array
Nov 18, 2026
Merged

owjs3901 merged 1 commit into
mainfrom
fix/benchmark-json-last-array

Conversation

@owjs3901

Copy link
Copy Markdown
Contributor

Summary

bun run lint fails on main again, because Prettier rejects benchmark/history.json:

-        "devup-ui-large-turbo-wasm": [
-          6.5, 6.483, 6.542, 38662174, 1512, 571629
-        ]
+        "devup-ui-large-turbo-wasm": [6.5, 6.483, 6.542, 38662174, 1512, 571629]
  • Cause: formatJson (fix(benchmark): keep the landing build and lint passing after a benchmark refresh #1005) checked line.length + 1 <= 80 for every array, counting a trailing comma. The last array of an object has no comma. Prettier fits that row at exactly 80 columns, but formatJson split it. main's latest refresh recorded such a row.
  • Fix: the comma is counted only when one follows the array. history.json is rewritten with the fixed formatter.
  • Test: a new case checks that a last array of exactly 80 columns stays on one line, and that the same array followed by a comma is split.

Every open PR that merges main currently fails publish at lint for this reason (e.g. #1014, #1015).

Verification

  • prettier --check passes on benchmark/history.json, benchmark-results.json and the changed files.
  • benchmark-record.test.ts: 28 pass, and benchmark-record.js has 100% coverage.

요약

main에서 bun run lint가 다시 실패합니다. Prettier가 benchmark/history.json을 거부하기 때문입니다.

  • 원인: #1005의 formatJson은 모든 배열에 대해 line.length + 1 <= 80으로 길이를 검사합니다. 뒤에 쉼표가 붙는다고 가정해서 1을 더하는 것입니다. 하지만 객체의 마지막 배열 뒤에는 쉼표가 없습니다. Prettier는 이런 배열이 정확히 80자이면 한 줄에 쓰는데, formatJson은 여러 줄로 나눴습니다. main의 최근 벤치마크 갱신이 바로 이런 행을 기록했습니다.
  • 수정: 배열 뒤에 실제로 쉼표가 올 때만 그 1자를 셉니다. 고친 포매터로 history.json을 다시 썼습니다.
  • 테스트: 마지막 배열이 정확히 80자이면 한 줄에 남고, 같은 배열 뒤에 쉼표가 오면 여러 줄로 나뉘는지 확인하는 케이스를 추가했습니다.

지금 main을 합친 PR은 모두 이 문제 때문에 lint 단계에서 publish가 실패합니다(예: #1014, #1015).

검증

  • benchmark/history.json, benchmark-results.json, 그리고 수정한 파일 모두 prettier --check를 통과합니다.
  • benchmark-record.test.ts는 28개가 통과하고, benchmark-record.js 커버리지는 100%입니다.

🤖 Generated with Claude Code

formatJson counted a trailing comma after every array, so an array that
ends its object and fills exactly 80 columns was split over lines while
Prettier keeps it on one. main's refresh wrote such a row
(devup-ui-large-turbo-wasm), and `bun run lint` rejects history.json again.
The comma now counts only when one follows, and history.json is rewritten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901 added a commit that referenced this pull request Nov 18, 2026
#1018 fixes the formatter that wrote it; main's history.json comes back with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
benchmark-record.js 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

owjs3901 added a commit that referenced this pull request Nov 18, 2026
main's benchmark record wrapped an 80-column array that prettier keeps on
one line, so lint failed on every PR. Same hunk as #1018, which also fixes
the writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901 added a commit that referenced this pull request Nov 18, 2026
…prettier"

The writer test pins the old layout; #1018 fixes the writer and the file
together, so merge that branch instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901 added a commit that referenced this pull request Nov 18, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@owjs3901
owjs3901 merged commit 7856030 into main Nov 18, 2026
28 checks passed
@owjs3901
owjs3901 deleted the fix/benchmark-json-last-array branch November 18, 2026 23:39
owjs3901 added a commit that referenced this pull request Nov 19, 2026
* fix(benchmark): fit a last array of exactly 80 columns on one line

formatJson counted a trailing comma after every array, so an array that
ends its object and fills exactly 80 columns was split over lines while
Prettier keeps it on one. main's refresh wrote such a row
(devup-ui-large-turbo-wasm), and `bun run lint` rejects history.json again.
The comma now counts only when one follows, and history.json is rewritten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update dependencies

dcu across all manifests (apps/react-18 stays on React 18; peer ranges
stay as they were), cargo update, Oxc 0.159. oxc_sourcemap moves to 10
since oxc_codegen 0.159 now uses it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(benchmark): fit the last history array on one line for prettier

main's benchmark record wrapped an 80-column array that prettier keeps on
one line, so lint failed on every PR. Same hunk as #1018, which also fixes
the writer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "chore(benchmark): fit the last history array on one line for prettier"

The writer test pins the old layout; #1018 fixes the writer and the file
together, so merge that branch instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901 added a commit that referenced this pull request Nov 19, 2026
…roduction builds (#1027)

* test(extractor): pin that component-selector markers go only where a selector can read them

A styled component a file keeps to itself and no selector in that file
names can never be selected, so it renders without a marker, also when it
is only extended or given withComponent there. Selected and exported
components keep theirs: a module importing an export may select it, and
per-file compilation cannot yet show that none does. The limitations page
says so.

Refs #690

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(extractor): read expected markers from the file number the run gives test.tsx

Another test may number a file between the reset and the extraction, so
the expected classes come from component_marker instead of fixed names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(extractor): pass the fallback flag to globalKeyframes' style serialization

#1004 and #1007 merged together left globalKeyframes calling style_to_json
without the fallbacks argument #1007 added, so main did not compile.
It now reads the flag from the collector, as keyframes() does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(extractor): list the component-selector markers each file gives and selects by

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(binding): report component-selector markers from transforms and the reservation scan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(benchmark): fit a last array of exactly 80 columns on one line

formatJson counted a trailing comma after every array, so an array that
ends its object and fills exactly 80 columns was split over lines while
Prettier keeps it on one. main's refresh wrote such a row
(devup-ui-large-turbo-wasm), and `bun run lint` rejects history.json again.
The comma now counts only when one follows, and history.json is rewritten.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(webpack-plugin): drop component markers no module selects in one-shot production builds

The loader reports what each module gives and selects to the build's ledger.
After the transforms, a production build that is not watching compares them
with the start-of-build scan: if every selecting module was scanned, markers
no module selects (and no untransformed module wrote) leave the script
assets; otherwise every marker stays and a warning names each module the scan
missed and why. The scan also follows require.context and import.meta.glob
calls whose arguments are written out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(vite-plugin): drop component markers no module selects in one-shot production builds

Each transform reports what its module gives and selects; buildStart takes
what the start-of-build scan selects. renderChunk of a production build that
is not watching drops the markers no module selects or wrote, with a source
map, or keeps every marker and warns once which modules the scan missed and
why. Documents the behaviour and the cases that still keep markers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(binding): read the marker getters in the public engine scenarios

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(extractor): serialize every case of the component-selector marker tests

rstest copies only the attributes written after the cases onto each case,
so #[serial] above them left the cases running alongside each other and
the other tests that reset the shared file and class maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: keep the marker rows within the migration tables' width

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(benchmark): print an array as wide as Prettier does when no comma follows it

formatJson counted a trailing comma after every array, so the last array of
an object, exactly 80 characters wide, was split over lines that Prettier
joins, and `bun run lint` failed on the recorded history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(webpack-plugin): read marker reports of modules webpack restores from its cache

A warm build restores modules from webpack's persistent cache without running
the loader, so their reports never reached the ledger and the build kept the
markers a cold build dropped. The loader now keeps each report in the
module's buildInfo, which the cache restores, and the plugin reads them back
before it plans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: say Next.js webpack builds drop unselected markers too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* revert: leave the formatJson fix to #1018

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
owjs3901 added a commit that referenced this pull request Nov 19, 2026
…-components v6 the element (#1014)

* fix(extractor): apply shouldForwardProp to every prop and pass styled-components v6 the element

A styled component's shouldForwardProp only filtered the props its styles
read or the predicate named, so with `() => false` a spread `id` or
`customPayload` still reached the element. styled-components v6 and Emotion
call the predicate for every prop. The predicate the build evaluates is now
compiled into the component's runtime prop filter; a predicate calling
isPropValid makes the module import @emotion/is-prop-valid under a
generated name, which also works where an extension in another module
renders the component.

Under styled-components the second argument is the element the component
renders (`as` included), as in v6: `typeof element === 'string'` tests it,
and calling it as v5's validator is a build error, since it throws in v6.
Emotion's predicate and Devup UI's own styled keep their signatures.

Composed predicates drop repeated or always-true parts, so an extension no
longer filters `theme` twice.

Tests compare against what styled-components 6.6.0 and @emotion/styled 11
render under React 19. Docs (EN/KO) and the build errors reference updated.

Refs #690

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore(benchmark): format history.json as prettier writes it

The benchmark bot's record on main wrapped one array, which fails lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "chore(benchmark): format history.json as prettier writes it"

#1018 fixes the formatter that wrote it; main's history.json comes back with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(extractor): evaluate shouldForwardProp at build time only

Remove the compiled runtime prop filter and the injected @emotion/is-prop-valid
import. The build keeps deciding the props it can name, keeps the v5 validator
build error and the merged conditions, and the docs list props the build cannot
name as a known difference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant