Let's LRun ES6

-Modules-

Today's Story

Context

  • Story Line
  • Modules
  • Native
  • CommonJS
  • AMD
  • ES6

Story Line#1

Story Line#2

McFly!!!

Mr.McFly?

Modules

  • namespace
  • globals
  • include
  • import

Kevin dangoore

  • cross-interpreter standard library
    • v8
    • Rhino
    • spider monkey
  • standard interfaces to db
  • standard way to include module
  • package bundler
    • npm
  • package repository
    • npmjs.org

Common JS

  • Node.js
  • I/O.js
  • Mongo DB
  • Couch DB

AMD

  • RequireJS
  • AngularJS
  • Dojo

Native

console.log("[----------started--------------]");
console.log(message);
var present_message =  back_to_the_future(message);
console.log("[Back To The Future!]");
console.log(present_message);
console.log("[----------ended----------------]");

CommonJS

print(scripts['start']);
print(scripts['yelling']);
debugger;
var present_message =  movie.back_to_the_future();
print(scripts['back_scr']);
print(present_message);
print(scripts['end']);

AMD

define(function (require) {
    var messages = require('./messages');
    var print = require('print');
    var movie = require('./movie');
    var scripts = movie.scripts;

    print(scripts['start']);
    print(scripts['yelling']);
    var present_message =  movie.back_to_the_future();
    print(scripts['back_scr']);
    print(present_message);
    print(scripts['end']);

    print(messages.getHello());
});

ES6

import {scripts, back_to_the_future,print} from "./movie";

print(scripts['start']);
print(scripts['yelling']);
var present_message =  back_to_the_future();
print(scripts['back_scr']);
print(present_message);
print(scripts['end']);

Let's LRun ES6 -modules-

By Keen Dev

Let's LRun ES6 -modules-

  • 866