globalizejs / globalizejs/globalize
Create a development and a production build
- Dominant language
- JavaScript
- Stars
- 4.8k
- Forks
- 585
- PR merge metrics
- No merged PRs in 30d
Description
There are a lot of checks all over the place for example :
```javascript
validateParameterPresence( unit, "unit" );
validateParameterTypeString( unit, "unit" );
```
Are they useful in production ?
In the source code of React, there are a lot of checks but they are enabled only in development mode :
For example : https://github.com/facebook/react/blob/master/packages/react-dom/src/client/ReactDOM.js#L1053-L1055
And they change this variable when building : https://github.com/facebook/react/blob/master/scripts/rollup/build.js#L234
They even have babel plugins to automatically wrap some functions with this `if (__DEV__) {}` condition : https://github.com/facebook/react/blob/master/scripts/rollup/build.js#L88-L91
This could have two advantages :
* The size of the final bundle would be smaller
* The performance would be better by not running those checks
Is it possible to have something similar in Globalize ?
If yes, I'm willing to do a POC Pull Request
__Edit :__
I know there is a runtime version already, but not everybody can use the production generator to be able to use only the Globalize Runtime, Anyway, these changes would also benefit the runtime version
Contributor guide
Assessment
This issue has not been assessed yet.