Skip to content

Commit

Permalink
Merge pull request #19389 from emberjs/remove-template-id
Browse files Browse the repository at this point in the history
Removes template ids
  • Loading branch information
Chris Garrett authored Feb 9, 2021
2 parents 4b08299 + 82cb1ab commit df22118
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 156 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@babel/plugin-transform-block-scoping": "^7.8.3",
"@babel/plugin-transform-object-assign": "^7.8.3",
"@ember/edition-utils": "^1.2.0",
"@glimmer/vm-babel-plugins": "0.74.2",
"@glimmer/vm-babel-plugins": "0.75.0",
"babel-plugin-debug-macros": "^0.3.3",
"babel-plugin-filter-imports": "^4.0.0",
"broccoli-concat": "^4.2.4",
Expand All @@ -75,19 +75,19 @@
},
"devDependencies": {
"@babel/preset-env": "^7.9.5",
"@glimmer/compiler": "0.74.2",
"@glimmer/compiler": "0.75.0",
"@glimmer/env": "^0.1.7",
"@glimmer/global-context": "0.74.2",
"@glimmer/interfaces": "0.74.2",
"@glimmer/manager": "0.74.2",
"@glimmer/destroyable": "0.74.2",
"@glimmer/owner": "0.74.2",
"@glimmer/node": "0.74.2",
"@glimmer/opcode-compiler": "0.74.2",
"@glimmer/program": "0.74.2",
"@glimmer/reference": "0.74.2",
"@glimmer/runtime": "0.74.2",
"@glimmer/validator": "0.74.2",
"@glimmer/global-context": "0.75.0",
"@glimmer/interfaces": "0.75.0",
"@glimmer/manager": "0.75.0",
"@glimmer/destroyable": "0.75.0",
"@glimmer/owner": "0.75.0",
"@glimmer/node": "0.75.0",
"@glimmer/opcode-compiler": "0.75.0",
"@glimmer/program": "0.75.0",
"@glimmer/reference": "0.75.0",
"@glimmer/runtime": "0.75.0",
"@glimmer/validator": "0.75.0",
"@simple-dom/document": "^1.4.0",
"@types/qunit": "^2.9.1",
"@types/rsvp": "^4.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ moduleFor(
let Compiled = compile(templateStr, options);

assert.equal(typeof Precompiled, 'function', 'precompiled is a factory');
assert.ok(Precompiled.__id, 'precompiled has id');

assert.equal(typeof Compiled, 'function', 'compiled is a factory');
assert.ok(Compiled.__id, 'compiled has id');

this.expectCacheChanges({}, 'no changes');

Expand Down
3 changes: 0 additions & 3 deletions packages/internal-test-helpers/lib/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { SerializedTemplateWithLazyBlock, TemplateFactory } from '@glimmer/inter
import { templateFactory } from '@glimmer/opcode-compiler';
import { compileOptions, EmberPrecompileOptions } from 'ember-template-compiler';

let templateId = 0;

/**
Uses HTMLBars `compile` function to process a string into a compiled template.
Expand All @@ -28,7 +26,6 @@ export default function compile(
let reifiedScopeValues = usedLocals.map((key) => scopeValues[key]);

let templateBlock: SerializedTemplateWithLazyBlock = {
id: String(templateId++),
block: JSON.stringify(block),
moduleName: options.moduleName ?? options.meta?.moduleName ?? '(unknown template module)',
scope: reifiedScopeValues.length > 0 ? () => reifiedScopeValues : null,
Expand Down
6 changes: 0 additions & 6 deletions tests/node/template-compiler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,5 @@ QUnit.module('ember-template-compiler.js', function () {
) {
assert.equal(typeof templateCompiler._Ember.VERSION, 'string', '_Ember.VERSION is present');
});

QUnit.test('can generate a template with a server side generated `id`', function (assert) {
let TemplateJSON = JSON.parse(templateCompiler.precompile('<div>simple text</div>'));

assert.ok(TemplateJSON.id, 'an `id` was generated');
});
});
});
Loading

0 comments on commit df22118

Please sign in to comment.