Front-end Infrastructure Basics Flashcards

1
Q

What is a “module bundler”?

A

A module bundler will parse through our code, mapping out dependencies as it comes across them, to bundle our application together in a way that the browser can understand, while still allowing developers to maintain modularity and separation in the codebase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Give examples of popular “module bundlers” tools

A
  • Webpack

- Browserify

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a “module loader”?

A

A module loader interprets and loads a module written in a certain module format.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the steps a module loader usually performs when you load it in your browser?

A
  1. you load the module loader in the browser
  2. you tell the module loader which main app file to load
  3. the module loader downloads and interprets the main app file
  4. the module loader downloads files as needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is “CommonJS”?

A
It is a specification for a module loading API in Javascript. 
Node.js implements that specification for module loading.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which specification does Node.js follows for module loading?

A

CommonJS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you import a class “Foo” from foo.js file using CommonJS?

A

const Foo = require(“./foo.js”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you export a class “Foo” from module foo.js file using CommonJS?

A

In foo.js:

module.exports = class Foo { … }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you import a class “Foo” from foo.js file using ES6 native module spec?

A

import { Foo } from ‘./foo’

import { Foo as FooRenamed} from ‘./foo’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you export a class “Foo” from module foo.js file using ES6 native module spec?

A

export class Foo {…}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are linters?

A

linters allow developers to set rules for how code should be written within the scope of their application, and will throw errors or warnings when those rules/guidelines aren’t being followed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a “polyfill”?

A

Polyfill is a code that implements a feature on web browsers that do not support the feature. It is a “shim” for web browsers APIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a “shim”?

A

shim is a small library that transparently intercepts API calls and changes the arguments passed, handles the operation itself, or redirects the operation elsewhere.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Where will “npm install “ install the module?

A

In the current directory ./node_modules directory. It will recursively download transitive dependencies in its “node_modules” directories as well.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are well-know CSS frameworks?

A
  • Bootstrap 4.0
  • Bulma
  • Materialize (Material Design in React)
  • Skeleton (very raw CSS framework)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is “Yarn”?

A

It is a “npm” alternative built by Facebook.

17
Q

What is the package.json file in the root of an web application?

A

It is npm’s config file. Similar to Maven’s pom.xml.

18
Q

How does JS arrow function notation deals with this?

A

Arrow function does not define its own this as creating a function with “function” keyword. It will always use the enclosing context this.

19
Q

What is node-uuid library?

A

A library that generates universally unique identifier (UUID or GUID). Which has 128-bit size.

20
Q

What is Lodash throttle() function?

A

It is a function that wraps another function and limit the calls to the wrapped function once per the time slot provided.

throttle(myFunc, 1000) // only calls myFunc once every 1000ms

21
Q

What are the following files used for in a web app?

A

They are the Web App Manifest and are used to define the behavior and looks of the icon when a user adds a shortcut to the home screen.

22
Q

What is Font Awesome?

A

A library of pictographic icons

23
Q

What is “jasmine” for?

A

It is a BDD library, that provides functions for structuring test cases and doing asserts.

24
Q

What is “jest” for?

A

It is a test runner that integrates easily with React. Comes already bundled if you use create-react-app script.