Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfeat(@schematics/angular): cli app redesign #14403
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@alexeagle do you know if this should be part of CLI version 8? |
| /> | ||
|
|
||
| <style> | ||
| body { |
This comment has been minimized.
This comment has been minimized.
filipesilva
May 20, 2019
Member
These styles should be in src/styles.css. But they might be unusable there if the user chooses a CSS extension whose syntax isn't a superset of basic css. like sass. Perhaps we should make an extra src/demo-styles.css (or some other name).
This comment has been minimized.
This comment has been minimized.
sjtrimble
May 20, 2019
Author
Contributor
The idea was to keep them in the index file (even though not really the way things are normally done) so that the user can easily delete all of the template code in one full swoop.
...s/schematics/angular/application/other-files/app.component.html.template
Outdated
Show resolved
Hide resolved
...s/schematics/angular/application/other-files/app.component.html.template
Outdated
Show resolved
Hide resolved
| @@ -7,6 +7,311 @@ | |||
|
|
|||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |||
| <link rel="icon" type="image/x-icon" href="favicon.ico"> | |||
| <link | |||
This comment has been minimized.
This comment has been minimized.
filipesilva
May 20, 2019
Member
I feel users might just forget these here when removing the demo code.
I tried moving them into src/styles.css like this:
@import "https://fonts.googleapis.com/css?family=Roboto";
@import "https://fonts.googleapis.com/css?family=Roboto+Mono";
@import "https://fonts.googleapis.com/icon?family=Material+Icons";
And it does work, in Chrome at least. But it's not converted to anything else. It relies on native browser support for @import in CSS. This it wouldn't be a great choice either. Might just be better to keep it here.
This comment has been minimized.
This comment has been minimized.
sjtrimble
May 20, 2019
Author
Contributor
I see your point about it not being obvious for users to delete. Like with the rest of the CSS I like having it all in one place to just focus on one file when removing template code.
What if we add comments for now that say "remove this template code"? I'll implement that for now until we come up with something better.
This comment has been minimized.
This comment has been minimized.
sjtrimble
May 20, 2019
Author
Contributor
Added the comments <!-- *** Remove Template Code Below *** --> and <!-- *** Template Code Ends *** --> in both template and in index files.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Looks great to get this into 8, but needs to land by tomorrow |
32b115d
to
e1fcdcf
This comment has been minimized.
This comment has been minimized.
|
@alexeagle let me know if there is anything you need from me! I just made the updates and rebased. |
This comment has been minimized.
This comment has been minimized.
|
@sjtrimble I'll pick it up from here and fix the failing tests. They are mostly related to the unit tests and e2e expecting the old structure. |
This comment has been minimized.
This comment has been minimized.
|
Followup PR in #14484 |
This comment has been minimized.
This comment has been minimized.
|
@sjtrimble could we remove the changes to index.html? We think developers will accidentally leave these behind in their application.
we want it to be sufficient to delete the component and then you have a clean starting point for an app without any of this boilerplate left behind |
This comment has been minimized.
This comment has been minimized.
|
For fonts maybe we can use |
|
let's not make any changes to the index.html. |
| -moz-osx-font-smoothing: grayscale; | ||
| } | ||
|
|
||
| body, |
This comment has been minimized.
This comment has been minimized.
IgorMinar
May 21, 2019
Member
could we move all of these stylesheets into the component itself? We can't rely on people to correctly remove the style sheet from their app.
You can use https://next.angular.io/guide/component-styles#host-context to get the sheets into the top level document stylesheet.
And for the fonts or anything else that can't be added via that method, we could just inject the https://next.angular.io/api/common/DOCUMENT into the component constructor and do manual dom manipulation from there to create and append fonts to the document.head.
This comment has been minimized.
This comment has been minimized.
|
Copied over #14484 test fixes per @IgorMinar |
This comment has been minimized.
This comment has been minimized.
|
Moved all code to the template file for easy removal, except for body zero padding/margin styles. |
This comment has been minimized.
This comment has been minimized.
|
Let's get this done in 8.1. I'm sorry for deferring it but there are still questions to resolve and as much as I love this change, we shouldn't rush it and pollute new projects with code that we'll regret in the future. |
This comment has been minimized.
This comment has been minimized.
vthinkxie
commented
Jul 4, 2019
|
any update on this, it seems that 8.1 has not included this feat |
This comment has been minimized.
This comment has been minimized.
|
Let's see if we can release it as part of version 8.2. |
This comment has been minimized.
This comment has been minimized.
|
Hi @sjtrimble - We discussed how to take this forward. We would like to include this as part of the 8.2 release. We would like the starter to have the following properties:
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
@vikerman FYI |
| @@ -7,6 +7,7 @@ | |||
|
|
|||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |||
| <link rel="icon" type="image/x-icon" href="favicon.ico"> | |||
|
|
|||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Considering all the complications with the other approaches I've proposed before, I think having everything in this single file is fine, as long as we leave clear comments about what code belongs to the welcome placeholder and can be removed. I've added a few comments. |
| @@ -1,21 +1,506 @@ | |||
| <!--The content below is only a placeholder and can be replaced.--> | |||
This comment has been minimized.
This comment has been minimized.
IgorMinar
Aug 8, 2019
Member
could you make this a multiline comment full of stars and emojis with a clear text in the middle that the content below should be removed?
something like this, but you can make it even more fancy: https://github.com/angular/angular.js/blob/060bcdeeb9f5181fb885417f68429c86a8e59eb2/src/ngSanitize/sanitize.js#L3-L12
and we should have a similar "banner" at the bottom as well.
| <path id="Path_19" data-name="Path 19" d="M4137.529,1027.283l-7.7-3.723,4.417-2.721,7.753,3.723Z" transform="translate(-4125.003 -1015.199)" fill="#fff"/> | ||
| </svg> | ||
|
|
||
| <!-- <img src="../assets/animations.png" height="20px" alt="Angular Animations Logo"/> --> |
This comment has been minimized.
This comment has been minimized.
|
|
||
| </div> | ||
|
|
||
| <!-- *** Template Code Ends *** --> |
This comment has been minimized.
This comment has been minimized.
IgorMinar
Aug 8, 2019
Member
as mentioned above, this should be a highly visible multiline comment/banner as well so that it's easy to identify. Also at the top you used "placeholder" terminology and down here you are using "Template", can you please make it consistent? thanks!
| <!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * --> | ||
| <!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * --> | ||
| <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --> | ||
| <!-- * * * * * * * * * Delete the template below * * * * * * * * * * --> |
This comment has been minimized.
This comment has been minimized.
vikerman
Aug 9, 2019
Contributor
It's not below :) We can probably leave this sentence out in this part.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sjtrimble
Aug 9, 2019
Author
Contributor
Ahhh, I said above on the first line and forgot the last sentence :) I like your idea of end of placeholder better! Thanks :)
|
LGTM. The failures are caused by:
@vikerman, as discussed, I think we're ready to merge. |
40601c4
into
angular:master
This comment has been minimized.
This comment has been minimized.
angular-automatic-lock-bot
bot
commented
Sep 13, 2019
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |


sjtrimble commentedMay 11, 2019
CC: @IgorMinar