Skip to content

Commit 0ebf631

Browse files
CopilotdgreifCopilot
authored
Upgrade catalyst to v1.8.0 with explicit controller names (#3930)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dgreif <3026298+dgreif@users.noreply.github.com> Co-authored-by: Dusty Greif <dgreif@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e162b98 commit 0ebf631

24 files changed

+217
-65
lines changed

.changeset/tiny-pianos-deny.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
Update Catalyst to version 1.8.0 and hard-code controller/custom-element names via their @controller('...') decorators to allow for better minification

app/components/primer/alpha/action_bar_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enum ItemType {
2727
Divider,
2828
}
2929

30-
@controller
30+
@controller('action-bar')
3131
class ActionBarElement extends HTMLElement {
3232
@targets items: HTMLElement[]
3333
@target itemContainer: HTMLElement

app/components/primer/alpha/action_list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class ActionListTruncationObserver {
3939
}
4040
}
4141

42-
@controller
42+
@controller('action-list')
4343
export class ActionListElement extends HTMLElement {
4444
#truncationObserver: ActionListTruncationObserver
4545

app/components/primer/alpha/action_menu/action_menu_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type SelectedItem = {
1414
const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]']
1515
const menuItemSelectors = validSelectors.map(selector => `:not([hidden]) > ${selector}`)
1616

17-
@controller
17+
@controller('action-menu')
1818
export class ActionMenuElement extends HTMLElement {
1919
@target
2020
includeFragment: IncludeFragmentElement

app/components/primer/alpha/segmented_control.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller, targets} from '@github/catalyst'
22

3-
@controller
3+
@controller('segmented-control')
44
class SegmentedControlElement extends HTMLElement {
55
@targets items: HTMLElement[]
66

app/components/primer/alpha/select_panel_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const updateWhenVisible = (() => {
6464
}
6565
})()
6666

67-
@controller
67+
@controller('select-panel')
6868
export class SelectPanelElement extends HTMLElement {
6969
@target includeFragment: IncludeFragmentElement
7070
@target dialog: HTMLDialogElement

app/components/primer/alpha/toggle_switch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller, target, attr} from '@github/catalyst'
22

3-
@controller
3+
@controller('toggle-switch')
44
class ToggleSwitchElement extends HTMLElement {
55
@target switch: HTMLElement
66
@target loadingSpinner: HTMLElement

app/components/primer/alpha/tree_view/tree_view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {TreeViewSubTreeNodeElement} from './tree_view_sub_tree_node_element'
33
import {useRovingTabIndex} from './tree_view_roving_tab_index'
44
import type {TreeViewNodeType, TreeViewCheckedValue, TreeViewNodeInfo} from '../../shared_events'
55

6-
@controller
6+
@controller('tree-view')
77
export class TreeViewElement extends HTMLElement {
88
@target formInputContainer: HTMLElement
99
@target formInputPrototype: HTMLInputElement

app/components/primer/alpha/tree_view/tree_view_icon_pair_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {controller, target} from '@github/catalyst'
22
import {observeMutationsUntilConditionMet} from '../../utils'
33

4-
@controller
4+
@controller('tree-view-icon-pair')
55
export class TreeViewIconPairElement extends HTMLElement {
66
@target expandedIcon: HTMLElement
77
@target collapsedIcon: HTMLElement

app/components/primer/alpha/tree_view/tree_view_include_fragment_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {controller} from '@github/catalyst'
22
import {IncludeFragmentElement} from '@github/include-fragment-element'
33

4-
@controller
4+
@controller('tree-view-include-fragment')
55
export class TreeViewIncludeFragmentElement extends IncludeFragmentElement {
66
request(): Request {
77
const originalRequest = super.request()

0 commit comments

Comments
 (0)