Skip to content

Commit 8ab5df8

Browse files
committed
Tack serialization-first-node-helpers onto Ember global
This is dependent on this glimmer-vm PR to actually work glimmerjs/glimmer-vm#788. Which means we'll need to wait until it is merged/bumped and Ember itself updates to use the release with it in it before we can land this. The idea here is to insulate things that depend on the magic string we use to determine whether or not the DOM node we pass was produced by the serialization element builder. This needs to be exposed on the global to ensure we can use it in the ember-cli-fastboot vendor file so we can determine how to boot the app when it is loaded in the browser. To see where it'd be used in ember-cli-fastboot please see this PR with the in progress work: ember-fastboot/ember-cli-fastboot#580
1 parent caca9d8 commit 8ab5df8

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

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, SERIALIZATION_FIRST_NODE_STRING } 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, SERIALIZATION_FIRST_NODE_STRING } from '@glimmer/util';

packages/ember/lib/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ import {
429429
setTemplates,
430430
template,
431431
TextField,
432-
TextArea
432+
TextArea,
433+
isSerializationFirstNode,
434+
SERIALIZATION_FIRST_NODE_STRING
433435
} from 'ember-glimmer';
434436

435437
Ember.Component = Component;
@@ -507,7 +509,9 @@ Ember.ViewUtils = {
507509
getViewClientRects: views.getViewClientRects,
508510
getViewBoundingClientRect: views.getViewBoundingClientRect,
509511
getRootViews: views.getRootViews,
510-
getChildViews: views.getChildViews
512+
getChildViews: views.getChildViews,
513+
isSerializationFirstNode: isSerializationFirstNode,
514+
SERIALIZATION_FIRST_NODE_STRING: SERIALIZATION_FIRST_NODE_STRING
511515
};
512516

513517
Ember.TextSupport = views.TextSupport;

packages/ember/tests/reexports_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ 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'],
118+
['ViewUtils.SERIALIZATION_FIRST_NODE_STRING', 'ember-glimmer', 'SERIALIZATION_FIRST_NODE_STRING'],
117119
['TextSupport', 'ember-views'],
118120
['ComponentLookup', 'ember-views'],
119121
['EventDispatcher', 'ember-views'],

0 commit comments

Comments
 (0)