Alyssa Rosenzweig 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
..
account_course_user_search 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
actAs 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
add_people 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
announcements 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
assignments 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
authentication_providers 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
blueprint_courses 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
bundles 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
calendar 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
canvas_cropper 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
choose_mastery_path 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
collaborations 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
conditional_release_stats 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
context_cards 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
context_modules 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
course_link_validator 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
course_settings 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
course_wizard 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
courses 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
custom_help_link_settings 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
dashboard 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
dashboard_card 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
discussion_topics 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
due_dates 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
editor 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
eportfolios 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
epub_exports 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
external_apps 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
files 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
gradebook 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
gradebook-history 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
gradezilla 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
grading 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
groups 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
help_dialog 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
mediaelement 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
move_item 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
navigation_header 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
new_user_tutorial 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
notification_preferences 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
outcomes 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
quizzes 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
rubrics 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
shared 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
speed_grader 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
styleguide 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
theme_editor 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
webzip_export 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
README.md 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
appBootstrap.js 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
canvasCssVariablesPolyfill.js 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos
railsFlashNotificationsHelper.js 7cea452997 Move everything up one %!s(int64=7) %!d(string=hai) anos

README.md

This directory is temporary until we rework the front-end build This is where we are headed.

Stuff you can do in Canvas JSX files

BUT WAIT!

Your file needs to:

  1. Have a file name with the .jsx extension.

JSX

function foo(paths) {
  return <svg>{paths}</svg>;
}

Arrow Functions

Arrow Function Reference

var arr = ['hydrogen', 'helium', 'lithium'];

// es5
var a = arr.map(function(s){ return s.length });

// es6
var b = arr.map( s => s.length );

// with curlies requires normal return
var b = arr.map( (s) => {
  return s.length
});

// lexical `this`
var obj = {
  multiplier: 3,

  multiplyStuff (stuff) {
    return stuff.map((x) =>
      // no bind!
      return this.multiplier * x;
    )
  }
};

Classes

Class Reference

class EventEmitter {
  constructor() {
    // called when created
  }
  emit() {
    // ...
  }
  on() {
    // ...
  }
  once() {
    // ...
  }
  removeListener() {
    // ...
  }
  removeAllListeners() {
    // ...
  }
}

Extending and calling super.

class Domain extends EventEmitter {
  constructor() {
    super();
    this.members = [];
  }
}

Creating instances

var domain = new Domain();

Destructuring

// es5
var map = _.map;
var each = _.each;

// es6
var {map, each} = _;

Concise Object Methods

// es5
var obj = {
  foo: function() {}
  bar: function() {}
};

// es6
var obj = {
  foo() {}
  bar() {}
};

Object Short Notation

// es5
function() {
  // ...
  return {foo: foo, bar: bar, x: 10};
}

// es6
function() {
  // ...
  return {foo, bar, x: 10};
}

Rest Parameters

Rest Parameters Reference

// es5
function multiply(multiplier) {
  var numbers = Array.prototype.slice.call(arguments, 0);
  return number.map(function(n) { return multiplier * n; });
}

// es6
function multiply(multiplier, ...numbers) {
  return numbers.map( n => multiplier * n);
}

String Templates

String Template Reference

Multiline strings:

// es5
console.log("string text line 1" +
"string text line 2");

// es6
console.log(`string text line 1
string text line 2`);

Interpolated strings

var a = 5;
var b = 10;

// es5
console.log("Fifteen is " + (a + b) + " and not " + (2 * a + b) + ".");

// es6
console.log(`Fifteen is ${a + b} and not ${2 * a + b}.`);