Skip to content

Commit 5112115

Browse files
authored
chore!: Remove deprecated functions (posit-dev#1546)
1 parent 2fac61c commit 5112115

File tree

15 files changed

+62
-431
lines changed

15 files changed

+62
-431
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323

2424
* We've deprecated several card-related `shiny.experimental.ui` functions that were moved to the main `shiny.ui` namespace in v0.6.0. Both `card()` and `card_body()` are no longer experimental and can be called via `shiny.ui.card()` and `shiny.ui.card_body()` directly. `shiny.experimental.ui.card_title()` is now deprecated, but can be replaced with `shiny.ui.tags.h5()` or `shiny.ui.card_header()`. (#1543)
2525

26+
* The following deprecated functions have now been removed (#1546):
27+
* `shiny.ui.panel_sidebar()` was deprecated in v0.6.0; use `shiny.ui.sidebar()` instead.
28+
* `shiny.ui.panel_main()` was deprecated in v0.6.0; instead pass items directly to `shiny.ui.layout_sidebar()`.
29+
* `shiny.ui.navset_pill_card()` was deprecated in v0.6.0; use `shiny.ui.navset_card_pill()` instead.
30+
* `shiny.ui.navset_tab_card()` was deprecated in v0.6.0; use `shiny.ui.navset_card_tab()` instead.
31+
* `shiny.ui.nav()` was deprecated in v0.6.1; use `shiny.ui.nav_panel()` instead.
32+
2633
### New features
2734

2835
* Added a new `shiny.ui.Chat` class for building conversational interfaces with fully customizable and performant response generation. (#1453)

docs/_quartodoc-core.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,6 @@ quartodoc:
340340
- title: Deprecated
341341
desc: ""
342342
contents:
343-
- ui.panel_main
344-
- ui.panel_sidebar
345-
- ui.nav
346343
- render.transformer.output_transformer
347344
- render.transformer.resolve_value_fn
348345
- title: Experimental

docs/_renderer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ def prefix_bare_functions_with_func(s: str) -> str:
228228
The See Also section in the Shiny docs has bare function references, ones that lack
229229
a leading :func: and backticks. This function fixes them.
230230
231-
If there are bare function references, like "~shiny.ui.panel_sidebar", this will
231+
If there are bare function references, like "~shiny.ui.sidebar", this will
232232
prepend with :func: and wrap in backticks.
233233
234234
For example, if the input is this:
235-
"~shiny.ui.panel_sidebar :func:`~shiny.ui.panel_sidebar`"
235+
"~shiny.ui.sidebar :func:`~shiny.ui.sidebar`"
236236
This function will return:
237-
":func:`~shiny.ui.panel_sidebar` :func:`~shiny.ui.panel_sidebar`"
237+
":func:`~shiny.ui.sidebar` :func:`~shiny.ui.sidebar`"
238238
"""
239239

240240
def replacement(match: re.Match[str]) -> str:

examples/cpuinfo/app.py

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
ui.busy_indicators.use(spinners=False, pulse=False),
5757
ui.h3("CPU Usage %", class_="mt-2"),
5858
ui.layout_sidebar(
59-
ui.panel_sidebar(
59+
ui.sidebar(
6060
ui.input_select(
6161
"cmap",
6262
"Colormap",
@@ -71,33 +71,31 @@
7171
ui.input_switch("hold", "Freeze output", value=False),
7272
class_="mb-3",
7373
),
74-
ui.panel_main(
74+
ui.div(
75+
{"class": "card mb-3"},
7576
ui.div(
76-
{"class": "card mb-3"},
77-
ui.div(
78-
{"class": "card-body"},
79-
ui.h5({"class": "card-title mt-0"}, "Graphs"),
80-
ui.output_plot("plot", height=f"{ncpu * 40}px"),
81-
),
82-
ui.div(
83-
{"class": "card-footer"},
84-
ui.input_numeric("sample_count", "Number of samples per graph", 50),
85-
),
77+
{"class": "card-body"},
78+
ui.h5({"class": "card-title mt-0"}, "Graphs"),
79+
ui.output_plot("plot", height=f"{ncpu * 40}px"),
8680
),
8781
ui.div(
88-
{"class": "card"},
89-
ui.div(
90-
{"class": "card-body"},
91-
ui.h5({"class": "card-title m-0"}, "Heatmap"),
92-
),
93-
ui.div(
94-
{"class": "card-body overflow-auto pt-0"},
95-
ui.output_table("table"),
96-
),
97-
ui.div(
98-
{"class": "card-footer"},
99-
ui.input_numeric("table_rows", "Rows to display", 5),
100-
),
82+
{"class": "card-footer"},
83+
ui.input_numeric("sample_count", "Number of samples per graph", 50),
84+
),
85+
),
86+
ui.div(
87+
{"class": "card"},
88+
ui.div(
89+
{"class": "card-body"},
90+
ui.h5({"class": "card-title m-0"}, "Heatmap"),
91+
),
92+
ui.div(
93+
{"class": "card-body overflow-auto pt-0"},
94+
ui.output_table("table"),
95+
),
96+
ui.div(
97+
{"class": "card-footer"},
98+
ui.input_numeric("table_rows", "Rows to display", 5),
10199
),
102100
),
103101
),

shiny/api-examples/page_fixed/app-core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55

66
app_ui = ui.page_fixed(
77
ui.layout_sidebar(
8-
ui.panel_sidebar(
8+
ui.sidebar(
99
ui.input_slider("n", "N", min=0, max=100, value=20),
1010
),
11-
ui.panel_main(
12-
ui.output_plot("plot"),
13-
),
11+
ui.output_plot("plot"),
1412
),
1513
)
1614

shiny/api-examples/todo_list/app-core.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
shinyswatch.theme.minty(),
99
ui.panel_title("Shiny TodoMVC"),
1010
ui.layout_sidebar(
11-
ui.panel_sidebar(
11+
ui.sidebar(
1212
ui.input_text("todo_input_text", "", placeholder="Todo text"),
1313
ui.input_action_button("add", "Add to-do"),
1414
),
15-
ui.panel_main(
16-
ui.output_text("cleared_tasks"),
17-
ui.div(id="tasks", style="margin-top: 0.5em"),
18-
),
15+
ui.output_text("cleared_tasks"),
16+
ui.div(id="tasks", style="margin-top: 0.5em"),
1917
),
2018
)
2119

shiny/express/ui/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,6 @@
303303
"shiny.ui": (
304304
"column", # Deprecated in favor of layout_columns
305305
"row", # Deprecated in favor of layout_columns
306-
"nav", # Deprecated in favor of nav_panel
307-
"navset_pill_card", # Deprecated
308-
"navset_tab_card", # Deprecated
309306
"page_bootstrap",
310307
"page_fixed",
311308
"page_sidebar",
@@ -314,8 +311,6 @@
314311
"page_fluid",
315312
"page_auto",
316313
"page_output",
317-
"panel_main", # Deprecated
318-
"panel_sidebar", # Deprecated
319314
"showcase_bottom",
320315
"showcase_left_center",
321316
"showcase_top_right",

shiny/ui/__init__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@
111111
from ._markdown import markdown
112112
from ._modal import modal, modal_button, modal_remove, modal_show
113113
from ._navs import (
114-
nav,
115114
nav_control,
116115
nav_menu,
117116
nav_panel,
@@ -122,11 +121,8 @@
122121
navset_card_underline,
123122
navset_hidden,
124123
navset_pill,
125-
# Deprecated
126-
navset_pill_card,
127124
navset_pill_list,
128125
navset_tab,
129-
navset_tab_card,
130126
navset_underline,
131127
)
132128
from ._notification import notification_remove, notification_show
@@ -155,8 +151,6 @@
155151
from ._sidebar import (
156152
Sidebar,
157153
layout_sidebar,
158-
panel_main,
159-
panel_sidebar,
160154
sidebar,
161155
update_sidebar,
162156
)
@@ -189,8 +183,6 @@
189183
"sidebar",
190184
"layout_sidebar",
191185
"update_sidebar",
192-
"panel_sidebar",
193-
"panel_main",
194186
# _layout
195187
"layout_columns",
196188
"layout_column_wrap",
@@ -299,10 +291,6 @@
299291
"navset_pill_list",
300292
"navset_hidden",
301293
"navset_bar",
302-
# # Deprecated
303-
"navset_pill_card",
304-
"navset_tab_card",
305-
"nav",
306294
# _notification
307295
"notification_show",
308296
"notification_remove",

shiny/ui/_bootstrap.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ def panel_well(*args: TagChild | TagAttrs, **kwargs: TagAttrValue) -> Tag:
128128
-------
129129
:
130130
A UI element.
131-
132-
See Also
133-
--------
134-
* :func:`~shiny.ui.panel_sidebar`
135-
* :func:`~shiny.ui.panel_main`
136131
"""
137132
return div({"class": "well"}, *args, **kwargs)
138133

shiny/ui/_navs.py

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
"navset_pill_list",
1515
"navset_hidden",
1616
"navset_bar",
17-
# Deprecated - 2023-08-15
18-
"navset_pill_card",
19-
"navset_tab_card",
20-
"nav",
2117
)
2218

2319
import collections.abc
@@ -27,7 +23,6 @@
2723

2824
from htmltools import MetadataNode, Tag, TagAttrs, TagChild, TagList, css, div, tags
2925

30-
from .._deprecated import warn_deprecated
3126
from .._docstring import add_example, no_example
3227
from .._namespaces import resolve_id_or_none
3328
from .._utils import private_random_int
@@ -1367,76 +1362,3 @@ def navset_title(
13671362

13681363
def nav_random_int() -> str:
13691364
return private_random_int(1000, 1000000)
1370-
1371-
1372-
##############################################
1373-
# Deprecated
1374-
##############################################
1375-
# Deprecated 2023-08-15
1376-
def navset_pill_card(
1377-
*args: NavSetArg,
1378-
id: Optional[str] = None,
1379-
selected: Optional[str] = None,
1380-
header: TagChild = None,
1381-
footer: TagChild = None,
1382-
placement: Literal["above", "below"] = "above",
1383-
) -> NavSetCard:
1384-
"""Deprecated. Please use `navset_card_pill()` instead of `navset_pill_card()`."""
1385-
warn_deprecated(
1386-
"`navset_pill_card()` is deprecated. "
1387-
"This method will be removed in a future version, "
1388-
"please use :func:`~shiny.ui.navset_card_pill` instead."
1389-
)
1390-
return navset_card_pill(
1391-
*args,
1392-
id=id,
1393-
selected=selected,
1394-
header=header,
1395-
footer=footer,
1396-
placement=placement,
1397-
)
1398-
1399-
1400-
# Deprecated 2023-08-15
1401-
def navset_tab_card(
1402-
*args: NavSetArg,
1403-
id: Optional[str] = None,
1404-
selected: Optional[str] = None,
1405-
header: TagChild = None,
1406-
footer: TagChild = None,
1407-
) -> NavSetCard:
1408-
"""Deprecated. Please use `navset_card_tab()` instead of `navset_tab_card()`."""
1409-
warn_deprecated(
1410-
"`navset_tab_card()` is deprecated. "
1411-
"This method will be removed in a future version, "
1412-
"please use :func:`~shiny.ui.navset_card_tab` instead."
1413-
)
1414-
return navset_card_tab(
1415-
*args,
1416-
id=id,
1417-
selected=selected,
1418-
header=header,
1419-
footer=footer,
1420-
)
1421-
1422-
1423-
# Deprecated 2023-12-07
1424-
@no_example()
1425-
def nav(
1426-
title: TagChild,
1427-
*args: TagChild,
1428-
value: Optional[str] = None,
1429-
icon: TagChild = None,
1430-
) -> NavPanel:
1431-
"""Deprecated. Please use `nav_panel()` instead of `nav()`."""
1432-
warn_deprecated(
1433-
"`nav()` is deprecated. "
1434-
"This method will be removed in a future version, "
1435-
"please use :func:`~shiny.ui.nav_panel` instead."
1436-
)
1437-
return nav_panel(
1438-
title,
1439-
*args,
1440-
value=value,
1441-
icon=icon,
1442-
)

0 commit comments

Comments
 (0)