Friday, June 10, 2016

WEBPACK - what is it Hot Module Reload, flags, process.env etc

Here is a good explanation what is Hot Module Reload:
http://matthewlehner.net/react-hot-module-replacement-with-webpack/

If you’re interested in a more in depth explanation of how it works, check out the answer to What exactly is Hot Module Replacement in Webpack on Stackoverflow.

http://webpack.github.io/docs/hot-module-replacement-with-webpack.html

http://stackoverflow.com/questions/24581873/what-exactly-is-hot-module-replacement-in-webpack#answer-24587740

webpack-dev-server --progress --inline
  • --progress displays the compilation progress when building
  • --inline adds webpacks automatic refresh code inline with the compile application
--profile 
--colors 
--watch 
--display-error-details 
--display-cached 
--content-base /src

Profiling

If you wish to have a more in-depth idea of what is taking how long, you can use the --profile switch. This will cause WebPack to display more detailed timing informations. Combine this with the switches above to get a very detailed message and information set, which will contain the timings of your modules.

The timing "keys"

  • factory: The time it took to build the module information.
  • building: The time that was spent building the module (loaders, for example).
  • dependencies: The time that was spent gathering and connecting the dependencies

Process.env:
Webpack configuration can be a CommonJS module and can pick up on environment variables via Node's process.env object.

AMD
https://webpack.github.io/docs/amd.html

Tuesday, May 31, 2016

AUTH0 ANGULAR 2 - github links

Steps in creating and running demo Angualr2 + Auth0:
1. Create account on Auth0
2. Create Application (download Angular2 + Auth0 sample code)
3. Add Allowed Callback URLs separated by comma for Prod and Dev e.g http://localhost:3000/, http://localhost:8080/, http://localhost:8081/ (if it is not set you will got an error on login: error invalid origin)
4. Create User with login password



4. Build for prod: npm run watch:prod
5. Build for prod: npm run server:prod
C:\Users\Andre\Downloads\AUTH0\auth0-angular2-sample\webpack>npm run server:prod

> auth0-angular2-webpack@0.0.0 server:prod C:\Users\Andre\Downloads\AUTH0\auth0-angular2-sample\webpack
> http-server dist --cors

Starting up http-server, serving dist
Available on:
  http://93.126.95.40:8081
  http://127.0.0.1:8081

5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod
5. Build for prod: npm run server:prod


auth0 pricing
https://auth0.com/pricing

auth0-angular2
https://github.com/auth0/auth0-angular2/blob/master/webpack/package.json

angular2-jwt
https://github.com/auth0/angular2-jwt

Real world Angular 2 app authentication
https://auth0.com/blog/2015/05/14/creating-your-first-real-world-angular-2-app-from-authentication-to-calling-an-api-and-everything-in-between/

JWT - JSON Web Token for auth0 authorization
https://jwt.io/introduction/