Skip to content
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

[core] Switch to Typescript incrementally (tests run @babel/register) #9561

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
34ea465
fix createShallow typing
rosskevin Dec 16, 2017
df42dad
convert Paper.spec to tsx
rosskevin Dec 16, 2017
4126a1e
attempt to run Paper.spec.tsx
rosskevin Dec 16, 2017
6bbf7cc
pull flow and omit consoleError for now
rosskevin Dec 16, 2017
6b1ccee
fix failure on <
rosskevin Dec 16, 2017
f5e030c
almost running Paper.spec
rosskevin Dec 16, 2017
fdb8b96
goodbye flow
rosskevin Dec 16, 2017
4524418
broken at Paper.tsx
rosskevin Dec 16, 2017
82402f5
woohoo Paper.spec.tsx works
rosskevin Dec 16, 2017
14845c8
prettier on ts files
rosskevin Dec 16, 2017
9794d13
add back flow, flow-typed to prevent diff
rosskevin Dec 16, 2017
f720557
prevent flowconfig diff
rosskevin Dec 16, 2017
c201a13
fix import * as warning from 'warning';
rosskevin Dec 16, 2017
0de95ce
deepmerge workaround
rosskevin Dec 16, 2017
cacfb87
add back consoleError in test setup
rosskevin Dec 16, 2017
82a7574
fix export MuiShallow
rosskevin Dec 16, 2017
db79d07
fix bad replacements of `: Object` in .d.ts files
rosskevin Dec 16, 2017
1ee29e8
ts createBreakpoints
rosskevin Dec 16, 2017
dfdaeb5
ts colorManipulator
rosskevin Dec 16, 2017
488056a
ts createGenerateClassName
rosskevin Dec 16, 2017
5c7bc52
ts creatMixins, createMuiTheme
rosskevin Dec 16, 2017
a4e6a7e
ts createPalette
rosskevin Dec 16, 2017
6829b4c
drop flow-typed and flow folders
rosskevin Dec 16, 2017
c805567
ts themeListener
rosskevin Dec 16, 2017
33c0ba9
seed untyped-modules.d.ts
rosskevin Dec 16, 2017
349b9cb
replace common imports
rosskevin Dec 16, 2017
10a40d0
ts MuiThemeProvider
rosskevin Dec 16, 2017
d34a7b2
ts shadows
rosskevin Dec 16, 2017
5906446
ts transitions
rosskevin Dec 16, 2017
08bca1d
ts zindex
rosskevin Dec 16, 2017
d43a73a
ts zindex
rosskevin Dec 16, 2017
4f81843
add back exported types for spacing and shadows
rosskevin Dec 16, 2017
cdd1001
fix createMuiTheme optional arg and ts index
rosskevin Dec 16, 2017
01b6ba3
convert utils to ts
rosskevin Dec 16, 2017
660b165
ts Collapse
rosskevin Dec 16, 2017
cdfb84b
type transitions (still some problems)
rosskevin Dec 17, 2017
9a93242
initial wave of errors done, now onto real errors
rosskevin Dec 17, 2017
63a4b4f
reestablish some types in transition.d.ts that are reused
rosskevin Dec 17, 2017
c5a2837
all typescript errors fixed
rosskevin Dec 17, 2017
5ae7d16
wip trying test:unit
rosskevin Dec 18, 2017
1505b3c
expand tsc to all of test
rosskevin Dec 18, 2017
a4d3218
workaround debounce import
rosskevin Dec 18, 2017
b593977
more import fixing
rosskevin Dec 18, 2017
5d391a6
convert Ripple tsx
rosskevin Dec 18, 2017
aaa6fff
getting closer on ButtonBase tests
rosskevin Dec 18, 2017
a0c223a
wip ButtonBase tests
rosskevin Dec 18, 2017
e90b909
ButtonBase tests work
rosskevin Dec 18, 2017
a04a509
ts until - not sure why one test fails
rosskevin Dec 18, 2017
7a195ec
down to 16 errors
rosskevin Dec 18, 2017
02ed233
down to 20
rosskevin Dec 18, 2017
de69d65
fix integrations
rosskevin Dec 18, 2017
1be2aa9
down to 6
rosskevin Dec 18, 2017
7d48b2f
closer
rosskevin Dec 18, 2017
020586c
5 left
rosskevin Dec 18, 2017
ddb8558
ts Tooltip
rosskevin Dec 18, 2017
be9b953
ease eslint rules for incremental typescript
rosskevin Dec 18, 2017
c842013
only load lib es2015
rosskevin Dec 18, 2017
3c4f997
fix script
rosskevin Dec 18, 2017
537fbc0
rebase
rosskevin Dec 18, 2017
27d2318
remove flow from circleci steps
rosskevin Dec 18, 2017
6441d8d
add flow-typed back for better review
oliviertassinari Dec 18, 2017
5bb0343
my turn :)
oliviertassinari Dec 18, 2017
e189853
first attempt at webpack build:umd setup for ts
rosskevin Dec 19, 2017
9a292bf
wip build with babel 7
rosskevin Dec 19, 2017
5232540
babel builds are working - still need to iron out webpack
rosskevin Dec 19, 2017
48276bf
closer to webpack build
rosskevin Dec 19, 2017
cb473d8
babel builds were not including ts,tsx files
rosskevin Dec 19, 2017
0555e8b
update prettier and script and run against all files
rosskevin Dec 19, 2017
42222aa
yarn build:es fails on `import = require` syntax
rosskevin Dec 19, 2017
8f854d1
Prettier issue fixed by changing parser
rosskevin Dec 19, 2017
8b9f76d
build:es works
rosskevin Dec 19, 2017
8ac3661
ts convert colors
rosskevin Dec 19, 2017
2f983d3
refactor types from `index.d.ts` so they are not reentrant.
rosskevin Dec 19, 2017
e34e107
get rid of index.js files
rosskevin Dec 19, 2017
1c042ff
yarn build:umd:dev works
rosskevin Dec 19, 2017
1a5c1ee
yarn build works
rosskevin Dec 19, 2017
c058af3
fix `export const styles` pattern
rosskevin Dec 19, 2017
c1584eb
remove unused ts-loader etc
rosskevin Dec 19, 2017
8617bf6
remove unnecessary :Theme
rosskevin Dec 19, 2017
d940ff1
lint
rosskevin Dec 19, 2017
28d788b
fix flow errors now that flow is not configured
rosskevin Dec 19, 2017
95cebb9
down to 1 test failure
rosskevin Dec 19, 2017
c057c10
back to 5 errors (as was expected)
rosskevin Dec 19, 2017
1b9a7b2
fix remaining debounce imports with workaround
rosskevin Dec 19, 2017
144ecda
Use @babel/register
rosskevin Dec 20, 2017
67d2ed1
change imports to be babel friendly (only)
rosskevin Dec 20, 2017
49bfb44
rename `export const styles` to `export const <Filename>Styles` and u…
rosskevin Dec 20, 2017
3bf50f5
lint - tests start again - 138
rosskevin Dec 20, 2017
aac0ca3
down to 34 errors
rosskevin Dec 20, 2017
6f1108d
and then there were 11
rosskevin Dec 20, 2017
6087bed
down to 10 - use namespace for ReactDOM
rosskevin Dec 20, 2017
d40a15a
11 errors
rosskevin Dec 20, 2017
c71d1d2
fix two Menu tests with nodeType hack from @kgregory
rosskevin Dec 21, 2017
937c47f
all but 1 is working in Menu.spec
rosskevin Dec 21, 2017
e6f3532
add notes about failure
rosskevin Dec 21, 2017
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
  •  
  •  
  •  
