Skip to content

Commit 4135e72

Browse files
committed
Squashed commit of the following:
commit 2035e6daa1ceba1c78d3e8740af8d5f3066bc898 Author: Sebastian Silbermann <[email protected]> Date: Mon Nov 5 10:16:31 2018 +0100 [docs] Fix undefined raw js commit 9ab3761e49d8682530543f1e6808d46cd955f32a Author: Sebastian Silbermann <[email protected]> Date: Mon Nov 5 10:07:38 2018 +0100 [docs] Enable textfield ts demos commit 8271f5cff4b3f6fe31b564a3f98ed69d8c09f3d6 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 30 11:58:29 2018 +0100 [docs] Port #13428 to typescript commit 8b808886235a3690b01335a5d3a6132209b87483 Author: Sebastian Silbermann <[email protected]> Date: Fri Oct 26 17:55:02 2018 +0200 [docs] Add typescript demos for TextField Takeaway: - inputProps, inputComponent is badly typed (needs generics though) - computed property keys support is bad in typescript commit 5ab9c988d259cd039e5b2735a47c1c89c9761eec Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 23 13:36:56 2018 +0200 [docs] Use esModuleInterop import conistently commit c9bca0824c0f81fe114f8976bc10464de94306b2 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 23 13:35:32 2018 +0200 [docs] Fix IE 11 compat issues commit b4dd772ee990dd0f9a042a8721aa7a665ded7fce Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 23 13:33:44 2018 +0200 [docs] Remove dead code commit f0a23cffb7a8e2c4faf5c2b4182919efb74d4bdd Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 23 08:21:07 2018 +0200 [ci] Fix job order Running git diff after yarn build will exit with 1 because the size snapshot was updated. commit 114022bd6d1ac98af330f6e7b57ba03062d120ff Author: Sebastian Silbermann <[email protected]> Date: Mon Oct 22 21:32:54 2018 +0200 [docs] Disabled stackblitz for TS demos commit 7995d67cd09f08541f388124d535452054518d75 Author: Sebastian Silbermann <[email protected]> Date: Mon Oct 22 17:47:14 2018 +0200 [docs] Add guide about ts demos commit 0c65724f14c4de21ced8ce4e8ff91b2edce3b6d5 Author: Sebastian Silbermann <[email protected]> Date: Mon Oct 22 17:09:39 2018 +0200 [docs] Sync demo changes from 06967ec commit 7a0861d855d15bf281fde271e0028d0b1ba9dbb1 Author: Sebastian Silbermann <[email protected]> Date: Mon Oct 22 15:35:03 2018 +0200 [docs] Allow require default interop for ts demos Seems like codesandbox still has issues with this. Gonna investigate if we can fix this upstream commit c8a143e20735be14f692477fab40cd3d4a3040df Author: Sebastian Silbermann <[email protected]> Date: Mon Oct 22 15:34:10 2018 +0200 [docs] Support types for scoped packages commit 48a425d19a53e77fa97692980e364f503491a91b Author: Sebastian Silbermann <[email protected]> Date: Sat Oct 20 18:02:05 2018 +0200 [babel-plugin-unwrap-createStyles] Fix fixtures being transpiled with workspace config commit 03c1ac9d7575c9dc79e8253578dda60f39e33375 Author: Sebastian Silbermann <[email protected]> Date: Fri Oct 19 12:21:59 2018 +0200 [docs] Create ts specific codesandbox - needs babel plugin for synthetic default imports commit cdc393185a823bb684ff34be23f20d4897db8962 Author: Sebastian Silbermann <[email protected]> Date: Thu Oct 18 18:39:40 2018 +0200 [docs] Fire analytics event when clicking codeLanguage commit 6865f6488c27c1353cae108410d94a165343414b Author: Sebastian Silbermann <[email protected]> Date: Thu Oct 18 18:15:05 2018 +0200 [docs] Add ts version for all app bar demos - Fixes menu not closing in PrimarySearchAppBar - removes some dead code from undefined classnames commit a189a173a371e785916b8797283798e45d4743d8 Author: Sebastian Silbermann <[email protected]> Date: Thu Oct 18 17:12:44 2018 +0200 [ci] Check compiled ts demos are equal to js demos commit 95706fdaaa1b6a56da239250b515a36459c87b8b Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 20:51:02 2018 +0200 [docs] Remove debug config commit a90c76a322104787837c1646fc400e84cdc77e6c Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 20:48:56 2018 +0200 [docs] github link and copy code depending on selected code language commit fafa284f397e66b0075a29823debc1c8dbd6b1fb Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 18:14:49 2018 +0200 [docs] Add feature flag for language switch Enabled on a per-component basis. commit 9ef68446d7e42347d30fc796d34f23f15eaf4405 Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 18:10:20 2018 +0200 [docs] Add the ability to mark ts demos as outdated This should be used in-sync with ignored demos in transpilation. commit a7033f203278d6e462a016190790a3609aabded5 Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 17:18:10 2018 +0200 [docs] Add the ability to ignore ts demos from transpilation This can be useful to defer syncing them upwards from js. commit e7c19cb1f264bf9ec9b6884650b4e3ad8e6942f8 Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 16:22:36 2018 +0200 Fix formatting errors commit ea9a6de935394d0c61eff974a8575165ae0ed1aa Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 10:33:23 2018 +0200 [docs] Disable ts switch if not ts version is available commit 5a58595c26108e8ccd18eacf3b16ae2ed40de0a5 Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 09:19:53 2018 +0200 [docs] Remove global code language switch Revisit this if we reach critical mass on ts docs commit aecb12fdf96aa761e543ba284d55ffd11a7970f1 Author: Sebastian Silbermann <[email protected]> Date: Wed Oct 17 09:15:52 2018 +0200 [docs] Improve code language switch commit 0a587ec8b0f97dfc05352856f7dec1c081e5275e Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 23:37:40 2018 +0200 Fix CI errors commit 82921d138f21272cef11c040ea7a578584563120 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 23:20:36 2018 +0200 [docs] Add local language switch and add language logos - color needs rework: it looks a little bit out of place, bad contrast commit 49861e54f5b5d2e54cac672c4f5a3377731e6255 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 20:45:25 2018 +0200 [docs] Language switch via redux It's pretty slow at the app level. While it is nice to have ts permanently enabled while browsing docs a switch at demo level might be better suited. commit 6a06a060ad17f44dab0d1cc49996455b37f8a2fc Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 19:14:55 2018 +0200 [docs] Another whitespace fix attempt commit fffed851504e587f2abadd6353318eaab9791fdb Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 18:46:46 2018 +0200 [docs] revert to function declaration propTypes in typescript are to strict commit ccb62823cbbacb5da109eb5275277a4ebf797533 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 18:32:38 2018 +0200 [core] Bump @types/react commit d3ac480d1966485b1c3d22672797110c26a82ef5 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 18:25:06 2018 +0200 [babel-plugin-unwrap-createStyles] Fix lint errors commit 1998640e939bfb57e27c265c2e338ef6707bae5a Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 18:21:45 2018 +0200 [docs] Remove diff in trailing whitespace commit 912c2a8d060ff3de9a70eaefa62c011f2bdbc90d Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 18:20:13 2018 +0200 [docs] Write formatted js from ts demos commit 4dcd51f50252823ee5f40dd9e53bfd6821786d5f Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 17:28:08 2018 +0200 [core] Sync tslint with eslint concerning trailing-whitespace commit 05f3f3d78e333ed740f447a2e20724cc1624c363 Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 13:59:47 2018 +0200 [core] docuent babel-plugin vs. ts-transformer commit 691a036456486b4cea411d435392746ad714817d Author: Sebastian Silbermann <[email protected]> Date: Tue Oct 16 11:03:08 2018 +0200 [docs] Add babel plugin to unwrap createStyles calls This essentially strips them from the bundle commit a02ffd64a1defb4298030fd2d162c4a71c65b09a Author: Sebastian Silbermann <[email protected]> Date: Sat Oct 13 16:02:11 2018 +0200 Move ts files next to js files commit 32a301a8eb2d0ed5e3b902313d5895dabcfbca32 Author: Sebastian Silbermann <[email protected]> Date: Sat Oct 13 14:35:14 2018 +0200 Working example without type checking and bad folder structure
1 parent c1db388 commit 4135e72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3437
-71
lines changed

