Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit 57e37f1

Browse files
author
Andre Medeiros
committed
Farewell CoffeeScript
We are breaking up. I'm sorry, it's not you, it's me. I really like you, but I feel like now is that time in my life where I grow up and face some big challenges and decisions. The first time I saw you, I couldn't take my eyes off of your beautiful list comprehensions. Your arrow functions were amazing. I bet you remember all the special moments we had together. It was pretty fantastic. It was love at first sight. You remind me of my parents, Mr. Python and Mrs. Ruby, who taught me great things in life. But now, I can make my own decisions independently of my parents. As I said, there's nothing really wrong with you. It's just that I need to go dangerous, I need to live that adventure that every man is called to. To take my backpack and just go, discover the world out there. With you, I don't have my freedom to name my own functions. I can't make classes the way I want to. You don't let me do that. And I know your intentions are the best, please don't get offended here. I know you are trying to save me against evil code and odd bugs. But I have grown up and those aren't issues anymore. Also, in the end of the day, your generated JavaScript is just about 5% more verbose than actual CoffeeScript code, so I don't see real benefit. I think I'll survive. This time, I actually believe I can JavaScript. I don't particularly like it, I miss you sometimes, my dear. But I got courage. This will be tough, but it's my destiny. It's what I'm called to do. Sorry.
1 parent cf985c9 commit 57e37f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2330
-3992
lines changed

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ DONE Render nondraggable Completion for output diagram
5050
DONE Controller logic to include completion time
5151
DONE Update examples with regard to completion time
5252
DONE New Model View Interpreter architecture, for OperatorsMenu
53+
TODO Replace CoffeeScript with JavaScript
5354
TODO Lower bound on completion time, no earlier than any marble time
5455
- Marble has a static subject for mousedown event, which covers all instances
5556
of marble. Each subject notification points to the marble instance's id. ALSO

dist/js/app.js

Lines changed: 1021 additions & 2874 deletions
Large diffs are not rendered by default.

dist/js/binder.js

Lines changed: 21 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var gulp = require('gulp');
2-
var coffee = require('gulp-coffee');
32
var less = require('gulp-less');
43
var browserify = require('gulp-browserify');
54
var uglify = require('gulp-uglify');
@@ -9,13 +8,6 @@ var path = require('path');
98

109
// Based on https://github.com/deepak1556/gulp-browserify/issues/7
1110

