Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/friendly-geese-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Temporarily removed console warnings for deprecated typography components
13 changes: 7 additions & 6 deletions polaris-react/src/components/Caption/Caption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ export interface CaptionProps {
* https://polaris.shopify.com/components/text
*/
export function Caption({children}: CaptionProps) {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.warn(
'Deprecation: The `Caption` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
);
}
// TODO: Re-add console warnings after migrations are complete
// if (process.env.NODE_ENV === 'development') {
// // eslint-disable-next-line no-console
// console.warn(
// 'Deprecation: The `Caption` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
// );
// }

return <p className={styles.Caption}>{children}</p>;
}
13 changes: 7 additions & 6 deletions polaris-react/src/components/DisplayText/DisplayText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ export function DisplayText({
size && styles[variationName('size', size)],
);

if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.warn(
'Deprecation: The `DisplayText` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
);
}
// TODO: Re-add console warnings after migrations are complete
// if (process.env.NODE_ENV === 'development') {
// // eslint-disable-next-line no-console
// console.warn(
// 'Deprecation: The `DisplayText` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
// );
// }

return <Element className={className}>{children}</Element>;
}
13 changes: 7 additions & 6 deletions polaris-react/src/components/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ export interface HeadingProps {
* https://polaris.shopify.com/components/text
*/
export function Heading({element: Element = 'h2', children, id}: HeadingProps) {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.warn(
'Deprecation: The `Heading` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
);
}
// TODO: Re-add console warnings after migrations are complete
// if (process.env.NODE_ENV === 'development') {
// // eslint-disable-next-line no-console
// console.warn(
// 'Deprecation: The `Heading` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
// );
// }

return (
<Element className={styles.Heading} id={id}>
Expand Down
13 changes: 7 additions & 6 deletions polaris-react/src/components/Subheading/Subheading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ export function Subheading({
}: SubheadingProps) {
const ariaLabel = typeof children === 'string' ? children : undefined;

if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.warn(
'Deprecation: The `Subheading` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
);
}
// TODO: Re-add console warnings after migrations are complete
// if (process.env.NODE_ENV === 'development') {
// // eslint-disable-next-line no-console
// console.warn(
// 'Deprecation: The `Subheading` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
// );
// }

return (
<Element aria-label={ariaLabel} className={styles.Subheading}>
Expand Down
13 changes: 7 additions & 6 deletions polaris-react/src/components/TextStyle/TextStyle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ export function TextStyle({variation, children}: TextStyleProps) {
variation === VariationValue.Code && styles.code,
);

if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.warn(
'Deprecation: The `TextStyle` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
);
}
// TODO: Re-add console warnings after migrations are complete
// if (process.env.NODE_ENV === 'development') {
// // eslint-disable-next-line no-console
// console.warn(
// 'Deprecation: The `TextStyle` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
// );
// }

const Element = variationElement(variation);

Expand Down
13 changes: 7 additions & 6 deletions polaris-react/src/components/VisuallyHidden/VisuallyHidden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ export interface VisuallyHiddenProps {
* https://polaris.shopify.com/components/text
*/
export function VisuallyHidden({children}: VisuallyHiddenProps) {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-console
console.warn(
'Deprecation: The VisuallyHidden` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
);
}
// TODO: Re-add console warnings after migrations are complete
// if (process.env.NODE_ENV === 'development') {
// // eslint-disable-next-line no-console
// console.warn(
// 'Deprecation: The VisuallyHidden` component has been deprecated. Use the `Text` component instead. See the Polaris component guide on how to use `Text`. https://polaris.shopify.com/components/text',
// );
// }

return <span className={styles.VisuallyHidden}>{children}</span>;
}