JavaScript environment from plurasight course
make sure you installed node
used express to serve the project locally (npm install express) to run node (node buildScript.srcServer.js)
install nsp in order to check for security vulnerability (npm install -g nsp) to check for security vulnerability (nsp check)
to install localtunnel globally (npm install localtunnel -g) to run localtunnel (lt -h "https://serverless.social" -p PORT) eg (lt -h "https://serverless.social" -p 3000) NOTE: the address keeps changind everytime you run the command
you can you grunt, gulp or npm Scripts
configured under a grunt file uses plugins writes intermediary files between steps
improves on gulp in-memory streams fast code over configuration (you write actual js scripts)
Declared in package.json file leverage your OS' command line You can call separate Node scripts Convention-based pre/post hooks Leverage world'd largest package manager use tools directly No need for separate plugins hence we will use it simpler debugging better docd simple
in the package.json add ("start": "node buildSripts/srcServer.js") in the script braces to start stimply type (npm start) to share, simply run "npm run share"
used babel in (.babelrc)
used webpack in (webpack.config.dev.js)
eslint-watch- Eslint wrapper that adds file watch used plain Eslint watch
- Testing frameworks(mocha(no assertion library), jasmine, tape QUnit, AVA,Jest[react devs]]) Mocha
- Asertion library( chai, expect) [declaring what to expect) chai
- Helper library(JSDOM:run DOM tests without a browser, Cheerion: jquery for the server) JSDOM
- where to run tests (browser, headless browser(phantomJS: no visible interface), in-memory DOM(JSDOM) JSDOM(node)
- where to put test files (cetrealized, Alongside) Alongside
- tests will run automatic upon save
used Rravis and Appveyor can allow automated deployment Sign up or sign github account and go to travis website to signup using github git push --set-upstream origin js-developemt-ent to push to branch
Appveyor signup for Appveyor via there site and click add then click on new build
http request
XMLHttpRequest(XHR) jQuery Framework-based Fetch
isomorphic-fetch xhr Super agent Axios
Nock static JSON Create delopment server (api-mock, Json server,Json server + Json schema faker(generates fake data), Browersync, Express)
here we will;
- Declare our schema using Json Schema
- Generate random data unsing Faker.js, chance.js, regexp.js
- serve data via api using JSON Server
run(npm install -g json-server)
- project structure (javascript belongs to .js file)
- json should be injected to json from the server into the app if you want the app to behave differently to different users consider organizing the code by feature instead of file type
- Extract logic into POJOs(plain old javascrpt objects) not framework based objects
- minification to speed page load
- Source maps generated for debuging in production
- dynamic HTML handling for production specific concerns
- Cache busting to ensure that users get the latest version of our product
- Bundle splitting so that does not have to download entire application when just part of it changes
- Error logging so that not one bugs there way into production
to build the app run (npm run build)
- hard code
- manipulate via node
- html-webpack-plugin will use this in webpack.config.prod.js
webpack-md5-hash
- we'll use TrackJS
- Sentry
- New Relic
- Raygun
-
Yeomen commit all code to source control system Rerun the generator to existing project Resolve conflicts
-
Github Host in github fork starter kit for new project pull changes from master
-
npm Encapsulate kit in npm package update npm package to recieve latest changes