chore: rewrite v2 component history to preserve git blame#2551
chore: rewrite v2 component history to preserve git blame#2551balzss wants to merge 184 commits into
Conversation
… not include functional components
For now it only parses V1 components. It also does not parse components that use the new structure and there are several CSS errors
…ort (now withStyleLegacy)
…> v11_6, v11_6->v11_7)
INSTUI-4789 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
INSTUI-4783
INSTUI-4815
…ustom/brand icon components and migration codemod
…hey are all deprecated
…y restoring focus to hidden input
The content wrapper changed from display:block to display:flex in the v2 button rewrite, which made textAlign:center ineffective on the shrunk children span. Add justifyContent based on textAlign so text is centered regardless of whether an icon is present. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
core-js was fixing really niche bugs in the code ze.g. map.getOrInsertComputed, map.getOrInsert and an exotic Safari bug https://bugs.webkit.org/show_bug.cgi?id=309342 that is fixed in Webkit nightly. Remove core-js because its no longer needed
Also use ESLint from the root package
|
Visual regression report✅ No changes.
Baselines come from the |
…DateInput v1 with DateInput v2 in DateTimeInput BREAKING CHANGE: renderWeekdayLabels` prop removed `calendarIcon` is a new required prop INSTUI-4791
…eader, descriptive nav button labels with target month, aria-modal on focused dialogs
BREAKING CHANGE: Removed FormFieldLabel component Removed _content prop from DrawerLayout.Tray and DrawerLayout.Content Removed _link prop from Link Removed _node prop from Menu.Item Removed _root prop from Pagination, TreeBrowser Removed _select prop from SimpleSelect and TimeSelect Removed _ref prop from TruncateText Removed _element prop from View Removed color="ai" from Heading Removed variant="inline-small" and variant="standalone-small" from Link Removed title prop from Tag Removed focusRingBorderRadius prop from View Removed hideActionsUserSeparator prop from TopNavBar.Layout Removed handleFocusOutlineColor, handleFocusOutlineWidth, handleShadowColor from RangeInput INSTUI-5025
There was a problem hiding this comment.
one split commit appears to have been missed — feat(many): rework TopNavBar (c1d18a6).
This commit introduced 33 new v2/* files (near-identical copies of their v1/* counterparts — the main index.tsx differs by only 2 lines) without a preceding synthetic rename, so all TopNavBar v2 files currently show only 1–2 unique blame commits.
This is likely not an oversight but an edge case in the detection heuristic.
In all 18 handled split commits (rework Img, rework Byline, etc.), both v1/* and v2/* files were added (A) in the same commit — they were created together from scratch. In the TopNavBar rework, v1/* files already existed and were only modified (M), while v2/* files were added (A). A heuristic looking for A+A pairs in the same commit would have missed this M+A case.
TopNavBar seems to be the only rework where the v1/ directory pre-existed; all others had v1/ and v2/ created together in the large add multi-version support commit.
|
@ToMESSKa @git-nandor — fixed in the latest force-push (
@git-nandor your hypothesis was exactly right: TopNavBar was the only rework where v1 already existed at the parent. All 33 v2 paths had v1 counterparts (clean 1:1 mapping, no missing-v1 edge cases). Verification after fix:
Heads-up: this was a force-push, so every commit SHA below the merge-base is new. Re-requesting review. |
|
@ToMESSKa good catch — you were right that the previous fix didn't go deep enough. Pushed a deeper fix ( Root cause for the chain stopping at Topi's commit:
Fix: insert a synthetic before Blame coverage on
Reaches back to 2022-07-25 — the original Verification:
Force-pushed; SHAs below |
Summary
Rewrites
master's history so thatgit blameonv2/*component files traces back through theirv1/*predecessors (and through them, to the pre-multi-version originals). Today, 211 of 479 v2 files have squashed blame because the commits that introduced them usedgit addrather thangit mv.The working tree at the tip of this branch is byte-identical to
master— only the commit history leading up to it differs. Verified by tree-hash comparison:1f10331faa2931ac26fc7f24dfec8cbe67bb6489on both sides.What changed
For each of 19 "split" commits that introduced v2 files (full list below), a synthetic predecessor commit was inserted that does a pure
git mv v1/X → v2/X. The original commit's tree is unchanged. The synthetic-rename gives git's rename detection something to lock onto when running blame on v2 files; the next commit recreates v1, so v1 files lose their post-split blame but their full prior history is intact up to that point.This is the technique from the original #2486 PR, re-applied to current master (since master has moved 160 commits and added new v2 components since #2486 was opened in March).
Split commits rewritten
f691f0b96e8e0f9ef7e6fd7780fc7bc1d18a6aa14f49e3e27dfb955195830562fe2b43fba6b4d6a7af97f0c0bca99d7fe70b36c02c6b3e335cc5b00ba201f698845e7a35564010f637b938066524ff00ff5f2b38665a9405c0a130035d3544641 v1→v2 file pairs processed across the 19 commits.
Edge case: TopNavBar rework (added after initial review)
The first revision of this branch missed
c1d18a6aa1because it has anA+Mfile shape (v1 modified, v2 added) rather than theA+Ashape (v1 and v2 both added in the same commit) that all other handled splits share. TopNavBar is the only rework where v1 pre-existed at the parent. The synthetic-mv technique applies identically once the commit is identified — credit to @git-nandor for the root-cause analysis.Verification
git diff rewrite-v2-blame origin/master1f10331faa…on both sidespnpm run test:vitestgit mvs)Sample improvements (before → after unique blame commits)
ui-buttons/Button/v2/index.tsxui-alerts/Alert/v2/index.tsxui-modal/Modal/v2/index.tsxui-img/Img/v2/index.tsxui-pagination/Pagination/v2/index.tsxui-select/Select/v2/index.tsxui-checkbox/Checkbox/v2/index.tsxui-top-nav-bar/TopNavBar/v2/index.tsxdb85e249d0(2022-07-25, originalui-top-nav-barpackage skeleton,TopNavBar/index.tsxpath); fixed via a second synthetic beforea7704b6b3ato bridge the v2 delete-then-readd cycleEarliest blame reached on
Button/v2/index.tsx:ed73df19f78(serikjensen, Dec 2019,packages/ui-buttons/Button/index.js).Tradeoffs
15f3c41cc7(merge-base) onward change. Tagsv11.7.0–v11.7.3continue to point at their original (now orphaned) SHAs unless re-tagged. npm artifacts are unaffected.git fetch && git rebase origin/masterafter the force-push.Replaces #2486
The two non-history pieces of #2486 — test migration and the
create-component-versionscript — have already landed independently on master. #2486 will be closed in favor of this PR once review begins.Deployment
After review/approval:
master.rewrite-v2-blametomasterwithgit push --force-with-lease origin rewrite-v2-blame:master.git fetch && git reset --hard origin/masteron localmaster, then rebase any in-progress branches.v11.7.0–v11.7.3against rewritten SHAs if you want tags to live in the new history.Test plan
git diff rewrite-v2-blame origin/masterproduces no outputgit rev-parse rewrite-v2-blame^{tree}matchesgit rev-parse origin/master^{tree}pnpm run bootstrap && pnpm run test:vitestpassesgit blame packages/ui-buttons/src/Button/v2/index.tsxshows ≥20 unique commits and traces back to 2019ui-buttons/Button/index.jsgit blame packages/ui-modal/src/Modal/v2/index.tsxshows ≥20 unique commits and traces back to the originalModal/index.jsgit blame --show-name packages/ui-top-nav-bar/src/TopNavBar/v2/index.tsxshows lines attributed toTopNavBar/v1/index.tsx🤖 Generated with Claude Code