Skip to content

Commit

Permalink
Merge pull request #18811 from emberjs/upgrade-glimmer
Browse files Browse the repository at this point in the history
[BUGFIX release] Upgrade to latest glimmer-vm
  • Loading branch information
krisselden authored Mar 11, 2020
2 parents 830fb0a + 6d5cb2a commit 59f1d40
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 233 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@
},
"devDependencies": {
"@babel/preset-env": "^7.7.7",
"@glimmer/compiler": "0.47.9",
"@glimmer/compiler": "^0.48.0",
"@glimmer/env": "^0.1.7",
"@glimmer/interfaces": "0.47.9",
"@glimmer/node": "0.47.9",
"@glimmer/opcode-compiler": "0.47.9",
"@glimmer/program": "0.47.9",
"@glimmer/reference": "0.47.9",
"@glimmer/runtime": "0.47.9",
"@glimmer/validator": "0.47.9",
"@glimmer/interfaces": "^0.48.0",
"@glimmer/node": "^0.48.0",
"@glimmer/opcode-compiler": "^0.48.0",
"@glimmer/program": "^0.48.0",
"@glimmer/reference": "^0.48.0",
"@glimmer/runtime": "^0.48.0",
"@glimmer/validator": "^0.48.0",
"@simple-dom/document": "^1.4.0",
"@types/qunit": "^2.5.4",
"@types/rsvp": "^4.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ import {
WithJitDynamicLayout,
WithJitStaticLayout,
} from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { RootReference, VersionedPathReference } from '@glimmer/reference';
import { PrimitiveReference } from '@glimmer/runtime';
import { EMPTY_ARRAY } from '@glimmer/util';
import { EMPTY_ARRAY, unwrapTemplate } from '@glimmer/util';
import { combine, Tag, validate, value } from '@glimmer/validator';
import { SimpleElement } from '@simple-dom/interface';
import { BOUNDS, DIRTY_TAG, HAS_BLOCK, IS_DISPATCHING_ATTRS } from '../component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
VMArguments,
WithJitStaticLayout,
} from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { ComponentRootReference, PathReference } from '@glimmer/reference';
import { unwrapTemplate } from '@glimmer/util';
import { consume, createTag, isConst, Tag } from '@glimmer/validator';

import { ENV } from '@ember/-internals/environment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Factory, Owner } from '@ember/-internals/owner';
import { ComponentDefinition, WithJitStaticLayout } from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { unwrapTemplate } from '@glimmer/util';
import RuntimeResolver from '../resolver';
import { OwnedTemplate } from '../template';
import AbstractComponentManager from './abstract';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {
WithDynamicTagName,
WithJitStaticLayout,
} from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { ComponentRootReference, VersionedPathReference } from '@glimmer/reference';
import { EMPTY_ARGS } from '@glimmer/runtime';
import { unwrapTemplate } from '@glimmer/util';
import { CONSTANT_TAG, createTag, Tag } from '@glimmer/validator';

import { SimpleElement } from '@simple-dom/interface';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
Option,
VMArguments,
} from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { EMPTY_ARGS } from '@glimmer/runtime';
import { unwrapTemplate } from '@glimmer/util';
import { DIRTY_TAG } from '../component';
import { EmberVMEnvironment } from '../environment';
import { DynamicScope } from '../renderer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
VMArguments,
WithJitStaticLayout,
} from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { NULL_REFERENCE } from '@glimmer/runtime';
import { unwrapTemplate } from '@glimmer/util';
import { CONSTANT_TAG, createTag } from '@glimmer/validator';
import { EmberVMEnvironment } from '../environment';
import RuntimeResolver from '../resolver';
Expand Down
12 changes: 0 additions & 12 deletions packages/@ember/-internals/glimmer/lib/helpers/-i.ts

This file was deleted.

