Skip to content

Commit 8177f46

Browse files
authored
Merge pull request #16300 from rondale-sc/tack-serialization-first-node-util-to-ember-view-utils
Expose ability to detect serialization node.
2 parents caca9d8 + 86f1591 commit 8177f46

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

packages/ember-application/tests/system/visit_test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Application from '../../system/application';
1010
import ApplicationInstance from '../../system/application-instance';
1111
import Engine from '../../system/engine';
1212
import { Route } from 'ember-routing';
13-
import { Component, helper } from 'ember-glimmer';
13+
import { Component, helper, isSerializationFirstNode } from 'ember-glimmer';
1414
import { compile } from 'ember-template-compiler';
1515
import { ENV } from 'ember-environment';
1616

@@ -70,9 +70,8 @@ moduleFor('Application - visit()', class extends ApplicationTestCase {
7070

7171
return this.visit('/', bootOptions)
7272
.then((instance) => {
73-
assert.equal(
74-
instance.rootElement.firstChild.nodeValue,
75-
'%+b:0%',
73+
assert.ok(
74+
isSerializationFirstNode(instance.rootElement.firstChild),
7675
'glimmer-vm comment node was not found'
7776
);
7877
}).then(() =>{

packages/ember-glimmer/lib/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,5 @@ export { default as iterableFor } from './utils/iterable';
304304
export { default as DebugStack } from './utils/debug-stack';
305305
export { default as OutletView } from './views/outlet';
306306
export { default as CustomComponentManager } from './component-managers/custom';
307-
export { COMPONENT_MANAGER, componentManager } from './utils/custom-component-manager';
307+
export { COMPONENT_MANAGER, componentManager } from './utils/custom-component-manager';
308+
export { isSerializationFirstNode } from './utils/serialization-first-node-helpers';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { isSerializationFirstNode } from '@glimmer/util';

packages/ember/lib/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,8 @@ import {
429429
setTemplates,
430430
template,
431431
TextField,
432-
TextArea
432+
TextArea,
433+
isSerializationFirstNode
433434
} from 'ember-glimmer';
434435

435436
Ember.Component = Component;
@@ -507,7 +508,8 @@ Ember.ViewUtils = {
507508
getViewClientRects: views.getViewClientRects,
508509
getViewBoundingClientRect: views.getViewBoundingClientRect,
509510
getRootViews: views.getRootViews,
510-
getChildViews: views.getChildViews
511+
getChildViews: views.getChildViews,
512+
isSerializationFirstNode: isSerializationFirstNode
511513
};
512514

513515
Ember.TextSupport = views.TextSupport;

packages/ember/tests/reexports_test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ let allExports =[
114114
['ViewUtils.getViewBoundingClientRect', 'ember-views', 'getViewBoundingClientRect'],
115115
['ViewUtils.getRootViews', 'ember-views', 'getRootViews'],
116116
['ViewUtils.getChildViews', 'ember-views', 'getChildViews'],
117+
['ViewUtils.isSerializationFirstNode', 'ember-glimmer', 'isSerializationFirstNode'],
117118
['TextSupport', 'ember-views'],
118119
['ComponentLookup', 'ember-views'],
119120
['EventDispatcher', 'ember-views'],

0 commit comments

Comments
 (0)