Coder Social home page Coder Social logo

adeora-playground's Introduction

Playground

This project was generated with Angular CLI version 1.1.2.

Development Process

Before Development

Before starting the development server or building the application, make sure that you have run npm install and executed ./build.sh. This will ensure that all of the dependencies are properly set up.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. Be sure to have run ./build.sh prior to this command.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build. Be sure to have run ./build.sh prior to this command.

Running unit tests

Run ng test to execute the unit tests via Karma. Be sure to have run ./build.sh prior to this command.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor. Before running the tests make sure you are serving the app via ng serve. Be sure to have run ./build.sh prior to this command.

Managing Runtime Dependencies of the AOT Compiler and in-playground compiled apps

Targeting a Specific Angular Version in dependencies loaded in the playground

To target a specific Angular version in the playground, set the version in src/environments/angularVersions.ts, then re-run ./build.sh. Angular versions must be in the format @# where # is the code of the specific version (e.g. @4.3.4 or @2.0.0-beta.10).

Adding packages to dependencies loaded in the playground

The playground requires that dependencies of the AOT compiler and of AOT compiled apps are loaded in two places in the playground:

  1. In the compiler dependency blob - this blob contains *.d.ts, package.json, and *.metadata.json files for all packages required by the compiler. This "blob" is loaded by the compiler worker thread, the Monaco editor, and the Angular language service.

  2. In the SystemJS config hardcoded into the index.html file of AOT compiled applications created in the playground. At runtime of the application, SystemJS handles loading of all the required runtime dependencies from unpkg.com and the virtual file system in use by the compiler.

To add dependencies to the compiler dependency blob:

  • Add the package to the package.json file in src/assets/compiler/dependency-blob. It may be necessary to update the package-lock.json file in that same directory as well.
  • Additionally, add the package name to /tools/build/rewriteDependencyBlobPackage.ts. Upon run of ./build.sh, this script enforces that the package versions listed in the package.json previously mentioned are consistent with the package versions specified in src/environments/angularVersions.ts.

To add dependencies to the SystemJS config:

  • Modify the default value of /index.html that is written in src/app/virtual-fs.service.ts to include the appropriate location of a umd (or similar) bundle that provides runtime dependencies for the package in question

Currently, the playground does not support dynamic (i.e. at runtime) addition of packages to a project. This is only supported at build time of the entire playground.

adeora-playground's People

Contributors

adeora avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.