24 changes: 9 additions & 15 deletions packages/@ember/-internals/glimmer/lib/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import {
RenderResult,
SyntaxCompilationContext,
} from '@glimmer/interfaces';
import { JitContext, unwrapHandle, unwrapTemplate } from '@glimmer/opcode-compiler';
import { RuntimeProgramImpl } from '@glimmer/program';
import { JitContext } from '@glimmer/opcode-compiler';
import { VersionedPathReference } from '@glimmer/reference';
import {
clientBuilder,
Expand All @@ -26,11 +25,12 @@ import {
DOMTreeConstruction,
inTransaction,
IteratorResult,
JitRuntimeFromProgram,
JitRuntime,
JitSyntaxCompilationContext,
renderJitMain,
UNDEFINED_REFERENCE,
} from '@glimmer/runtime';
import { unwrapHandle, unwrapTemplate } from '@glimmer/util';
import { CURRENT_TAG, runInAutotrackingTransaction, validate, value } from '@glimmer/validator';
import { SimpleDocument, SimpleElement, SimpleNode } from '@simple-dom/interface';
import RSVP from 'rsvp';
Expand Down Expand Up @@ -282,27 +282,21 @@ export abstract class Renderer {
let runtimeResolver = (this._runtimeResolver = new RuntimeResolver(env.isInteractive));
let compileTimeResolver = new CompileTimeResolver(runtimeResolver);

this._context = JitContext(compileTimeResolver);
let context = (this._context = JitContext(compileTimeResolver));

populateMacros(this._context.macros);

let program = new RuntimeProgramImpl(
this._context.program.constants,
this._context.program.heap
);
populateMacros(context.macros);

let runtimeEnvironmentDelegate = new EmberEnvironmentDelegate(owner, env.isInteractive);

this._runtime = JitRuntimeFromProgram(
this._runtime = JitRuntime(
{
appendOperations: env.hasDOM
? new DOMTreeConstruction(document)
: new NodeDOMTreeConstruction(document),
updateOperations: new DOMChanges(document),
},
program,
runtimeResolver,
runtimeEnvironmentDelegate
runtimeEnvironmentDelegate,
context,
runtimeResolver
);
}

Expand Down
15 changes: 10 additions & 5 deletions packages/@ember/-internals/glimmer/lib/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ import { PARTIALS } from '@ember/deprecated-features';
import EmberError from '@ember/error';
import { _instrumentStart } from '@ember/instrumentation';
import { DEBUG } from '@glimmer/env';
import { ComponentDefinition, Helper, JitRuntimeResolver, Option } from '@glimmer/interfaces';
import { PartialDefinition, unwrapTemplate } from '@glimmer/opcode-compiler';
import {
ComponentDefinition,
Helper,
JitRuntimeResolver,
Option,
PartialDefinition,
} from '@glimmer/interfaces';
import { PartialDefinitionImpl } from '@glimmer/opcode-compiler';
import { getDynamicVar, ModifierDefinition } from '@glimmer/runtime';
import { unwrapTemplate } from '@glimmer/util';
import { CurlyComponentDefinition } from './component-managers/curly';
import { CustomManagerDefinition, ManagerDelegate } from './component-managers/custom';
import InternalComponentManager, {
Expand All @@ -23,7 +30,6 @@ import InternalComponentManager, {
import { TemplateOnlyComponentDefinition } from './component-managers/template-only';
import { isHelperFactory, isSimpleHelper } from './helper';
import { default as componentAssertionHelper } from './helpers/-assert-implicit-component-helper-argument';
import { default as parseIntHelper } from './helpers/-i';
import { default as inputTypeHelper } from './helpers/-input-type';
import { default as normalizeClassHelper } from './helpers/-normalize-class';
import { default as trackArray } from './helpers/-track-array';
Expand Down Expand Up @@ -251,7 +257,6 @@ const BUILTINS_HELPERS: IBuiltInHelpers = {
unless: inlineUnless,
'-hash': hash,
'-each-in': eachIn,
'-i': parseIntHelper,
'-input-type': inputTypeHelper,
'-normalize-class': normalizeClassHelper,
'-track-array': trackArray,
Expand Down Expand Up @@ -440,7 +445,7 @@ export default class RuntimeResolver implements JitRuntimeResolver<OwnedTemplate
let templateFactory = lookupPartial(name, owner);
let template = templateFactory(owner);

return new PartialDefinition(name, template);
return new PartialDefinitionImpl(name, template);
}

private _lookupModifier(name: string, meta: OwnedTemplateMeta) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { assert } from '@ember/debug';
import { Bounds, CapturedArguments, Option } from '@glimmer/interfaces';
import { unwrapTemplate } from '@glimmer/opcode-compiler';
import { VersionedPathReference } from '@glimmer/reference';
import { expect, Stack } from '@glimmer/util';
import { expect, Stack, unwrapTemplate } from '@glimmer/util';
import { SimpleElement, SimpleNode } from '@simple-dom/interface';
import { OwnedTemplate } from '../template';

Expand Down
2 changes: 0 additions & 2 deletions packages/ember-template-compiler/lib/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import AssertLocalVariableShadowingHelperInvocation from './assert-local-variabl
import AssertReservedNamedArguments from './assert-reserved-named-arguments';
import AssertSplattributeExpressions from './assert-splattribute-expression';
import DeprecateSendAction from './deprecate-send-action';
import SafeIntegersBugfix from './safe-integers-bugfix';
import TransformActionSyntax from './transform-action-syntax';
import TransformAttrsIntoArgs from './transform-attrs-into-args';
import TransformComponentInvocation from './transform-component-invocation';
Expand Down Expand Up @@ -42,7 +41,6 @@ const transforms: Array<APluginFunc> = [
AssertSplattributeExpressions,
TransformEachTrackArray,
TransformWrapMountAndOutlet,
SafeIntegersBugfix,
];

if (SEND_ACTION) {
Expand Down

This file was deleted.

Loading

0 comments on commit 59f1d40

Please sign in to comment.