1- // Overriding the ember-cli-fastboot instance-initializer so that
2- // we can own this and migrate away.
3- // When using `ember serve` when fastboot addon is installed the application
4- // output will already be rendered to the DOM when the actual JavaScript
5- // loads. Ember does not automatically clear its `rootElement` so this
6- // leads to the "double" applications being visible at once (only the
7- // "bottom" one is running via JS and is interactive).
8- //
9- // This removes any pre-rendered ember-view elements, so that the booting
1+ // This removes any pre-rendered elements, so that the booting
102// application will replace the pre-rendered output
113export function clearHtml ( ) {
12- let current = document . getElementById ( 'fastboot -body-start' ) ;
13- let endMarker = document . getElementById ( 'fastboot -body-end' ) ;
4+ let current = document . getElementById ( 'prerender -body-start' ) ;
5+ let endMarker = document . getElementById ( 'prerender -body-end' ) ;
146
157 if ( current && endMarker ) {
16- let shoeboxNodes = document . querySelectorAll ( '[type="fastboot /shoebox"]' ) ;
8+ let shoeboxNodes = document . querySelectorAll ( '[type="prerender /shoebox"]' ) ;
179 let shoeboxNodesArray = [ ] ; // Note that IE11 doesn't support more concise options like Array.from, so we have to do something like this
1810 for ( let i = 0 ; i < shoeboxNodes . length ; i ++ ) {
1911 shoeboxNodesArray . push ( shoeboxNodes [ i ] ) ;
@@ -38,7 +30,7 @@ export default {
3830 initialize ( instance ) {
3931 const prerender = instance . lookup ( 'service:prerender' ) ;
4032 if ( ! prerender . isPrerendering ) {
41- var originalDidCreateRootView = instance . didCreateRootView ;
33+ const originalDidCreateRootView = instance . didCreateRootView ;
4234
4335 instance . didCreateRootView = function ( ) {
4436 clearHtml ( ) ;
0 commit comments