Installation
npm i iced-react-loader
Usage
// webpack.config.jsmoduleexports = loaders: test: /.iced$/ loader: "icedReactLoader" ;
Iced-React
This loader will allow you to use a twice pre compiled dialect of CoffeeScript. The first compilation step parses any JSX syntax in a CoffeeScript file and produces a CoffeeScript equivilant of standard React vanilla JS code. For example,
= <div> propschildren </div>
becomes
= ReactcreateElement"div"null propschildren
The next compilation step is to take the CoffeeScript code and feed it to IcedCoffeeScript, which in the last example would produce:
{ var App; { return React; }; };
IcedCoffeeScript allows the source code to contain await and defer statements, such as:
= component = await apicall 'users'defer users for user in users componentpush <div>username</div> jsxconcat component await longUiProcess <div className='root'></div>defer component
becomes:
{ var iced longUiProcess __iced_k __iced_k_noop; iced = ; __iced_k = {}; { var component user users ___iced_passed_deferral __iced_deferrals __iced_k; __iced_k = __iced_k_noop; ___iced_passed_deferral = iced; component = ; { return { __iced_deferrals = __iced_k parent: ___iced_passed_deferral ; api; __iced_deferrals; }; }this { return { var _i _len; for _i = 0 _len = userslength; _i < _len; _i++ user = users_i; component; jsx; __iced_deferrals = __iced_k parent: ___iced_passed_deferral ; ; __iced_deferrals; }; }this; }; };