Skip to content

Commit 47978d9

Browse files
Version Packages (#197)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1ec5f76 commit 47978d9

File tree

3 files changed

+61
-56
lines changed

3 files changed

+61
-56
lines changed

.changeset/seven-rats-taste.md

Lines changed: 0 additions & 55 deletions
This file was deleted.

packages/extract-react-types-loader/CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
# extract-react-types-loader
22

3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- [`1ec5f76`](https://github.com/atlassian/extract-react-types/commit/1ec5f76c5e99ce78e952a83eac178fcc22e5f557) [#196](https://github.com/atlassian/extract-react-types/pull/196) Thanks [@marionebl](https://github.com/marionebl)! - Remove Atlaskit specific process.env switches (#195)
8+
9+
BREAKING CHANGE
10+
This removes the previously available process.env switches to conditionally disable the loader.
11+
To restore the previous behaviour you'll have to use the `resolveLoader` webpack config, e.g.
12+
13+
```js
14+
// webpack.config.js
15+
const enabled =
16+
['production', 'staging'].includes(process.env.WEBSITE_ENV) ||
17+
process.env.FORCE_EXTRACT_REACT_TYPES;
18+
19+
module.exports = {
20+
/* ... */
21+
resolveLoader: {
22+
alias: {
23+
'extract-react-types-loader': enabled
24+
? undefined
25+
: require.resolve('./noop-extract-react-types-loader')
26+
}
27+
}
28+
};
29+
```
30+
31+
```js
32+
// noop-extract-react-types-loader.js
33+
module.exports = function noopExtractReactPropTypesLoader() {
34+
return `module.exports = {
35+
component: {
36+
kind: 'object',
37+
members: [
38+
{
39+
kind: 'property',
40+
key: { kind: 'id', name: 'Warning' },
41+
value: { kind: 'any' },
42+
optional: false,
43+
leadingComments: [
44+
{
45+
type: 'commentBlock',
46+
value: `extract-react-types is not being run in dev mode for speed reasons. If you need to
47+
see prop types add the environment variable \`FORCE_EXTRACT_REACT_TYPES\`
48+
raw: '**'
49+
}
50+
],
51+
default: {
52+
kind: 'string',
53+
value: 'Prop types are not shown in dev mode'
54+
}
55+
}
56+
],
57+
referenceIdName: 'NoopPropTpes'
58+
}
59+
};`
60+
}
61+
```
62+
363
## 0.3.17
464

565
### Patch Changes

packages/extract-react-types-loader/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extract-react-types-loader",
3-
"version": "0.3.17",
3+
"version": "1.0.0",
44
"main": "index.js",
55
"repository": "atlassian/extract-react-types",
66
"description": "Load extract-react-types data given a fiile path, using webpack",

0 commit comments

Comments
 (0)