From 9874081597e2ad4a8564c6128317a0a9c728dbb7 Mon Sep 17 00:00:00 2001 From: aveline Date: Mon, 31 Jan 2022 15:46:53 -0800 Subject: [PATCH 1/6] Remove public scss api --- scripts/build-validate.js | 1 - src/styles/_public-api.scss | 32 -------------------------------- 2 files changed, 33 deletions(-) delete mode 100644 src/styles/_public-api.scss diff --git a/scripts/build-validate.js b/scripts/build-validate.js index e45d19f3d2c..1bea7c3a05a 100644 --- a/scripts/build-validate.js +++ b/scripts/build-validate.js @@ -70,7 +70,6 @@ function validateEsNextBuild() { } function validateSassPublicApi() { - assert.ok(fs.existsSync('./build/styles/_public-api.scss')); assert.ok(fs.existsSync('./build/styles/foundation/_layout.scss')); // does not contain any :global definitions const files = glob.sync(`./build/styles/**/*.scss`); diff --git a/src/styles/_public-api.scss b/src/styles/_public-api.scss deleted file mode 100644 index de09f266ce3..00000000000 --- a/src/styles/_public-api.scss +++ /dev/null @@ -1,32 +0,0 @@ -// This file is Polaris's public Sass API. -// Consuming applications may import this file if they wish to use our helper functions -// -// Import from a scss file: -// `@import '~@shopify/polaris/dist/styles/public-api';` -// -// Or if you are using sewing-kit, you can tell it to automatically add that -// import to every scss file by configuring the `autoInclude` option in -// sewing-kit's sass plugin (assuming your sewing-kit.config.js is at the root -// of your repo): -// plugins.sass({ -// autoInclude: [ -// path.join(__dirname, 'node_modules/@shopify/polaris/dist/styles/_public-api.scss'), -// ], -// }), - -// stylelint-disable scss/partial-no-import - -@import './foundation/layout'; -@import './foundation/focus-ring'; - -@import './shared/accessibility'; -@import './shared/breakpoints'; -@import './shared/buttons'; -@import './shared/controls'; -@import './shared/forms'; -@import './shared/icons'; -@import './shared/layout'; -@import './shared/page'; -@import './shared/typography'; -@import './shared/skeleton'; -@import './shared/interaction-state'; From d2434f1ee7f84903f9787543e94b5961c3c97c19 Mon Sep 17 00:00:00 2001 From: aveline Date: Tue, 1 Feb 2022 10:40:21 -0800 Subject: [PATCH 2/6] Update UNRELEASED-v9.md --- UNRELEASED-v9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/UNRELEASED-v9.md b/UNRELEASED-v9.md index 678e87c7a73..f9da39e930d 100644 --- a/UNRELEASED-v9.md +++ b/UNRELEASED-v9.md @@ -45,6 +45,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t - Removed the `high-contrast-outline()` and `high-contrast-border()` mixins and replaced with tokens and values ([#4962](https://github.com/Shopify/polaris-react/pull/4962)) - Removed the `when-printing`, `when-not-printing`, `hidden-when-printing`, and `print-hidden` scss mixins ([#4995](https://github.com/Shopify/polaris-react/pull/4995)) - Replaced the `icon-size()` function with the `--p-icon-size-medium` custom property ([#4990](https://github.com/Shopify/polaris-react/pull/4990)) +- Removed the public scss api ([#4993](https://github.com/Shopify/polaris-react/pull/4993)) **Sass global variables** From 371a27dd1aae6a47f976260499bb14053f37d816 Mon Sep 17 00:00:00 2001 From: aveline Date: Tue, 1 Feb 2022 13:42:46 -0800 Subject: [PATCH 3/6] Remove `/styles` from `/build` --- loom.config.ts | 6 ------ scripts/build-validate.js | 16 +--------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/loom.config.ts b/loom.config.ts index b4a4bfff0df..49d363c4a41 100644 --- a/loom.config.ts +++ b/loom.config.ts @@ -96,12 +96,6 @@ function preAndPostBuildPlugin() { ['./src/**/*.md', './build/docs', '--up=1'], {all: true}, ); - - await step.exec( - 'node_modules/.bin/copyfiles', - ['./src/styles/**/*.scss', './build/styles', '--up=2'], - {all: true}, - ); } catch (error) { throw new DiagnosticError({ title: 'Error runing postbuild steps', diff --git a/scripts/build-validate.js b/scripts/build-validate.js index 1bea7c3a05a..24de2505f88 100644 --- a/scripts/build-validate.js +++ b/scripts/build-validate.js @@ -9,7 +9,6 @@ const packageJSON = require('../package.json'); validateStandardBuild(); validateEsNextBuild(); -validateSassPublicApi(); validateAncillaryOutput(); validateVersionReplacement(); @@ -69,19 +68,6 @@ function validateEsNextBuild() { assert.ok(jsContent.includes('"hidden": "Polaris-Avatar--hidden_riqie"')); } -function validateSassPublicApi() { - assert.ok(fs.existsSync('./build/styles/foundation/_layout.scss')); - // does not contain any :global definitions - const files = glob.sync(`./build/styles/**/*.scss`); - assert.notStrictEqual(files.length, 0); - - const filesWithGlobalDefinitions = files.filter((file) => { - return fs.readFileSync(file, 'utf-8').includes(':global'); - }); - - assert.deepStrictEqual(filesWithGlobalDefinitions, []); -} - function validateAncillaryOutput() { assert.ok(fs.existsSync('./build/ts/latest/src/index.d.ts')); // Downleveled for consumers on older TypeScript versions @@ -89,7 +75,7 @@ function validateAncillaryOutput() { } function validateVersionReplacement() { - const files = glob.sync('./build/**/*.{js,mjs,esnext,css,scss}'); + const files = glob.sync('./build/**/*.{js,mjs,esnext,css}'); assert.notStrictEqual(files.length, 0); From 2dd9a87073df26ab68b4b7e3405db3dd23ecb495 Mon Sep 17 00:00:00 2001 From: aveline Date: Tue, 1 Feb 2022 14:27:09 -0800 Subject: [PATCH 4/6] Create migrating-from-v8-to-v9.md --- .../guides/migrating-from-v8-to-v9.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 documentation/guides/migrating-from-v8-to-v9.md diff --git a/documentation/guides/migrating-from-v8-to-v9.md b/documentation/guides/migrating-from-v8-to-v9.md new file mode 100644 index 00000000000..79d4c534be3 --- /dev/null +++ b/documentation/guides/migrating-from-v8-to-v9.md @@ -0,0 +1,37 @@ +# Migrating from v8 to v9 + +Polaris v9.0.0 ([full release notes](https://github.com/Shopify/polaris-react/releases/tag/v9.0.0)) features removal of the public scss api and removal of scss functions and mixins. + +## Theme provider + +## Removal of the public scss api + +Any functions that were being consumed from `build/styles/_public-api.scsspri` have been removed. The functions can be found in the following permalinks. + +(('./foundation/layout')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_layout.scss]) + +(('./foundation/focus-ring')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_focus-ring.scss]) + +(('./shared/accessibility')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_accessibility.scss]) + +(('./shared/breakpoints')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_breakpoints.scss]) + +(('./shared/buttons')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_buttons.scss]) + +(('./shared/controls')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_controls.scss]) + +(('./shared/forms')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_forms.scss]) + +(('./shared/icons')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_icons.scss]) + +(('./shared/layout')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_layout.scss]) + +(('./shared/page')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_page.scss]) + +(('./shared/typography')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_typography.scss]) + +(('./shared/skeleton')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_skeleton.scss]) + +(('./shared/interaction-state')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_interaction-state.scss]) + +(('./shared/printing')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_printing.scss]) From a54ad6ae380619104dc02e8af827e8dc12c7ee00 Mon Sep 17 00:00:00 2001 From: aveline Date: Tue, 1 Feb 2022 14:32:51 -0800 Subject: [PATCH 5/6] Update migrating-from-v8-to-v9.md --- .../guides/migrating-from-v8-to-v9.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/documentation/guides/migrating-from-v8-to-v9.md b/documentation/guides/migrating-from-v8-to-v9.md index 79d4c534be3..e45210a5abf 100644 --- a/documentation/guides/migrating-from-v8-to-v9.md +++ b/documentation/guides/migrating-from-v8-to-v9.md @@ -8,30 +8,30 @@ Polaris v9.0.0 ([full release notes](https://github.com/Shopify/polaris-react/re Any functions that were being consumed from `build/styles/_public-api.scsspri` have been removed. The functions can be found in the following permalinks. -(('./foundation/layout')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_layout.scss]) +[`./foundation/layout`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_layout.scss) -(('./foundation/focus-ring')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_focus-ring.scss]) +[`./foundation/focus-ring`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_focus-ring.scss) -(('./shared/accessibility')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_accessibility.scss]) +[`./shared/accessibility`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_accessibility.scss) -(('./shared/breakpoints')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_breakpoints.scss]) +[`./shared/breakpoints`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_breakpoints.scss) -(('./shared/buttons')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_buttons.scss]) +[`./shared/buttons`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_buttons.scss) -(('./shared/controls')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_controls.scss]) +[`./shared/controls`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_controls.scss) -(('./shared/forms')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_forms.scss]) +[`./shared/forms`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_forms.scss) -(('./shared/icons')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_icons.scss]) +[`./shared/icons`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_icons.scss) -(('./shared/layout')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_layout.scss]) +[`./shared/layout`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_layout.scss) -(('./shared/page')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_page.scss]) +[`./shared/page`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_page.scss) -(('./shared/typography')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_typography.scss]) +[`./shared/typography`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_typography.scss) -(('./shared/skeleton')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_skeleton.scss]) +[`./shared/skeleton`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_skeleton.scss) -(('./shared/interaction-state')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_interaction-state.scss]) +[`./shared/interaction-state`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_interaction-state.scss) -(('./shared/printing')[https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_printing.scss]) +[`./shared/printing`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/shared/_printing.scss) From 5ae8f97294227e06aa4277f7bdd1b2f2f0c2bd53 Mon Sep 17 00:00:00 2001 From: aveline Date: Tue, 1 Feb 2022 14:47:33 -0800 Subject: [PATCH 6/6] Update documentation/guides/migrating-from-v8-to-v9.md Co-authored-by: Laura Griffee --- documentation/guides/migrating-from-v8-to-v9.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/guides/migrating-from-v8-to-v9.md b/documentation/guides/migrating-from-v8-to-v9.md index e45210a5abf..c0d09148896 100644 --- a/documentation/guides/migrating-from-v8-to-v9.md +++ b/documentation/guides/migrating-from-v8-to-v9.md @@ -6,7 +6,7 @@ Polaris v9.0.0 ([full release notes](https://github.com/Shopify/polaris-react/re ## Removal of the public scss api -Any functions that were being consumed from `build/styles/_public-api.scsspri` have been removed. The functions can be found in the following permalinks. +Any functions that were being consumed from `build/styles/_public-api.scss` have been removed. The functions can be found in the following permalinks. [`./foundation/layout`](https://github.com/Shopify/polaris-react/blob/e2e6cb263bac1c5c1e607a6f6bd949a2d349d197/src/styles/foundation/_layout.scss)