Skip to content

Commit

Permalink
Merge branch 'master' into docs/lazy-nossr
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Mar 20, 2020
2 parents 535f6be + 8d12012 commit da31b96
Show file tree
Hide file tree
Showing 747 changed files with 7,247 additions and 2,411 deletions.
5 changes: 0 additions & 5 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ update_configs:
- match:
# These should be grouped once a PR for `jss` is opened
dependency_name: 'jss-*'
- match:
# breaks /api routes
# can be upgraded once https://github.com/zeit/next.js/issues/8123 is resolved
dependency_name: 'next'
version_requirement: '9.x'
- match:
# 1.18 started adding trailing commas only compatible with typescript ^3.4
dependency_name: 'prettier'
Expand Down
17 changes: 12 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = {
rules: {
'consistent-this': ['error', 'self'],
'linebreak-style': 'off', // Doesn't play nicely with Windows
// just as bad as "max components per file"
'max-classes-per-file': 'off',
'no-alert': 'error',
// Strict, airbnb is using warn; allow warn and error for dev environments
'no-console': ['error', { allow: ['warn', 'error'] }],
Expand All @@ -44,7 +46,7 @@ module.exports = {
// we have to be disciplined about the usage and ensure the Number type for its
// arguments
'no-restricted-globals': ['error'].concat(confusingBrowserGlobals),
'no-underscore-dangle': ['error', { allow: ['_rewriteUrlForNextExport'] }],
'no-underscore-dangle': 'error',
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
'prefer-destructuring': 'off', // Destructuring harm grep potential.

Expand All @@ -61,6 +63,8 @@ module.exports = {
// It's buggy
'react/forbid-prop-types': 'off',
'react/jsx-curly-brace-presence': 'off',
// prefer <React.Fragment> over <>. The former allows `key` while the latter doesn't
'react/jsx-fragments': ['error', 'element'],
'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], // airbnb is using .jsx
'react/jsx-handler-names': [
'error',
Expand All @@ -70,13 +74,19 @@ module.exports = {
eventHandlerPropPrefix: 'on',
},
],
// not a good rule for components close to the DOM
'react/jsx-props-no-spreading': 'off',
'react/no-danger': 'error',
// Strict, airbnb is using off
'react/no-direct-mutation-state': 'error',
'react/no-find-dom-node': 'off',
'react/no-multi-comp': 'off',
'react/require-default-props': 'off',
'react/sort-prop-types': 'error',
// This depends entirely on what you're doing. There's no universal pattern
'react/state-in-constructor': 'off',
// stylistic opinion. For conditional assignment we want it outside, otherwise as static
'react/static-property-placement': 'off',

'import/no-extraneous-dependencies': 'off', // It would be better to enable this rule.
'import/namespace': ['error', { allowComputed: true }],
Expand All @@ -89,10 +99,7 @@ module.exports = {
],

'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'error',
{ additionalHooks: 'useEnhancedEffect' },
],
'react-hooks/exhaustive-deps': ['error', { additionalHooks: 'useEnhancedEffect' }],
},
overrides: [
{
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Maintenance'
on:
# So that PRs touching the same files as the push are updated
push:
# So that the `dirtyLabel` is removed if conflicts are resolved
# On forks the secret isn't set. We need to manually remove it.
#pull_request:
# types: [synchronize]

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: check if prs are dirty
uses: eps1lon/actions-label-merge-conflict@releases/1.x
with:
dirtyLabel: 'PR: needs rebase'
removeOnDirtyLabel: 'PR: ready to ship'
repoToken: '${{ secrets.GITHUB_TOKEN }}'
118 changes: 117 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,121 @@
### [Versions](https://material-ui.com/versions/)

## 4.9.6
###### *Mar 18, 2020*

Big thanks to the 39 contributors who made this release possible.

Here are some highlights ✨:

- ⚛️ Improve the DX in Visual Studio Code (#20079, #19962, #19280) @eps1lon @jedwards1211.
- Preview the colors in right in the editor
![](https://user-images.githubusercontent.com/12292047/76473891-2b70ad80-63fa-11ea-8afe-38ceee43eeaa.png)
![](https://user-images.githubusercontent.com/12292047/76473890-2ad81700-63fa-11ea-9bb3-005f79a195e7.png)
- Preview the purpose of each theme.spacing arguments right in the editor
![](https://user-images.githubusercontent.com/12292047/75786858-31192400-5d66-11ea-9382-94dd74c42985.png)
- Leverage code snippets to save time with [this extension](https://marketplace.visualstudio.com/items?itemName=vscodeshift.material-ui-snippets).
- 🔍 12 patches on the Autocomplete component.
- 💄 Polish on the Pagination component (#19933, #19964, #19966, #19987) @pvdstel @eps1lon @mbrookes.

### `@material-ui/core@v4.9.6`

- [Chip] Prevent event default when onDelete is triggered (#20051) @eps1lon
- [Container] Reset display block (#19971) @oliviertassinari
- [DatePicker] Fix codesandbox demo (#19926) @netochaves
- [Drawer] Add a comment for clarity on the styling of height of the toolbar (#19934) @smerriman18
- [Grid] Fix row-reverse typo (#20048) @jhthompson
- [Link] Fix color mismatch with Typography component (#19949) Weslen do Nascimento
- [ListItemText] Fix display block issue (#20039) @psdr03
- [Select] Simplify the demos (remove ref) (#20076) @captain-yossarian
- [TablePagination] Out of range warning when "count={-1}" (#19874) @dbarabashdev
- [TextField] Avoid outline label CSS leak (#19937) @ivoiv
- [TextField] Fix outlined render gap if label = empty string (#19722) @captain-yossarian
- [TextField] Minimize usage of z-index (#19547)" (#20016) @piotros
- [theme] Describe what each argument of theme.spacing affects (#19962) @eps1lon
- [theme] Array reject on spacing transformation fixed (#19900) Weslen do Nascimento
- [Tooltip] Fix useMemo dependency (#19899) @NMinhNguyen
- [Tooltip] Reduce enterDelay to 100ms (#19898) @oliviertassinari

### `@material-ui/styles@v4.9.6`

- [styles] Fix theme default props overriden by Component default (#20091) @adridavid
- [styles] Name anonymous function type (#19996) @eps1lon

### `@material-ui/system@v4.9.6`

- [theme] Array reject on spacing transformation fixed (#19900) Weslen do Nascimento

### `@material-ui/utils@v4.9.6`

- [core] Fix deepmerge of DOM elements (#20100) @ValentinH

### `@material-ui/lab@v4.0.0-alpha.46`

- [Autocomplete] Add more details in the onChange event (#19959) @akharkhonov
- [Autocomplete] Add scrollbar support in IE11 (#19969) @SergeyUstinovich
- [Autocomplete] Better synchronize the highlight with the value (#19923) @captain-yossarian
- [Autocomplete] Document listbox limitation (#20101) @zatine
- [Autocomplete] Fix clearOnEscape + multiple combination (#20065) @chaudharykiran
- [Autocomplete] Fix GitHub's demo behavior (#19928) @hasanozacar
- [Autocomplete] Fix typo in prop description (#20086) @vince1995
- [Autocomplete] Improvement popup open logic (#19901) @haseebdaone
- [Autocomplete] Make categories more obvious (#20142) @embeddedt
- [Autocomplete] Simplify error for wrong getOptionLabel (#20103) @oliviertassinari
- [Autocomplete] Update onChange API @oliviertassinari
- [Autocomplete] Use getOptionLabel over stringify (#19974) @a-type
- [AvatarGroup] Add max avatar prop (#19853) @GFynbo
- [Pagination] Add TypeScript types (#19933) @pvdstel
- [Pagination] Fix prop forwarding of `onChange` and `page` (#19964) @eps1lon
- [Pagination] Leverage `@default` over default values (#19966) @eps1lon
- [Pagination] Remove children prop (#19987) @mbrookes
- [Rating] Fix text alignment inheritance (#20055) @mlizchap
- [Skeleton] Fix SkeletonClassKey type (#20047) @100terres
- [Skeleton] Improve wave dark mode support (#20112) @oliviertassinari

### Docs

- [docs] Add radio error demo (#19599) @mbrookes
- [docs] Bump next to latest (#19995) @eps1lon
- [docs] Display color preview in IntelliSense (#20079) @eps1lon
- [docs] Document typescript:transpile script (#19951) @eps1lon
- [docs] Fix @material-ui/styles release version number (#19939) @jkjustjoshing
- [docs] Fix OutlinedLabel typo (#20006) @ljcooke
- [docs] Fix SEO issues (#20108) @oliviertassinari
- [docs] Fix Sketch link (#19944) @mbrookes
- [docs] Fix grammar in autocomplete doc (#20066) @dandv
- [docs] Fix incorrect type for fontWeight @eps1lon
- [docs] Fix missing OutlinedLabel#label link in Select API docs (#19993) @eps1lon
- [docs] Flexbox, add element for show the good effect (#19956) @tbredillet
- [docs] Flexbox: update item number (#19954) @tbredillet
- [docs] Improve font size scaling of some demos (#19950) @eps1lon
- [docs] Remove premium support offerings (#19972) @mbrookes
- [docs] Simplify checkbox examples (#20052) @tacigar
- [docs] Simplify some demos (#19608) @mbrookes
- [docs] Track bundle size of pages (#19978) @eps1lon
- [docs] Upgrade to next 9 (#18441) @eps1lon
- [docs] Simplify drawer examples (#20040) @TommyJackson85
- [examples] Fix typo in gatsby readme (#19998) @eps1lon

### Core

- [test] Match against messages not args on console methods (#20046) @eps1lon
- [test] Resize screenshots with sharp (#19979) @oliviertassinari
- [test] Run snapshot tests on the a11y tree (#20019) @eps1lon
- [ci] Fix azure not running (#20127) @eps1lon
- [ci] Fix incorre pr number for experimental scripts (#20021) @eps1lon
- [ci] Let failed types-next jobs pass (#20007) @eps1lon
- [ci] Let failed types-next jobs pass (#20017) @eps1lon
- [core] Add missing properties to TypeAction (#20075) @timonweber
- [core] Add spacing after prettier command (#20073) @dandv
- [core] Batch small changes (#20111) @oliviertassinari
- [core] Fix typos in code comments (#19999) @eps1lon
- [core] Improve the DX when iterating on components (#20128) @oliviertassinari
- [core] Use Babel 7 version of transform-react-constant-elements (#20015) @merceyz
- [security] Bump acorn from 5.7.3 to 5.7.4 (#20105) @dependabot-preview
- [core] Batch small changes (#19896) @oliviertassinari
- [core] Update type defs to use OverridableComponent (#20110) @theGirrafish
- [core] Fix docs:api cleaning the wrong directory #20164 @ro7584

## 4.9.5
###### *Feb 29, 2020*

Expand Down Expand Up @@ -3322,7 +3438,7 @@ Here are some highlights ✨:
We have removed the `labelContainer`, `label` and `labelWrapped` class keys.
We have removed 2 intermediary DOM elements.
You should be able to move the custom styles to the root class key.
![capture d ecran 2019-02-23 a 15 46 48](https://user-images.githubusercontent.com/3165635/53287870-53a35500-3782-11e9-9431-2d1a14a41be0.png)
![](https://user-images.githubusercontent.com/3165635/53287870-53a35500-3782-11e9-9431-2d1a14a41be0.png)

- [Table] Add dense support (#14561) @leMaik

Expand Down
18 changes: 18 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ trigger:
- l10n
- dependabot/*

# https://developercommunity.visualstudio.com/comments/949241/view.html
pr:
branches:
include:
- '*'

pool:
vmImage: 'ubuntu-latest'

variables:
DOCS_NEXT_CACHE_FOLDER: $(Build.SourcesDirectory)/docs/.next/cache

steps:
- task: NodeTool@0
inputs:
Expand Down Expand Up @@ -48,6 +57,15 @@ steps:
artifactName: 'canaries'
targetPath: 'material-ui-core.tgz'

- task: Cache@2
inputs:
key: 'yarn | "$(Agent.OS)" | yarn.lock'
restoreKeys: |
yarn | "$(Agent.OS)"
yarn
path: $(DOCS_NEXT_CACHE_FOLDER)
displayName: Cache nextjs build

- script: |
set -o pipefail
mkdir -p scripts/sizeSnapshot/build
Expand Down
12 changes: 9 additions & 3 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,15 @@ async function run() {
});
const pageDetailsTable = createComparisonTable(pageResults, {
computeBundleLabel: bundleId => {
const host = `https://deploy-preview-${danger.github.pr.number}--material-ui.netlify.com`;
const page = bundleId.replace(/^docs:/, '');
return `[${page}](${host}${page})`;
// a page
if (bundleId.startsWith('docs:/')) {
const host = `https://deploy-preview-${danger.github.pr.number}--material-ui.netlify.com`;
const page = bundleId.replace(/^docs:/, '');
return `[${page}](${host}${page})`;
}

// shared
return bundleId;
},
});

Expand Down
15 changes: 11 additions & 4 deletions docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const workspaceRoot = path.join(__dirname, '../');
const reactMode = 'legacy';

module.exports = {
typescript: {
// Motivated by https://github.com/zeit/next.js/issues/7687
ignoreDevErrors: true,
ignoreBuildErrors: true,
},
webpack: (config, options) => {
const plugins = config.plugins.concat([
new webpack.DefinePlugin({
Expand Down Expand Up @@ -72,12 +77,14 @@ module.exports = {
];
}

return Object.assign({}, config, {
return {
...config,
plugins,
node: {
fs: 'empty',
},
module: Object.assign({}, config.module, {
module: {
...config.module,
rules: config.module.rules.concat([
{
test: /\.(css|md)$/,
Expand Down Expand Up @@ -122,8 +129,8 @@ module.exports = {
use: options.defaultLoaders.babel,
},
]),
}),
});
},
};
},
exportTrailingSlash: true,
// Next.js provides a `defaultPathMap` argument, we could simplify the logic.
Expand Down
7 changes: 4 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "Material-UI Team",
"license": "MIT",
"scripts": {
"build": "rimraf .next && cross-env NODE_ENV=production next build",
"build": "cross-env NODE_ENV=production next build",
"build:clean": "rimraf .next && yarn build",
"build-sw": "node ./scripts/buildServiceWorker.js",
"dev": "rimraf ./node_modules/.cache/babel-loader && next dev",
"deploy": "git push material-ui-docs master:latest",
Expand Down Expand Up @@ -64,7 +65,7 @@
"cross-fetch": "^3.0.4",
"css-loader": "^3.1.0",
"css-mediaquery": "^0.1.2",
"date-fns": "2.10.0",
"date-fns": "2.11.0",
"docsearch.js": "^2.6.3",
"doctrine": "^3.0.0",
"express": "^4.17.1",
Expand All @@ -82,7 +83,7 @@
"marked": "^0.8.0",
"material-table": "^1.50.0",
"material-ui-popup-state": "^1.4.1",
"next": "9.1.4",
"next": "^9.3.0",
"notistack": "^0.9.3",
"nprogress": "^0.2.0",
"postcss": "^7.0.18",
Expand Down
7 changes: 4 additions & 3 deletions docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import PropTypes from 'prop-types';
import acceptLanguage from 'accept-language';
import { create } from 'jss';
import rtl from 'jss-rtl';
import { Router as Router2, useRouter } from 'next/router';
import { useRouter } from 'next/router';
import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export';
import { StylesProvider, jssPreset } from '@material-ui/styles';
import pages from 'docs/src/pages';
import initRedux from 'docs/src/modules/redux/initRedux';
Expand Down Expand Up @@ -58,7 +59,7 @@ function LanguageNegotiation() {

React.useEffect(() => {
const { userLanguage: userLanguageUrl, canonical } = pathnameToLanguage(
Router2._rewriteUrlForNextExport(router.asPath),
rewriteUrlForNextExport(router.asPath),
);
const preferedLanguage =
getCookie('userLanguage') !== 'noDefault' && userLanguage === 'en'
Expand Down Expand Up @@ -289,7 +290,7 @@ function AppWrapper(props) {
if (pathname !== '/') {
// The leading / is only added to support static hosting (resolve /index.html).
// We remove it to normalize the pathname.
// See `_rewriteUrlForNextExport` on Next.js side.
// See `rewriteUrlForNextExport` on Next.js side.
pathname = pathname.replace(/\/$/, '');
}
const activePage = findActivePage(pages, pathname);
Expand Down
Loading

0 comments on commit da31b96

Please sign in to comment.