.circleci/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ jobs:
181181
- *restore_yarn_offline_mirror
182182
- *restore_yarn_cache
183183
- *install_js
184+
- run:
185+
name: Transpile TypeScript demos
186+
command: yarn docs:typescript
187+
- run:
188+
name: Are the compiled TypeScript demos equivalent to the JavaScript demos?
189+
command: git diff --exit-code
184190
- run:
185191
name: Can we generate the material-ui build?
186192
command: cd packages/material-ui && yarn build

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/examples/gatsby/public
99
/flow
1010
/flow-typed
11+
/packages/babel-plugin-unwrap-createStyles/test/__fixtures__/
1112
/packages/material-ui-codemod/lib
1213
/packages/material-ui-codemod/src/*/*.test
1314
/packages/material-ui-codemod/src/*/*.test.js

.size-limit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = [
2828
name: 'The main docs bundle',
2929
webpack: false,
3030
path: main.path,
31-
limit: '184 KB',
31+
limit: '188.1 KB',
3232
},
3333
{
3434
name: 'The docs home page',

CONTRIBUTING.md

+38-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ We will only accept a pull request for which all tests pass. Make sure the follo
4040
- If API documentation is being changed in the source, `yarn docs:api` was run.
4141
- If prop types were changed, the TypeScript declarations were updated.
4242
- If TypeScript declarations were changed, `yarn typescript` passed.
43+
- If demos were changed, make sure `yarn docs:typescript` does not introduce changes.
44+
See [About TypeScript demos](#about-typescript-demos).
4345
- The PR title follows the pattern `[Component] Imperative commit message`. (See: [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/#imperative) for a great explanation)
4446

4547
## Getting started
@@ -70,6 +72,8 @@ yarn
7072
yarn docs:dev
7173
```
7274
You can now access the documentation site [locally](http://localhost:3000).
75+
Changes to the docs will hot reload the site. If you make changes to TypeScript files
76+
in the docs run `yarn docs:typescript --watch` in a separate terminal.
7377

7478
Test coverage is limited at present, but where possible, please add tests for any changes you make. Tests can be run with `yarn test`.
7579

@@ -108,6 +112,14 @@ docs/src/pages/demos/buttons/
108112
```
109113
And let's give it a name: `SuperButtons.js`.
110114

115+
We try to also document how to use this library with TypeScript. If you are familiar with
116+
that language try writing that demo in TypeScript in a *.tsx file. When you're done
117+
run `yarn docs:typescript` to automatically add a JavaScript version.
118+
119+
Apart from the inherent pros and cons of TypeScript the demos are also used to test our
120+
type declarations. This helps alot in catching regressions when updating our type
121+
declarations.
122+
111123
#### 2. Edit the page Markdown file.
112124

113125
The Markdown file is the source for the website documentation. So, whatever you wrote there will be reflected on the website.
@@ -141,10 +153,35 @@ Then, you will need to add the following code:
141153
+ },
142154
```
143155

144-
#### 4. You are done 🎉!
156+
If the demo has a version in TypeScript add
157+
```diff
158+
+ rawTS: preval`
159+
+ module.exports = require('fs')
160+
+ .readFileSync(require.resolve('docs/src/pages/demos/buttons/SuperButtons.tsx'), 'utf8')
161+
+`,
162+
```
145163

164+
#### 4. You are done 🎉!
146165
In case you missed something, [we have a real example that can be used as a summary report]((https://github.com/mui-org/material-ui/pull/8922/files)).
147166

167+
168+
### About TypeScript demos
169+
To help people use this library with TypeScript we try to provide equivalent demos
170+
in TypeScript.
171+
172+
Changing demos in JavaScript requires a manual update of the TypeScript
173+
version. If you are not familiar with this language you can set the `outdatedTS`
174+
flag for a given demo in the corresponding demo entry e.g. `pages/demos/button.js` in the
175+
`demo` prop of the `MarkdownDocs` component. Otherwise our CI will fail on `test_build`
176+
on the `Transpile TypeScript demos` task. A contributor can later update the TypeScript
177+
version of that demo.
178+
179+
If you are already familiar with TypeScript you can simply write the demo in TypeScript.
180+
`yarn docs:typescript` will transpile it down to JavaScript.
181+
182+
If you add a TypeScript version of a demo make sure that the `enableCodeLanguageSwitch`
183+
prop on the `MarkdownDocs` is set so that this version is visible in the docs.
184+
148185
## How do I use my local distribution of material-ui in any project?
149186

150187
Sometimes it is good to test your changes in a real world scenario, in order to do that you can install your local distribution of Material-UI in any project with [yarn link](https://yarnpkg.com/lang/en/docs/cli/link/).

docs/babel.config.ts.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path');
2+
const prettier = require('prettier');
3+
const ignoredDemos = require('./ts-demo-ignore.json');
4+
5+
/**
6+
* babel config to transpile tsx demos to js
7+
*
8+
* Can be used to spot differences between ts and js demos which might indicate that they
9+
* do different things at runtime.
10+
*
11+
* Demos listed in ts-demo-ignore are not transpiled. Their path should be relative
12+
* to `${workspaceRoot}/docs/src/pages/demos`.
13+
*/
14+
15+
const workspaceRoot = path.join(__dirname, '../');
16+
const prettierConfig = prettier.resolveConfig.sync(workspaceRoot);
17+
if (prettierConfig == null) {
18+
throw new Error('Could not find prettier config file from workspace root.');
19+
}
20+
21+
const ignore = ignoredDemos.map(demoPath =>
22+
path.join(workspaceRoot, 'docs/src/pages/demos', `${demoPath}.tsx`),
23+
);
24+
25+
module.exports = {
26+
presets: ['@babel/preset-typescript'],
27+
plugins: ['generator-prettier', 'unwrap-createStyles'],
28+
generatorOpts: prettierConfig,
29+
ignore,
30+
};

docs/src/modules/components/Demo.js

+99-42
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ import MenuItem from '@material-ui/core/MenuItem';
1313
import MoreVertIcon from '@material-ui/icons/MoreVert';
1414
import Tooltip from '@material-ui/core/Tooltip';
1515
import Github from '@material-ui/docs/svgIcons/GitHub';
16+
import JSLogo from '@material-ui/docs/svgIcons/JSLogo';
17+
import TSLogo from '@material-ui/docs/svgIcons/TSLogo';
1618
import MarkdownElement from '@material-ui/docs/MarkdownElement';
17-
import { getDependencies } from 'docs/src/modules/utils/helpers';
1819
import DemoFrame from 'docs/src/modules/components/DemoFrame';
20+
import getDemo from 'docs/src/modules/utils/demoConfig';
21+
import TSCodeBadge from 'docs/src/modules/components/TSCodeBadge';
1922

2023
function compress(object) {
2124
return LZString.compressToBase64(JSON.stringify(object))
@@ -32,31 +35,6 @@ function addHiddenInput(form, name, value) {
3235
form.appendChild(input);
3336
}
3437

35-
function getDemo(props) {
36-
return {
37-
title: 'Material demo',
38-
description: props.githubLocation,
39-
dependencies: getDependencies(props.raw),
40-
files: {
41-
'demo.js': props.raw,
42-
'index.js': `
43-
import React from 'react';
44-
import ReactDOM from 'react-dom';
45-
import Demo from './demo';
46-
47-
ReactDOM.render(<Demo />, document.querySelector('#root'));
48-
`,
49-
'index.html': `
50-
<body>
51-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
52-
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
53-
<div id="root"></div>
54-
</body>
55-
`,
56-
},
57-
};
58-
}
59-
6038
const styles = theme => ({
6139
root: {
6240
position: 'relative',
@@ -106,6 +84,7 @@ const styles = theme => ({
10684
margin: 0,
10785
[theme.breakpoints.up('sm')]: {
10886
display: 'block',
87+
paddingTop: theme.spacing.unit * 6,
10988
},
11089
'& pre': {
11190
overflow: 'auto',
@@ -118,9 +97,18 @@ const styles = theme => ({
11897
class Demo extends React.Component {
11998
state = {
12099
anchorEl: null,
100+
codeLanguage: 'JS',
121101
codeOpen: false,
122102
};
123103

104+
getTSTooltip() {
105+
if (this.hasTSVersion()) {
106+
const { outdatedTS } = this.props;
107+
return `Source in TypeScript${outdatedTS ? ' (outdated)' : ''}`;
108+
}
109+
return 'No code in TypeScript available';
110+
}
111+
124112
handleClickMore = event => {
125113
this.setState({ anchorEl: event.currentTarget });
126114
};
@@ -136,25 +124,23 @@ class Demo extends React.Component {
136124
};
137125

138126
handleClickCodeSandbox = () => {
139-
const demo = getDemo(this.props);
127+
const { codeLanguage } = this.state;
128+
const demo = getDemo(this.props, codeLanguage);
140129
const parameters = compress({
141130
files: {
142131
'package.json': {
143132
content: {
144133
title: demo.title,
145134
description: demo.description,
146135
dependencies: demo.dependencies,
136+
devDependencies: demo.devDependencies,
137+
main: `index.${codeLanguage === 'TS' ? 'tsx' : 'js'}`,
147138
},
148139
},
149-
'demo.js': {
150-
content: demo.files['demo.js'],
151-
},
152-
'index.js': {
153-
content: demo.files['index.js'],
154-
},
155-
'index.html': {
156-
content: demo.files['index.html'],
157-
},
140+
...Object.keys(demo.files).reduce((files, name) => {
141+
files[name] = { content: demo.files[name] };
142+
return files;
143+
}, {}),
158144
},
159145
});
160146

@@ -169,15 +155,21 @@ class Demo extends React.Component {
169155
};
170156

171157
handleClickCopy = async () => {
158+
const { raw: rawJS, rawTS } = this.props;
159+
const { codeLanguage } = this.state;
160+
161+
const raw = codeLanguage === 'TS' ? rawTS : rawJS;
162+
172163
try {
173-
await copy(this.props.raw);
164+
await copy(raw);
174165
} finally {
175166
this.handleCloseMore();
176167
}
177168
};
178169

179170
handleClickStackBlitz = () => {
180-
const demo = getDemo(this.props);
171+
const { codeLanguage } = this.state;
172+
const demo = getDemo(this.props, codeLanguage);
181173
const form = document.createElement('form');
182174
form.method = 'POST';
183175
form.target = '_blank';
@@ -186,6 +178,7 @@ class Demo extends React.Component {
186178
addHiddenInput(form, 'project[title]', demo.title);
187179
addHiddenInput(form, 'project[description]', demo.description);
188180
addHiddenInput(form, 'project[dependencies]', JSON.stringify(demo.dependencies));
181+
addHiddenInput(form, 'project[devDependencies]', JSON.stringify(demo.devDependencies));
189182
Object.keys(demo.files).forEach(key => {
190183
const value = demo.files[key];
191184
addHiddenInput(form, `project[files][${key}]`, value);
@@ -196,16 +189,76 @@ class Demo extends React.Component {
196189
this.handleCloseMore();
197190
};
198191

192+
handleCodeLanguageClick = event => {
193+
const { name } = this.props;
194+
const { value: codeLanguage } = event.currentTarget;
195+
const { ga = () => {} } = window;
196+
197+
ga('send', 'event', 'Demo', 'codeLanguageClick', name, codeLanguage);
198+
this.setState({
199+
codeLanguage,
200+
codeOpen: true,
201+
});
202+
};
203+
204+
hasTSVersion() {
205+
return Boolean(this.props.rawTS);
206+
}
207+
199208
render() {
200-
const { classes, demoOptions, githubLocation, index, js: DemoComponent, raw } = this.props;
201-
const { anchorEl, codeOpen } = this.state;
209+
const {
210+
classes,
211+
demoOptions,
212+
enableCodeLanguageSwitch,
213+
githubLocation: githubLocationJS,
214+
index,
215+
js: DemoComponent,
216+
outdatedTS,
217+
rawJS,
218+
rawTS,
219+
} = this.props;
220+
const { anchorEl, codeLanguage, codeOpen } = this.state;
202221
const category = demoOptions.demo;
203222

223+
const hasTSVersion = this.hasTSVersion();
224+
const tsTooltip = this.getTSTooltip();
225+
226+
const githubLocation =
227+
codeLanguage === 'TS' ? githubLocationJS.replace(/\.jsx?$/, '.tsx') : githubLocationJS;
228+
const raw = codeLanguage === 'TS' && hasTSVersion ? rawTS : rawJS;
229+
204230
return (
205231
<div className={classes.root}>
206232
{demoOptions.hideHeader ? null : (
207233
<div>
208234
<div className={classes.header}>
235+
{enableCodeLanguageSwitch && (
236+
<>
237+
<Tooltip title="Display source in JavaScript" placement="top">
238+
<IconButton
239+
aria-label="Display source in JavaScript"
240+
onClick={this.handleCodeLanguageClick}
241+
value="JS"
242+
>
243+
<JSLogo />
244+
</IconButton>
245+
</Tooltip>
246+
<Tooltip title={tsTooltip} placement="top">
247+
<span>
248+
<IconButton
249+
aria-label={tsTooltip}
250+
disabled={!hasTSVersion}
251+
onClick={this.handleCodeLanguageClick}
252+
value="TS"
253+
>
254+
<TSCodeBadge outdatedTS={outdatedTS}>
255+
<TSLogo color={hasTSVersion ? 'official' : 'inherit'} />
256+
</TSCodeBadge>
257+
</IconButton>
258+
</span>
259+
</Tooltip>
260+
</>
261+
)}
209262
<Tooltip title="See the source on GitHub" placement="top">
210263
<IconButton
211264
ga-event-category={category}
@@ -275,7 +328,7 @@ class Demo extends React.Component {
275328
ga-event-action="stackblitz"
276329
onClick={this.handleClickStackBlitz}
277330
>
278-
Edit in StackBlitz
331+
Edit in StackBlitz (JS only)
279332
</MenuItem>
280333
)}
281334
</Menu>
@@ -310,10 +363,14 @@ class Demo extends React.Component {
310363
Demo.propTypes = {
311364
classes: PropTypes.object.isRequired,
312365
demoOptions: PropTypes.object.isRequired,
366+
enableCodeLanguageSwitch: PropTypes.bool,
313367
githubLocation: PropTypes.string.isRequired,
314368
index: PropTypes.number.isRequired,
315369
js: PropTypes.func.isRequired,
316-
raw: PropTypes.string.isRequired,
370+
name: PropTypes.string.isRequired,
371+
outdatedTS: PropTypes.bool,
372+
rawJS: PropTypes.string.isRequired,
373+
rawTS: PropTypes.string,
317374
};
318375

319376
export default withStyles(styles)(Demo);

0 commit comments

Comments
 (0)