babel vs babel-core vs babel-loader vs babel-preset-2015 vs babel-preset-react vs babel-polyfill

babel Babel doesn’t do anything,It basically acts like const babel = code => code; by parsing the code and then generating the same code back out again. You will need to add some plugins for Babel to do anything like transpiling es6,JSX. babel-core if you want to use babel in your real project, you need … Read more

Vue JS 2.0 not rendering anything?

Just to make life easier for folks looking for the answer: import Vue from ‘vue/dist/vue.js’ import App from ‘./App.vue’ new Vue({ el: ‘#app’, render: h => h(App) }) From the author — 2.0 standalone build means (compiler + runtime). The default export of the NPM package will be runtime only, because if installing from NPM, … Read more

Decorators on functions

To execute a decorator, you evaluate an expression and doing that prevents hoisting (even for a variable declaration, the right-hand side of an assignment stays put). Therefore, it is not compatible with function declarations being hoisted. As a work-around, I suggested that function expressions, generator function expressions and arrow functions could be enabled to be … Read more

Code inside DOMContentLoaded event not working

It’s most likely because the DOMContentLoaded event was already fired at this point. The best practice in general is to check for document.readyState to determine whether or not you need to listen for that event at all. if (document.readyState !== ‘loading’) { console.log(‘document is already ready, just execute code here’); myInitCode(); } else { document.addEventListener(‘DOMContentLoaded’, … Read more

babel vs babel-core vs babel-runtime

babel-core is the API. For v5 the babel package is the CLI and depends on babel-core. For v6, the babel-cli package is the CLI (the CLI bin command is still babel though) and the babel package doesn’t do anything. babel-runtime I guess is just the runtime (polyfill and helpers) to support code that’s already been … Read more

Why does Object.assign() require a polyfill when babel-loader is being used?

Babel, via babel-loader, transpiles differences in ES6 syntax. Babel on its own does absolutely nothing to add in ES6 standard library functionality (like Object.assign). Loading the polyfill loads a separate polyfill core-js for you, but you can load any polyfill you want. Even some syntax conversions rely on specific polyfill functionality to be loads, since … Read more

Is there a way to render multiple React components in the React.render() function?

Since the React v16.0 release you can render an array of components without wrapping items in an extra element when you are inside a component: render() { return [ <li key=”one”>First item</li>, <li key=”two”>Second item</li>, <li key=”three”>Third item</li>, <li key=”four”>Fourth item</li>, ]; } Remember only to set the keys. UPDATE Now from the 16.2 version … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)