12-
gulp.task('coffee', function() {
13-
gutil.log(gutil.colors.yellow("Compiling CoffeeScript..."));
14-
return gulp.src(['./src/**/*.coffee'])
15-
.pipe(coffee({bare: true}).on('error', gutil.log))
16-
.pipe(gulp.dest('./build/src'));
17-
});
18-
1911
gulp.task('less', function() {
2012
gutil.log(gutil.colors.yellow("Compiling LESS styles..."));
2113
gulp.src('./styles/main.less')
@@ -25,19 +17,19 @@ gulp.task('less', function() {
2517
.pipe(gulp.dest('./dist/css'));
2618
});
2719

28-
gulp.task('dev-browserify', ['coffee'], function() {
20+
gulp.task('dev-browserify', [], function() {
2921
gutil.log(gutil.colors.yellow("Packing with browserify..."));
30-
return gulp.src(['./build/src/**/*.js'])
22+
return gulp.src(['./src/**/*.js'])
3123
.pipe(browserify({
3224
insertGlobals: true,
3325
debug: true
3426
}))
3527
.pipe(gulp.dest('./build/browserified-js'));
3628
});
3729

38-
gulp.task('browserify', ['coffee'], function() {
30+
gulp.task('browserify', [], function() {
3931
gutil.log(gutil.colors.yellow("Packing with browserify..."));
40-
return gulp.src(['./build/src/**/*.js'])
32+
return gulp.src(['./src/**/*.js'])
4133
.pipe(browserify({
4234
insertGlobals: false,
4335
debug: false,
@@ -57,7 +49,7 @@ gulp.task('uglify', ['browserify'], function() {
5749
gulp.task('post-clean-up', ['uglify'], function() {
5850
gutil.log(gutil.colors.yellow("Cleaning up temporary files..."));
5951
return gulp.src(
60-
[__dirname+'/build/src/**/*', __dirname+'/build/browserified-js/**/*'],
52+
[__dirname+'/build/browserified-js/**/*'],
6153
{read: false}
6254
)
6355
.pipe(rimraf());
@@ -74,7 +66,7 @@ gulp.task('default', function() {
7466
gulp.run('dev-build');
7567

7668
gutil.log("Watching for changes...");
77-
gulp.watch(['./src/**/*.coffee', './styles/**/*.less'], function(event) {
69+
gulp.watch(['./src/**/*.js', './styles/**/*.less'], function(event) {
7870
if (event.path) {
7971
gutil.log("Change detected in ", gutil.colors.magenta(event.path));
8072
} else {

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
},
1818
"devDependencies": {
1919
"browserify": "~2.36.0",
20-
"coffeeify": "~0.6.0",
2120
"gulp": "~3.8.6",
2221
"gulp-browserify": "^0.5.0",
23-
"gulp-coffee": "^2.1.1",
2422
"gulp-less": "^1.3.2",
2523
"gulp-rimraf": "^0.1.0",
2624
"gulp-uglify": "^0.3.1",
@@ -30,7 +28,7 @@
3028
},
3129
"scripts": {
3230
"preinstall": "rm -rf build && rm -rf node_modules",
33-
"postinstall": "mkdir build && mkdir build/src && ln -s ../build/src node_modules/rxmarbles && ln -s ../package.json node_modules/package.json",
31+
"postinstall": "ln -s ../src node_modules/rxmarbles && ln -s ../package.json node_modules/package.json",
3432
"update-gh-pages": "git checkout gh-pages && git merge master && rm dist/js/app.js && gulp build && git add dist/js/app.js && git commit --amend --no-edit && git push origin gh-pages && git checkout master"
3533
}
3634
}

src/app.coffee

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/app.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* App entry-point.
3+
*/
4+
var Package = require('package.json');
5+
var binder = require('rxmarbles/binder');
6+
var Sandbox = require('rxmarbles/views/sandbox');
7+
var OperatorsMenuModel = require('rxmarbles/models/operators-menu');
8+
var OperatorsMenuView = require('rxmarbles/views/operators-menu');
9+
var OperatorsMenuInterpreter = require('rxmarbles/interpreters/operators-menu');
10+
var DOMDelegator = require('dom-delegator');
11+
var Utils = require('rxmarbles/views/utils');
12+
13+
var domDelegator = DOMDelegator();
14+
15+
var sandboxContainer = document.querySelector(".js-sandboxContainer");
16+
sandboxContainer.innerHTML = "";
17+
sandboxContainer.appendChild(Sandbox.render());
18+
19+
binder(OperatorsMenuModel, OperatorsMenuView, OperatorsMenuInterpreter);
20+
// binder(SandboxModel, SandboxView, SandboxInterpreter);
21+
22+
Utils.renderVTreeStream(OperatorsMenuView.vtree$, ".js-operatorsMenuContainer");
23+
24+
var versionElement = document.querySelector("a.js-appVersion");
25+
versionElement.textContent = "v" + Package.version;
26+
versionElement.href = "https://github.com/staltz/rxmarbles/releases/tag/v" + Package.version;
27+
28+
var rxVersion = Package.dependencies.rx.replace(/(~|\^|\.\+)*/g, "");
29+
var rxElement = document.querySelector("a.js-rxjsVersion");
30+
rxElement.textContent = "RxJS v" + rxVersion;
31+
rxElement.href = "https://github.com/Reactive-Extensions/RxJS/tree/v" + rxVersion;

src/binder.coffee

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/binder.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Important Model-View-Interpreter binding function.
3+
*/
4+
module.exports = function(model, view, interpreter) {
5+
view.observe(model);
6+
interpreter.observe(view);
7+
model.observe(interpreter);
8+
};

src/data/boolean-examples.coffee

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)