Mordern Web Flashcards
What is Webpack?
webpack is an open-source JavaScript module bundler. It is made primarily for JavaScript, but it can transform front-end assets such as HTML, CSS, and images if the corresponding loaders are included.
How do you add a devDependency to a package?
npm instal –save-dev webpack
What is an NPM script?
it’s a script to install dependency
How do you execute Webpack with npm run?
npm run build
What is React?
React is a JavaScript library for creating user interfaces.
React is a free and open-source front-end JavaScript library for building user interfaces or UI components.
What is a React element?
its an object
A React Element is what gets returned from components. It’s an object that virtually describes the DOM nodes that a component represents. With a function component, this element is the object that the function returns.
How do you mount a React element to the DOM?
ReactDOM.render(reactElement, domContainerNode)
What is Babel?
Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments
What is a Plug-in?
plug-in (or plugin, add-in, addin, add-on, or addon) is a software component that adds a specific feature to an existing computer program.
What is a Webpack loader?
Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or “load” them. Thus, loaders are kind of like “tasks” in other build tools and provide a powerful way to handle front-end build steps. Loaders can transform files from a different language (like TypeScript) to JavaScript or load inline images as data URLs. Loaders even allow you to do things like import CSS files directly from your JavaScript modules!
How can you make Babel and Webpack work together?
babel-loader
npm install -D babel-loader @babel/core @babel/preset-env webpack
What is JSX?
it is a syntax extension to JavaScript
Why must the React object be imported when authoring JSX in a module?
import react to compile the component
How can you make Webpack and Babel work together to convert JSX into valid JavaScript?
webpack and babel-loader
What is a React component?
components are like JavaScript functions. They accept arbitrary inputs (called “props”) and return React elements describing what should appear on the screen.