Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions UNRELEASED-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
37 changes: 37 additions & 0 deletions documentation/guides/migrating-from-v8-to-v9.md
Original file line number Diff line number Diff line change
@@ -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.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)

[`./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)
6 changes: 0 additions & 6 deletions loom.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
17 changes: 1 addition & 16 deletions scripts/build-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const packageJSON = require('../package.json');

validateStandardBuild();
validateEsNextBuild();
validateSassPublicApi();
validateAncillaryOutput();
validateVersionReplacement();

Expand Down Expand Up @@ -69,28 +68,14 @@ function validateEsNextBuild() {
assert.ok(jsContent.includes('"hidden": "Polaris-Avatar--hidden_riqie"'));
}

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`);
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
assert.ok(fs.existsSync('./build/ts/3.4/src/index.d.ts'));
}

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);

Expand Down
32 changes: 0 additions & 32 deletions src/styles/_public-api.scss

This file was deleted.