Skip to content

Commit

Permalink
Merge pull request #14454 from emberjs/d8
Browse files Browse the repository at this point in the history
initial d8-runner ready to go
  • Loading branch information
stefanpenner authored Oct 30, 2016
2 parents 53aab7e + dfad2c1 commit 62a2c1c
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions d8-runner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// GETTTING D8 (v8 + basic console):
// 1. git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
// 2. add depot_tools to your path: export PATH=/path/to/depo/tools/depot_tools:"$PATH"
// 3. no, in the cwd where you want v8 to live type: `fetch v8`
// 4. build (for your local architecture) `make native` (otherwise you may wait for a very long time)
// 5. now, you have a d8 at your disposale /path/to/v8/out/x64.debug/d8
//
// GETTING EMBER WORKING:
// most likely you will need to run:
// npm install
// bower install
// npm run build // for one time production build
//
// for active iteration, recommendation is: `ember server --env production`
// Please note: production builds (due to minification, can be abit slow)
//
// want to run an app, checkout: https://github.com/stefanpenner/d8-ember

// handy d8 stuff:
// ---------------
//
// --trace-opt-verbose
// --prof + tick-processor
// enableProfiler() / disableProfiler()
// --trace-inlining
// --trace-gc
// --allow-natives
// %DebugPrint(x);
// %OptimizeFunctionOnNextCall(x);
// %HaveSameMap(x, y);
// --trace-maps
// --trace_generalization
// --help
// --expose-gc
// --print-opt-code --code-comments
//
// begin MISC setup;
const global = new Function('return this;')();
global.self = global;
global.window = {};
function loadFile(file) {
print('load: ' + file);
load(file);
}

global.console = {
log(...args) {
print(...args);
}
};

global.setTimeout = function(callback) {
// good enough
Promise.resolve().then(callback).catch(e => print('error' + e));
};
loadFile('./node_modules/simple-dom/dist/simple-dom.js');
const document = new SimpleDOM.Document();
document.createElementNS = document.createElement; // TODO:wat
global.document = document;
SimpleDOM.Node.prototype.insertAdjacentHTML = function( ) {};

// end MISC setup

// Load the ember you want
loadFile('./dist/ember.js'); // prod build === no asserts and dev related code
// loadFile('/dist/ember.min.js'); // prod build + minified
// loadFile('/dist/ember.debug.js'); // debug build === asserts and stuff, has perf issues

// do what you want
console.log(Ember);

0 comments on commit 62a2c1c

Please sign in to comment.