Skip to content

Instantly share code, notes, and snippets.

View template.json
["open-element", "h1", []],
["text", "Hello World"],
View resolver.ts
resolve<U>(handle: number): U {
return this.table[handle];
View external-module-table.js
import UserProfile from './src/ui/components/UserProfile/component';
/* ...other component imports */
export let table = [
/* Component1 */,
/* Component2 */,
/* ... */,
/* Component41 */,
/* Component43 */,
tomdale / bytecode.ts
Created Oct 20, 2017
Glimmer.js Application proposal
View bytecode.ts
// This is the API for constructing a Glimmer.js application with
// precompiled binary bytecode templates and using an async renderer
// (via requestAnimationFrame, requestIdleCallback, etc).
import Application, { DOMBuilder, AsyncRenderer, BytecodeLoader } from '@glimmer/application';
import data from './__compiled__/data';
let bytecode = fetch('./__compiled__/templates.gbx')
.then(req => req.arrayBuffer());
tomdale / ember-cli-build.js
Created Oct 13, 2017
Disable packaging with Rollup in Glimmer.js and build JS modules
View ember-cli-build.js
'use strict';
const GlimmerApp = require('@glimmer/application-pipeline').GlimmerApp;
class ModuleApp extends GlimmerApp {
package(tree) {
return tree;
View samsung-galaxy-s3-slow-3g.json
This file has been truncated, but you can view the full file.
View index.html
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>Array Check vs. String Check</title>
<script src=""></script>
<script src="./suite.js"></script>
<h1>Open the console to view the results</h1>
View glimmer-compiler-api-sketch.ts
// PDI lazy evaluation of webpack modules
// 1. during compile time, answering what is in scope
// 1a. if it is in scope, what is the fully qualified path?
// 2. compilation handle + metadata
// 3. please map this handle to a ComponentSpec (manager + definition)
// 4. please resolve (component name, referrer) into handle (for dynamic component helper)
// return wire format as metadata for compile step
// need to add hasComponentHelper
View ember-cli-build.js
const babel = require('broccoli-babel-transpiler');
const uglify = require('broccoli-uglify-js');
let jsTree = funnel('src', { include: ['**/*.js'] })
.apply(babel, { presets: ['env'] })
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'