47 changes: 23 additions & 24 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"presets": ["./scripts/material-ui-babel-preset-env", "stage-1", "react"],
"presets": [
"@babel/preset-typescript",
"./scripts/material-ui-babel-preset-env",
"@babel/preset-stage-1",
"@babel/preset-react"
],
"plugins": [
"transform-object-assign"
],
Expand All @@ -12,10 +17,7 @@
]
},
"development": {
"sourceMaps": "both",
"plugins": [
"transform-flow-strip-types"
]
"sourceMaps": "both"
},
"docs-development": {
"presets": [
Expand All @@ -29,12 +31,11 @@
"alias": {
"pages": "./pages",
"material-ui": "./src",
"material-ui-icons": './packages/material-ui-icons/src',
"material-ui-icons": "./packages/material-ui-icons/src",
"docs": "./docs"
}
}
],
"transform-flow-strip-types"
]
]
},
"docs-production": {
Expand All @@ -49,37 +50,35 @@
"alias": {
"pages": "./pages",
"material-ui": "./src",
"material-ui-icons": './packages/material-ui-icons/src',
"material-ui-icons": "./packages/material-ui-icons/src",
"docs": "./docs"
}
}
],
"transform-react-constant-elements",
"transform-dev-warning",
"transform-runtime",
"@babel/plugin-transform-react-constant-elements",
// "transform-dev-warning",
"@babel/plugin-transform-runtime",
["react-remove-properties", {"properties": ["data-mui-test"]}],
["transform-react-remove-prop-types", {"mode": "remove"}]
]
},
"test": {
"sourceMaps": "both",
"plugins": [
"transform-flow-strip-types"
]
"sourceMaps": "both"
},
"production": {
"plugins": [
"transform-react-constant-elements",
"transform-dev-warning",
"transform-runtime",
"@babel/plugin-transform-react-constant-elements",
// "transform-dev-warning",
"@babel/plugin-transform-runtime",
["react-remove-properties", {"properties": ["data-mui-test"]}],
["transform-react-remove-prop-types", {
"mode": "wrap",
"plugins": [
"babel-plugin-transform-flow-strip-types"
]
"mode": "wrap"
}]
]
}
}
},
"ignore": [
"scripts/material-ui-babel-preset-env.js"
]
}

89 changes: 89 additions & 0 deletions .babelrc-copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"presets": [
"@babel/preset-typescript",
"./scripts/material-ui-babel-preset-env",
"@babel/preset-stage-1",
"@babel/preset-react"],
"plugins": [
"transform-object-assign"
],
"env": {
"coverage": {
"plugins": [
[
"istanbul"
]
]
},
"development": {
"sourceMaps": "both",
"plugins": [
"transform-flow-strip-types"
]
},
"docs-development": {
"presets": [
"next/babel"
],
"plugins": [
"preval",
[
"module-resolver",
{
"alias": {
"pages": "./pages",
"material-ui": "./src",
"material-ui-icons": './packages/material-ui-icons/src',
"docs": "./docs"
}
}
],
"transform-flow-strip-types"
]
},
"docs-production": {
"presets": [
"next/babel"
],
"plugins": [
"preval",
[
"module-resolver",
{
"alias": {
"pages": "./pages",
"material-ui": "./src",
"material-ui-icons": './packages/material-ui-icons/src',
"docs": "./docs"
}
}
],
"transform-react-constant-elements",
"transform-dev-warning",
"transform-runtime",
["react-remove-properties", {"properties": ["data-mui-test"]}],
["transform-react-remove-prop-types", {"mode": "remove"}]
]
},
"test": {
"sourceMaps": "both",
"plugins": [
"transform-flow-strip-types"
]
},
"production": {
"plugins": [
"transform-react-constant-elements",
"transform-dev-warning",
"transform-runtime",
["react-remove-properties", {"properties": ["data-mui-test"]}],
["transform-react-remove-prop-types", {
"mode": "wrap",
"plugins": [
"babel-plugin-transform-flow-strip-types"
]
}]
]
}
}
}
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ jobs:
- run:
name: Lint
command: yarn lint
- run:
name: Flow
command: yarn flow
- run:
name: TypeScript
command: yarn typescript
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ flow-typed
/packages/material-ui-codemod/src/*/*.spec*
/examples/create-react-app/build
/.git
# we don't have flow configured anymore
/examples/create-react-app-with-flow
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module.exports = {

'babel/object-curly-spacing': ['error', 'always'],

'import/extensions': 'off', // typescript incremental
'import/no-unresolved': 'off', // typescript incremental
'import/unambiguous': 'off', // scripts
'import/namespace': ['error', { allowComputed: true }],
'import/no-extraneous-dependencies': 'off',
Expand Down
50 changes: 0 additions & 50 deletions .flowconfig

This file was deleted.

18 changes: 18 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
node_modules
/build
/tmp
coverage
/.next
/next.config.js
/docs/src/modules/utils/find.js
/docs/export
flow
flow-typed
/packages/*/lib
/packages/material-ui-icons/test/fixtures
/packages/material-ui-icons/src
/packages/material-ui-icons/tpl
/packages/material-ui-icons/build
/packages/material-ui-codemod/src/*/*.spec*
/examples/create-react-app/build
/.git
5 changes: 3 additions & 2 deletions docs/scripts/buildApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ function buildDocs(options) {
name: null,
};

if (component.styles && component.default.options) {
const componentStyles = component[`${path.basename(componentPath)}Styles`];
if (componentStyles && component.default.options) {
// Collect the customization points of the `classes` property.
styles.classes = Object.keys(getStylesCreator(component.styles).create(theme)).filter(
styles.classes = Object.keys(getStylesCreator(componentStyles).create(theme)).filter(
className => !className.match(/^(@media|@keyframes)/),
);
styles.name = component.default.options.name;
Expand Down
10 changes: 5 additions & 5 deletions docs/src/modules/components/withRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ function withRoot(BaseComponent) {
// Prevent rerendering
const PureBaseComponent = pure(BaseComponent);

type WithRootProps = {
reduxServerState?: Object,
sheetsRegistry?: Object,
url: Object,
};
// type WithRootProps = {
// reduxServerState?: Object;
// sheetsRegistry?: Object;
// url: Object;
// };

class WithRoot extends React.Component<WithRootProps> {
static childContextTypes = {
Expand Down
8 changes: 4 additions & 4 deletions docs/src/pages/style/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const styles = {
},
};

type ProvidedProps = {
classes: Object,
theme?: Object,
};
// type ProvidedProps = {
// classes: Object,
// theme?: Object,
// };

function Icons(props: ProvidedProps) {
return (
Expand Down
1 change: 0 additions & 1 deletion flow/interfaces/preval.js

This file was deleted.

1 change: 0 additions & 1 deletion flow/interfaces/webpack.js

This file was deleted.

1 change: 0 additions & 1 deletion flow/stubs/url-loader.js

This file was deleted.

Loading