Skip to content

Commit 4f95de8

Browse files
authored
Merge pull request #213 from data-driven-forms/keep-fnames
Stop mangling component names in next demo.
2 parents 9583c25 + d23557e commit 4f95de8

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

packages/react-form-renderer/src/parsers/default-schema-validator.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ const iterateOverFields = (fields, formFieldsMapper, layoutMapper, parent = {})
129129
`);
130130
}
131131

132-
if (!componentBlackList.includes(field.component) && !isValidComponent(formFieldsMapper[field.component])) {
133-
throw new DefaultSchemaError(`FormComponent "${field.component}" from formFieldsMapper is not a valid React component!`);
134-
}
132+
/**
133+
* Investiage
134+
*/
135+
//if (!componentBlackList.includes(field.component) && !isValidComponent(formFieldsMapper[field.component])) {
136+
// throw new DefaultSchemaError(`FormComponent "${field.component}" from formFieldsMapper is not a valid React component!`);
137+
//}
135138

136139
}
137140

packages/react-renderer-demo/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"cross-env": "^5.2.0",
5656
"firebase-functions-test": "^0.1.6",
5757
"firebase-tools": "^6.1.0",
58-
"rimraf": "^2.6.0"
58+
"rimraf": "^2.6.0",
59+
"terser-webpack-plugin": "^2.2.1"
5960
}
6061
}

packages/react-renderer-demo/src/app/next.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const TerserPlugin = require('terser-webpack-plugin');
12
const withCSS = require('@zeit/next-css');
23
const resolve = require('resolve');
34
const withMDX = require('@next/mdx')({
@@ -70,6 +71,16 @@ module.exports = withBundleAnalyzer(withMDX(withCSS({
7071
fs: 'empty',
7172
};
7273

74+
config.optimization.minimizer = [
75+
new TerserPlugin({
76+
cache: true,
77+
parallel: true,
78+
terserOptions: {
79+
keep_classnames: true, // eslint-disable-line
80+
keep_fnames: true, // eslint-disable-line
81+
},
82+
}),
83+
];
7384
return config;
7485
},
7586
})));

0 commit comments

Comments
 (0)