Skip to content

Runtime auto #8643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 73 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
578c176
Remove KonamiCode component (#7349)
tmlayton Oct 5, 2022
e8cc97c
Merge branch 'main' into v11-major
Bringer128 Oct 13, 2022
d2d396f
[Collapsible] Remove deprecated Collapsible argument (#7397)
Bringer128 Oct 31, 2022
4ac85a1
Merge branch 'main' of https://github.com/Shopify/polaris into v11-major
lgriffee Nov 1, 2022
13d95f0
Create migrating-from-v10-to-v11.md
lgriffee Nov 1, 2022
bf9035b
Merge branch 'main' of https://github.com/Shopify/polaris into v11-major
lgriffee Nov 17, 2022
e10c1e1
Merge branch 'main' into v11-major
aveline Dec 21, 2022
e811088
Merge branch 'main' into v11-major
kyledurand Jan 5, 2023
1441b7a
remove deprecated preventMeasuringOnChildrenUpdate
kyledurand Jan 5, 2023
590711c
Change Breadcrumbs to accept a single breadcrumb instead of an array …
itwasmattgregg Jan 10, 2023
690b6cf
Merge branch 'main' into v11-major
alex-page Jan 27, 2023
8de5271
Fix breadcrumb tests
alex-page Jan 27, 2023
f5ad75f
Remove `beta` status from `Text` (#8187)
laurkim Jan 27, 2023
a1318f8
Remove deprecated typography components (#8184)
laurkim Jan 27, 2023
ba75af4
Merge branch 'main' into v11-major
alex-page Jan 28, 2023
62593f3
Temp minimum node version to 14.18
alex-page Jan 29, 2023
73a6bc5
Merge branch 'main' into v11-major
alex-page Jan 29, 2023
ff6248c
1/x Bump build dependencies (#8200)
alex-page Jan 30, 2023
89c8ae4
2/x Bump NodeJS supported versions to ^16.16 || ^18.13 (#8201)
alex-page Jan 30, 2023
3bc5ac9
Add v11 docs for konami code
alex-page Jan 30, 2023
7691259
Merge branch 'main' into v11-major
alex-page Jan 30, 2023
0f0dca0
Adjust NodeJS versions so we support LTS 16/18 and future versions (#…
alex-page Jan 30, 2023
1333261
Re-add deprecated typography docs (#8206)
laurkim Feb 1, 2023
294326f
Fix merge conflict
laurkim Feb 1, 2023
fa47aa5
Merge branch 'main' into v11-major
alex-page Feb 2, 2023
6215f5c
Remove downlevel-dts and legacy type support (#8203)
alex-page Feb 2, 2023
b348834
Bump minimum Node version to 16.17.0 (#8212)
aaronccasanova Feb 2, 2023
37cacc5
Merge branch 'main' into v11-major
sam-b-rose Feb 2, 2023
a766dec
Remove text-transform from Polaris React (#8255)
sam-b-rose Feb 3, 2023
d3de5ab
Merge branch 'main' into v11-major
alex-page Feb 12, 2023
b0ac7a5
Fix props
alex-page Feb 12, 2023
b686bc7
Merge branch 'main' into v11-major
laurkim Feb 13, 2023
c07bf0c
Merge branch 'main' into v11-major
alex-page Feb 14, 2023
79f40cd
Remove support for React 16 and 17 (#8340)
alex-page Feb 15, 2023
994bb90
Use browserslist, remove @shopify/browserslist-config and update cani…
alex-page Feb 16, 2023
87ca999
Merge branch 'main' into v11-major
alex-page Feb 16, 2023
2867843
Merge branch 'v11-major' of https://github.com/Shopify/polaris into v…
alex-page Feb 16, 2023
11d56c5
Update props.json
alex-page Feb 16, 2023
e288ca6
Merge branch 'main' into v11-major
laurkim Feb 22, 2023
641297f
[polaris.shopify.com] Run `get-props`
laurkim Feb 22, 2023
5985838
[Layout foundations] Replace Card with AlphaCard (#8468)
laurkim Feb 22, 2023
04d1e51
Merge branch 'main' into v11-major
alex-page Feb 23, 2023
971ceb3
bump yarn
alex-page Feb 23, 2023
9e03ab7
Fix breadcrumb type issues
alex-page Feb 23, 2023
0070f64
Move browserslist nodejs out of package.json so that storybook passes
alex-page Feb 23, 2023
68fd9c0
Change breadcrumb to backlink (#8465)
itwasmattgregg Feb 23, 2023
f5cf669
Merge branch 'main' into v11-major
alex-page Mar 2, 2023
4e7c41e
Fix Card story spacing
laurkim Mar 2, 2023
ed504b4
Merge branch 'main' into v11-major
alex-page Mar 3, 2023
60940f7
Merge branch 'main' into v11-major
laurkim Mar 7, 2023
1b95a8b
Merge branch 'main' into v11-major
laurkim Mar 7, 2023
35a4089
Merge branch 'main' into v11-major
alex-page Mar 8, 2023
62cca13
Replace useUniqueId with useId (#8396)
alex-page Mar 8, 2023
af07c6d
Merge branch 'main' into v11-major
laurkim Mar 8, 2023
50e8bb5
[Layout foundations] Replace Stack with AlphaStack (#8577)
laurkim Mar 8, 2023
e80d1c7
Merge branch 'main' into v11-major
laurkim Mar 8, 2023
bc99b8b
Re-add Stack changes
laurkim Mar 8, 2023
ea8cb2a
Update URLs referencing AlphaStack
laurkim Mar 8, 2023
e994a78
Re-add AlphaCard story changes
laurkim Mar 8, 2023
d118c25
Replace @shopify/babel-preset with using underlying configs
BPScott Mar 10, 2023
6e750e9
Remove opting into babel plugins
BPScott Mar 10, 2023
4cbc8b7
Merge branch 'main' into v11-major
alex-page Mar 10, 2023
fe99874
Update migrating-from-v10-to-v11.md
alex-page Mar 10, 2023
44b9887
add changeset
BPScott Mar 10, 2023
82ff68b
Add runtime automatic
alex-page Mar 10, 2023
d1c9d98
Define our own in-repo babel configuration (#8624)
BPScott Mar 10, 2023
69a0ac0
Merge branch 'main' into v11-major
laurkim Mar 10, 2023
4da3517
Fix Card example metadata
laurkim Mar 10, 2023
6a61bef
Merge branch 'main' into v11-major
alex-page Mar 13, 2023
628cc5d
Merge branch 'v11-major' into runtime-auto
alex-page Mar 13, 2023
f0b3159
Config for runtime: automatic
alex-page Mar 13, 2023
d09999c
Fix up config
alex-page Mar 15, 2023
ce3542c
Run migration
alex-page Mar 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/afraid-scissors-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': major
---

Change breadcrumbs from an array to a single backAction since only one is supported.
5 changes: 5 additions & 0 deletions .changeset/few-forks-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': major
---

No longer transpile optional chaining, nullish coalescing or numeric separators, as our target browser environments all have native support for these syntaxes. This removes support for apps using webpack4, which unable to parse these syntaxes.
6 changes: 6 additions & 0 deletions .changeset/light-mails-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/polaris': minor
'polaris.shopify.com': minor
---

Replaced `Stack` with `AlphaStack`
5 changes: 5 additions & 0 deletions .changeset/nasty-suns-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'polaris.shopify.com': patch
---

Removed beta status from `Text`
6 changes: 6 additions & 0 deletions .changeset/real-lemons-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/polaris': major
'polaris.shopify.com': minor
---

Removed deprecated `DisplayText`, `Heading`, `Subheading`, `Caption`, `TextStyle`, and `VisuallyHidden` components
6 changes: 6 additions & 0 deletions .changeset/six-jokes-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/polaris': major
'polaris.shopify.com': minor
---

Replaced `Card` with `AlphaCard`
5 changes: 5 additions & 0 deletions .changeset/stupid-vans-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': major
---

Removed deprecated preventMeasuringOnChildUpdate prop on Collapsible
12 changes: 5 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ module.exports = {
'react/button-has-type': 'off',
'react/no-array-index-key': 'off',
'react/no-unsafe': ['error', {checkAliases: true}],

// These can be removed when eslint-plugin-react is updated
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',

'@shopify/jsx-no-complex-expressions': 'off',
'@shopify/jsx-prefer-fragment-wrappers': 'off',
'@shopify/no-ancestor-directory-import': 'error',
Expand Down Expand Up @@ -129,12 +134,6 @@ module.exports = {
'import/extensions': 'off',
'import/no-default-export': 'off',
'import/no-anonymous-default-export': 'off',
// We could omit this if we set `engines` fields properly
// As we don't set them then eslint thinks we're using node 8
'node/no-unsupported-features/node-builtins': [
'error',
{version: '>=16.0.0'},
],
},
},
{
Expand Down Expand Up @@ -171,7 +170,6 @@ module.exports = {
files: ['polaris.shopify.com/**/*'],
extends: 'plugin:@next/eslint-plugin-next/recommended',
rules: {
'react/react-in-jsx-scope': 'off',
'@shopify/jsx-no-hardcoded-content': 'off',
'import/no-default-export': 'off',
},
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Each contributor is required to [sign a CLA](https://cla.shopify.com/). This pro

### Contribution prerequisites

- You have Node installed at v16.13.0+ and Yarn at v1.22.18+
- You have Node installed at v18.12.0+ and Yarn at v1.22.18+

### Best practices

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup Node with v16.13.0
- name: Setup Node with v18.12.0
uses: actions/setup-node@v3
with:
node-version: 16.13.0
node-version: 18.12.0

- name: Check for Changeset
run: npx @changesets/cli status --since="origin/main"
8 changes: 4 additions & 4 deletions .github/workflows/ci-a11y-vrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- name: Setup Node with v16.13.0
- name: Setup Node with v18.12.0
uses: actions/setup-node@v3
with:
node-version: 16.13.0
node-version: 18.12.0
cache: yarn

- name: Restore cache
Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:
with:
fetch-depth: 0 # Chromatic git history to track changes

- name: Setup Node with v16.13.0
- name: Setup Node with v18.12.0
uses: actions/setup-node@v3
with:
node-version: 16.13.0
node-version: 18.12.0
cache: yarn

- name: Restore cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['14.17.0', '16.13.0']
node-version: ['16.17.0', '18.12.0']
steps:
- name: Checkout branch
uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Session.vim
/polaris.shopify.com/public/sitemap.xml
/polaris.shopify.com/public/og-images
/polaris.shopify.com/public/playroom
storybook-static
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.13.0
v18.12.0
71 changes: 60 additions & 11 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,64 @@
/**
* @type {import('@babel/core').TransformOptions}
*/
module.exports = {
presets: [['@shopify/babel-preset', {typescript: true, react: true}]],
babelrcRoots: [
'.',
// Note: The following projects use rootMode: 'upward' to inherit
// and merge with this root level config.
'./polaris-migrator',
'./polaris-tokens',
'./polaris-icons',
'./polaris-react',
],
module.exports = function (api) {
const envName = api.env();
const development = envName === 'development' || envName === 'test';

return {
presets: [
[
'@babel/preset-env',
{useBuiltIns: 'entry', corejs: '3.0', bugfixes: true},
],
['@babel/preset-typescript'],
[
'@babel/preset-react',
{
runtime: 'automatic',
development,
},
],
],
assumptions: {
setPublicClassFields: true,
privateFieldsAsProperties: true,
// nothing accesses `document.all`:
noDocumentAll: true,
// nothing relies on class constructors invoked without `new` throwing:
noClassCalls: true,
// nothing should be relying on tagged template strings being frozen:
mutableTemplateObject: true,
// nothing is relying on Function.prototype.length:
ignoreFunctionLength: true,
// nothing is relying on mutable re-exported bindings:
constantReexports: true,
// don't bother marking Module records non-enumerable:
enumerableModuleMeta: true,
// nothing uses [[Symbol.toPrimitive]]:
// (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive)
ignoreToPrimitiveHint: true,
// nothing relies on spread copying Symbol keys: ({...{ [Symbol()]: 1 }})
objectRestNoSymbols: true,
// nothing relies on `new (() => {})` throwing:
noNewArrows: true,
// transpile object spread to assignment instead of defineProperty():
setSpreadProperties: true,
// nothing should be using custom iterator protocol:
skipForOfIteratorClosing: true,
// nothing inherits from a constructor function with explicit return value:
superIsCallableConstructor: true,
// nothing relies on CJS-transpiled namespace imports having all properties prior to module execution completing:
noIncompleteNsImportDetection: true,
},
babelrcRoots: [
'.',
// Note: The following projects use rootMode: 'upward' to inherit
// and merge with this root level config.
'./polaris-migrator',
'./polaris-tokens',
'./polaris-icons',
'./polaris-react',
],
};
};
2 changes: 1 addition & 1 deletion dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: polaris
up:
- node:
yarn: v1.22.18
version: v16.13.0 # to be kept in sync with .nvmrc and .github/workflows/ci.yml
version: v18.12.0 # to be kept in sync with .nvmrc and .github/workflows/ci.yml
- custom:
name: Build monorepo
met?: yarn build --output-logs=none
Expand Down
18 changes: 10 additions & 8 deletions documentation/Nodejs support.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,40 @@ The `package.json` engines. This should match the `.github/workflows/ci.yml` and

```json
"engines": {
"node": "^14.17.0 || ^16.13.0"
"node": "^16.17.0 || >=18.12.0"
},
```

The GitHub actions `.github/workflows/ci.yml` file. This should match the `package.json` and list all supported versions.

```yml
node-version: ['14.17.0', '16.13.0']
node-version: ['16.17.0', '18.12.0']
```

The `dev.yml` file which creates a local development environment. This should match the `.nvmrc` file.

```yml
version: v16.13.0
version: v18.12.0
```

The `.nvmrc` file for local development. This should match the `dev.yml` file.

```
v16.13.0
v18.12.0
```

The `shipit.yml` files. This should point towards the GitHub Actions the packages require to pass before publishing.

```yml
ci:
require:
- 'Validate with Node v14.17.0'
- 'Validate with Node v16.13.0'
- 'Validate with Node v16.17.0'
- 'Validate with Node v18.12.0'

merge:
require:
- 'Validate with Node v14.17.0'
- 'Validate with Node v16.13.0'
- 'Validate with Node v16.17.0'
- 'Validate with Node v18.12.0'
```

The `rollup.config.mjs` for some monorepo packages. This should match the minimum supported version.
45 changes: 45 additions & 0 deletions documentation/guides/migrating-from-v10-to-v11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Migrating from v10 to v11

Polaris v11.0.0 ([full release notes](https://github.com/Shopify/polaris/releases/tag/v11.0.0)) features...

## Table of Contents

- [Node support](#node-support)
- [Components](#components)
- [Removed deprecated Collapsible argument](#removed-deprecated-collapsible-argument)
- [Removed KonamiCode component](#removed-konamicode-component)
- [Tokens](#tokens)

## Node support

NodeJS version 14 is no longer supported. NodeJS 18 is recommended and 16 is the minimum supported version.

## React support

React version 16 and 17 is no longer supported. React 18 is the minimum supported version.

## Webpack support

Webpack version 4 is no longer supported. Webpack 5 is the minimum supported version.

## TypeScript

Built types in `@shopify/polaris` have moved from `build/ts/latest` to `build/ts`.

**Legacy TypeScript Support**

Polaris no longer supports multiple versions of TypeScript with downlevel-dts. Polaris only builds one set of types based on the current version of TypeScript in the project.

## Components

### Removed deprecated Collapsible argument

We've removed the following deprecated prop from the Collapsible component:

`- preventMeasuringOnChildrenUpdate?: boolean;`

### Removed KonamiCode component

We are removing low usage components from Polaris. We love fun but we also want to ensure we are shipping exactly what our users need. If you want to use this in your project feel free to copy the [component sourcecode](https://github.com/Shopify/polaris/blob/%40shopify/polaris%4010.24.0/polaris-react/src/components/KonamiCode/KonamiCode.tsx).

## Tokens
35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"engines": {
"node": "^14.17.0 || ^16.13.0"
"node": "^16.17.0 || >=18.12.0"
},
"workspaces": {
"packages": [
Expand Down Expand Up @@ -44,29 +44,32 @@
"postinstall": "patch-package"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/node": "^7.14.9",
"@babel/core": "^7.20.12",
"@babel/node": "^7.20.7",
"@babel/preset-env": "^7.16.4",
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.18.6",
"@changesets/changelog-github": "^0.4.4",
"@changesets/cli": "^2.23.0",
"@changesets/get-release-plan": "^3.0.14",
"@next/eslint-plugin-next": "^12.1.4",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-image": "^2.0.5",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.2.1",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-virtual": "^2.0.3",
"@rollup/pluginutils": "^4.1.0",
"@shopify/babel-preset": "^24.1.2",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-image": "^3.0.2",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-virtual": "^3.0.1",
"@rollup/pluginutils": "^5.0.2",
"@shopify/cli": "^3.10.1",
"@shopify/eslint-plugin": "^42.0.1",
"@shopify/prettier-config": "^1.1.2",
"@shopify/stylelint-plugin": "^11.0.0",
"@shopify/typescript-configs": "^5.1.0",
"@size-limit/preset-small-lib": "^5.0.3",
"@types/jest": "^27.5.1",
"downlevel-dts": "^0.6.0",
"@types/node": "^18.11.18",
"babel-loader": "^9.1.2",
"eslint": "^8.3.0",
"execa": "^5.0.0",
"jest": "^27.5.1",
Expand All @@ -76,13 +79,13 @@
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.5.0",
"rollup": "^2.70.2",
"rollup-plugin-node-externals": "^4.0.0",
"rollup": "^3.12.0",
"rollup-plugin-node-externals": "^5.1.0",
"size-limit": "^5.0.3",
"stylelint": "^14.15.0",
"ts-node": "^10.7.0",
"turbo": "^1.2.8",
"typescript": "^4.6.3"
"typescript": "^4.9.3"
},
"prettier": "@shopify/prettier-config",
"size-limit": [
Expand Down
Loading