Code Monkey home page Code Monkey logo

presentations's Introduction

presentations's People

Contributors

andygup avatar dependabot[bot] avatar dmartine avatar driskull avatar drobinson13 avatar hhkaos avatar kellyhutchins avatar odoe avatar ralucanicola avatar tomwayson avatar ycabon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

presentations's Issues

Can't view slides

Hi Rene, I'm getting errors in Chrome when I try to view the slides. It looks like maybe the Reveal library reference is missing from the repo?

errors

2018 framework's talk - outline for Tom's part

Before I put this into full slide format and start a PR against presentation.md, I thought I'd drop the overall flow/structure here for your feedback:

Getting Started w/ Frameworks

2 approaches:

  • map centric
  • framework first

Map centric works best when:

  • most application state stored in map
  • map is always showing

Framework first works best when:

  • most application state stored outside the map (router, data store)
  • map only shows on a few or one route

JSAPI as your application framework vs using the JSAPI as library

  • or how much Dojo you want up in this application?

Who are your developers?

  • Geodevs that mainly want to replace Dijit with a more modern component library, or
  • Web developers that are familiar with a certain framework's conventions and tooling

You can use the JSAPI as a library w/ just about any framework, but doesn't always work the other way around

Opinionated <------> Flexible
Productivity <------> Choices
Ember - Angular - Vue - React
Heavy <---------> Lightweight

Not practical to use Ember or Angular in a Dojo application

  • very hard to extract pieces (components)
  • lose the benefit of their opinions & tools

We're not really going to talk about those two, here are resources:

Ember

Angular

Why do we even need an "approach"? Why can't we just:

npm install arcgis-js-api

then

import { Map, MapView } from 'esri';

TLDR: Loading modules with Dojo is a one way street

  • Dojo's AMD loader can load other AMD / UMD modules
  • Other module loaders (webpack*, Rollup) can't load Dojo's AMD modules
  • there is a webpack plugin,
    but it does not (yet) work w/ the JSAPI - we're working on that

In the mean time there are libraries and hacks to help you with this:

esri-loader is a library that works w/ any framework and/or module loader

Using esri-loader should look familiar to those of you coming from Dojo:

import { loadModules } from 'esri-loader';

loadModules(['esri/views/MapView', 'esri/WebMap'])
.then(([MapView, WebMap]) => {
  // then we load a web map from an id
  var webmap = new WebMap({
    portalItem: { // autocasts as new PortalItem()
      id: 'f2e9b762544945f390ca4ac3671cfa72'
    }
  });
  // and we show that map in a container w/ id #viewDiv
  var view = new MapView({
    map: webmap,
    container: 'viewDiv'
  });
});

That's effectively the same as:

define([require], function (require) {

  require(['esri/views/MapView', 'esri/WebMap'], 
  function (MapView, WebMap) {
    // ... the rest of the code is the same
  });
});

esri-loader also helps improve page load performance:

  • lazy load the JSAPI only on routes where it is needed
  • important if you are primarily targeting mobile/PWA
  • also offers loadCss() as a convenience method to lazy load the esri CSS

Demo: esri-preact-pwa

esri-loader lets you use the JSAPI in Server-side rendered (SSR) applications:

  • helps w/ SEO as well as performance

Demo: esri-loader-react-starter-kit

esri-loader doesn't require you to mess w/ your module loader's configuration

  • can be used w/ framework CLIs w/o "ejecting"
  • can be "no config" loaders like Parcel

Demo: esri-hyperapp-example

Downsides to esri-loader:

  • can't use import statements for esri modules

Take it away Rene!

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.