Repository: ember-cli/ember-cli
Pull request #10474 (2024-06-26 18:31:57)

Improve dx when WelcomePage is present
This moves the `{{outlet}}` to before the `<WelcomePage/>`. In the out-of-the-box case, it doesn't look any different because there's no content in the index route. But if you try to put content in the index route without first editing application.hbs, this ensures your content will be on screen, above the WelcomePage, rather than hidden off the bottom scroll, which can result in confusion and make you think your change had no effect.


Patch:
diff --git a/blueprints/app/files/app/templates/application.hbs b/blueprints/app/files/app/templates/application.hbs
index 6ff52759d..cc9e0748f 100644
--- a/blueprints/app/files/app/templates/application.hbs
+++ b/blueprints/app/files/app/templates/application.hbs
@@ -1,8 +1,10 @@
 {{page-title "<%= namespace %>"}}
+<% if (welcome) { %>
+{{outlet}}
 
-<% if (welcome) { %>{{! The following component displays Ember's default welcome message. }}
+{{! The following component displays Ember's default welcome message. }}
 <WelcomePage />
-{{! Feel free to remove this! }}
-<% } else { %><h2 id="title">Welcome to Ember</h2>
-<% } %>
-{{outlet}}
\ No newline at end of file
+{{! Feel free to remove this! }}<% } else { %>
+<h2 id="title">Welcome to Ember</h2>
+
+{{outlet}}<% } %>
\ No newline at end of file


Test patch:
diff --git a/tests/fixtures/addon/pnpm/tests/dummy/app/templates/application.hbs b/tests/fixtures/addon/pnpm/tests/dummy/app/templates/application.hbs
index 8e7f167a0..8c256e30c 100644
--- a/tests/fixtures/addon/pnpm/tests/dummy/app/templates/application.hbs
+++ b/tests/fixtures/addon/pnpm/tests/dummy/app/templates/application.hbs
@@ -1,7 +1,7 @@
 {{page-title "Dummy"}}
 
+{{outlet}}
+
 {{! The following component displays Ember's default welcome message. }}
 <WelcomePage />
-{{! Feel free to remove this! }}
-
-{{outlet}}
\ No newline at end of file
+{{! Feel free to remove this! }}
\ No newline at end of file
diff --git a/tests/fixtures/addon/yarn/tests/dummy/app/templates/application.hbs b/tests/fixtures/addon/yarn/tests/dummy/app/templates/application.hbs
index 8e7f167a0..8c256e30c 100644
--- a/tests/fixtures/addon/yarn/tests/dummy/app/templates/application.hbs
+++ b/tests/fixtures/addon/yarn/tests/dummy/app/templates/application.hbs
@@ -1,7 +1,7 @@
 {{page-title "Dummy"}}
 
+{{outlet}}
+
 {{! The following component displays Ember's default welcome message. }}
 <WelcomePage />
-{{! Feel free to remove this! }}
-
-{{outlet}}
\ No newline at end of file
+{{! Feel free to remove this! }}
\ No newline at end of file
diff --git a/tests/fixtures/app/defaults/app/templates/application.hbs b/tests/fixtures/app/defaults/app/templates/application.hbs
index 0d0ebcc93..00697db19 100644
--- a/tests/fixtures/app/defaults/app/templates/application.hbs
+++ b/tests/fixtures/app/defaults/app/templates/application.hbs
@@ -1,7 +1,7 @@
 {{page-title "Foo"}}
 
+{{outlet}}
+
 {{! The following component displays Ember's default welcome message. }}
 <WelcomePage />
-{{! Feel free to remove this! }}
-
-{{outlet}}
\ No newline at end of file
+{{! Feel free to remove this! }}
\ No newline at end of file
diff --git a/tests/fixtures/app/pnpm/app/templates/application.hbs b/tests/fixtures/app/pnpm/app/templates/application.hbs
index 0d0ebcc93..00697db19 100644
--- a/tests/fixtures/app/pnpm/app/templates/application.hbs
+++ b/tests/fixtures/app/pnpm/app/templates/application.hbs
@@ -1,7 +1,7 @@
 {{page-title "Foo"}}
 
+{{outlet}}
+
 {{! The following component displays Ember's default welcome message. }}
 <WelcomePage />
-{{! Feel free to remove this! }}
-
-{{outlet}}
\ No newline at end of file
+{{! Feel free to remove this! }}
\ No newline at end of file
diff --git a/tests/fixtures/app/yarn/app/templates/application.hbs b/tests/fixtures/app/yarn/app/templates/application.hbs
index 0d0ebcc93..00697db19 100644
--- a/tests/fixtures/app/yarn/app/templates/application.hbs
+++ b/tests/fixtures/app/yarn/app/templates/application.hbs
@@ -1,7 +1,7 @@
 {{page-title "Foo"}}
 
+{{outlet}}
+
 {{! The following component displays Ember's default welcome message. }}
 <WelcomePage />
-{{! Feel free to remove this! }}
-
-{{outlet}}
\ No newline at end of file
+{{! Feel free to remove this! }}
\ No newline at end of file