-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14454 from emberjs/d8
initial d8-runner ready to go
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |