Giter Club home page Giter Club logo

cmv-app-dojo-builder's Introduction

CMV-App Dojo Build

Build Status

Try The Demo

This branch is the esri-jsapi resource directory setup for creating single file dojo builds. It downloads dojo, the esri api, and CMV as bower resources and can be used to create high performance dojo builds using the dojo build system. The primary benefits are:

  • Smaller downloads: only the modules used in an application are downloaded
  • Quicker load times: HTML and Javascript files are concatenated and optimized into single files using the closure compiler. CSS are concatenated using xstyle

See the difference! Note: the load times shown below are not observed in a production environment, and should not be used for comparison.

Instead, Try The Demo for an realistic comparison.

Before:

Before Build

After:

After Build

Requirements

Usage

  • npm install -g bower - installs bower
  • npm install -g grunt-cli - installs global grunt
  • npm install - installs required node and bower packages
  • npm run clean - removes built files from dist directory
  • npm run build-dev - run the Dojo build on application but leave all files. Useful for debugging builds. This will result in a large folder size, although the browser shouldn't be requesting any extra files.
  • npm run build - run the Dojo build on application and run the cleanup tasks which remove all extra js and css files that aren't included in the build. If you add extra layers to the profile, the Gruntfile.js must be modified to account for this so these layers aren't removed!

Customizing dojo layers

  1. Use build.profile.js, viewer.js, and other config files to add your layers. The current setup uses one large layer, dojo/dojo.js.
  2. Another option is to have one main layer dojo/dojo.js and several others like config files that are loaded on demand.
  3. When adding layer files, both build.profile.js and Gruntfile.js clean task should be modified. Otherwise grunt will remove the file when it cleans up the build.

Limitations

The dojo build system doesn't optimize packages between layers. Lets say you have 3 modules

  • Module A
  • Module B
  • Module C
  1. Both A and B require C.
  2. We create 2 layer files A and B.
  3. Both layer files will have their own copy of C.

Maybe we should move away from dojo and use something like StealJS. What do you say, Esri?

##Troubleshooting

Instead of running grunt dojo-build, instead try running build-viewer.sh. This will give you a detailed error log in the dist directory called build-report.txt. Errors begin with error(123) in the output. These errors will most likely be paths that do not resolve correctly.

Resources

cmv-app-dojo-builder's People

Contributors

green3g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmv-app-dojo-builder's Issues

Icon display

Some icons don't display correctly:

  • Geocoder Icon
  • Draw widget icons (adw-font)

screenshot_20160717_133329

Missing files on mobile

The following files are missing when viewed in a mobile browser:

  • dgrid/util/touch
  • dgrid/TouchScroll
  • dojo/_firebug/firebug

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.