Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@schematics/angular): cli app redesign #14403

Merged
merged 10 commits into from Aug 12, 2019
Merged

Conversation

@sjtrimble
Copy link
Contributor

sjtrimble commented May 11, 2019

  • Updated ng new template design
  • Update favicon to be black as default

CC: @IgorMinar

@googlebot googlebot added the cla: yes label May 11, 2019
@sjtrimble sjtrimble force-pushed the sjtrimble:ng-new-redesign branch from 3898182 to 2b18d6f May 11, 2019
@sjtrimble sjtrimble changed the title CLI app redesign feat(@angular/cli): cli app redesign May 11, 2019
@sjtrimble

This comment has been minimized.

Copy link
Contributor Author

sjtrimble commented May 11, 2019

Initial Mockups

Desktop
ngnew-app-desktop-rocket

Mobile
ngnew-app-mobile

@filipesilva

This comment has been minimized.

Copy link
Member

filipesilva commented May 20, 2019

@alexeagle do you know if this should be part of CLI version 8?

/>

<style>
body {

This comment has been minimized.

Copy link
@filipesilva

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.

Copy link
@sjtrimble

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.

@@ -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.

Copy link
@filipesilva

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.

Copy link
@sjtrimble

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.

Copy link
@sjtrimble

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.

Copy link
@filipesilva

filipesilva May 21, 2019

Member

That SGTM, let's roll with it.

@alexeagle alexeagle added this to the 8.0 milestone May 20, 2019
@alexeagle

This comment has been minimized.

Copy link
Collaborator

alexeagle commented May 20, 2019

Looks great to get this into 8, but needs to land by tomorrow

@sjtrimble sjtrimble force-pushed the sjtrimble:ng-new-redesign branch 2 times, most recently from 32b115d to e1fcdcf May 20, 2019
@sjtrimble

This comment has been minimized.

Copy link
Contributor Author

sjtrimble commented May 20, 2019

@alexeagle let me know if there is anything you need from me! I just made the updates and rebased.

@filipesilva filipesilva self-assigned this May 21, 2019
@filipesilva

This comment has been minimized.

Copy link
Member

filipesilva commented May 21, 2019

@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.

@filipesilva

This comment has been minimized.

Copy link
Member

filipesilva commented May 21, 2019

Followup PR in #14484

@alexeagle

This comment has been minimized.

Copy link
Collaborator

alexeagle commented May 21, 2019

@sjtrimble could we remove the changes to index.html? We think developers will accidentally leave these behind in their application.

  1. do we really need the custom font? can we avoid using material icons and fall back to browser built-in font?
  2. can we inline as many styles as possible?
  3. if styles are needed on the body, could they be injected by the component constructor

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

@alan-agius4

This comment has been minimized.

Copy link
Collaborator

alan-agius4 commented May 21, 2019

For fonts maybe we can use @import in the components style file?
See support: https://developer.mozilla.org/en-US/docs/Web/CSS/@import

Copy link
Member

IgorMinar left a comment

let's not make any changes to the index.html.

-moz-osx-font-smoothing: grayscale;
}

body,

This comment has been minimized.

Copy link
@IgorMinar

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.

@sjtrimble

This comment has been minimized.

Copy link
Contributor Author

sjtrimble commented May 21, 2019

Copied over #14484 test fixes per @IgorMinar

@sjtrimble sjtrimble force-pushed the sjtrimble:ng-new-redesign branch from 46d3a35 to c8445f4 May 21, 2019
@sjtrimble

This comment has been minimized.

Copy link
Contributor Author

sjtrimble commented May 21, 2019

Moved all code to the template file for easy removal, except for body zero padding/margin styles.

@IgorMinar IgorMinar modified the milestones: 8.0, Backlog May 23, 2019
@IgorMinar

This comment has been minimized.

Copy link
Member

IgorMinar commented May 23, 2019

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.

@vthinkxie

This comment has been minimized.

Copy link

vthinkxie commented Jul 4, 2019

any update on this, it seems that 8.1 has not included this feat

@mgechev mgechev modified the milestones: 8.1.x, 8.2.x Jul 19, 2019
@mgechev

This comment has been minimized.

Copy link
Member

mgechev commented Jul 19, 2019

Let's see if we can release it as part of version 8.2.

@vikerman

This comment has been minimized.

Copy link
Contributor

vikerman commented Jul 25, 2019

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:

  • No changes to index.html
  • All changes the user need to do while changing it to their are restricted to app.component.html, app.component.css
  • Sort of simple CSS for the app component. The current one is very long
  • Use a system font without needing to link to an external font file
@vikerman vikerman assigned vikerman and unassigned filipesilva Jul 25, 2019
@sjtrimble sjtrimble force-pushed the sjtrimble:ng-new-redesign branch from c8445f4 to 6f38341 Aug 2, 2019
@sjtrimble

This comment has been minimized.

Copy link
Contributor Author

sjtrimble commented Aug 2, 2019

  1. I rebased on the latest master so everything is fresh.
  2. I removed the external font references/links and replaced with system fonts.
  3. 🔸 Let's chat about the CSS - I think there is value in having a presentable and visually appealing first impression but perhaps we can simplify the code a bit.
  4. I removed everything additional from the index.html file.
@sjtrimble sjtrimble force-pushed the sjtrimble:ng-new-redesign branch from 70aa987 to 07852d2 Aug 5, 2019
@sjtrimble

This comment has been minimized.

Copy link
Contributor Author

sjtrimble commented Aug 5, 2019

@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.

Copy link
@IgorMinar

IgorMinar Aug 8, 2019

Member

remove?

This comment has been minimized.

Copy link
@sjtrimble

sjtrimble Aug 9, 2019

Author Contributor

I assume you mean the extra line space here?

Copy link
Member

IgorMinar left a comment

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.

Copy link
@IgorMinar

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.

Copy link
@IgorMinar

IgorMinar Aug 8, 2019

Member

commented out?


</div>

<!-- *** Template Code Ends *** -->

This comment has been minimized.

Copy link
@IgorMinar

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!

@sjtrimble sjtrimble force-pushed the sjtrimble:ng-new-redesign branch from 07852d2 to 3853f88 Aug 9, 2019
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
<!-- * * * * * * * * * Delete the template below * * * * * * * * * * -->

This comment has been minimized.

Copy link
@vikerman

vikerman Aug 9, 2019

Contributor

It's not below :) We can probably leave this sentence out in this part.

This comment has been minimized.

Copy link
@vikerman

vikerman Aug 9, 2019

Contributor

Or maybe just say - End of placeholder

This comment has been minimized.

Copy link
@sjtrimble

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 :)

Copy link
Member

mgechev left a comment

LGTM. The failures are caused by:

  • Few commit messages without a scope
  • Size has increased a bit because of the template & style updates
  • Failures caused by framework's release as @alan-agius4 pointed out

@vikerman, as discussed, I think we're ready to merge.

@mgechev mgechev requested a review from IgorMinar Aug 12, 2019
@mgechev mgechev changed the title feat(@angular/cli): cli app redesign feat(@schematics/angular): cli app redesign Aug 12, 2019
@mgechev mgechev merged commit 40601c4 into angular:master Aug 12, 2019
13 of 17 checks passed
13 of 17 checks passed
ci/angular: merge status Status "ci/angular: size" is failing, status "ci/circleci: e2e-cli-ivy" is failing, status "ci/circleci: validate" is failing, missing re...
ci/angular: size cli/new-production/test-project/main-es5.js increased by 33.33KB.
ci/circleci: e2e-cli-ivy Your tests failed on CircleCI
Details
ci/circleci: validate Your tests failed on CircleCI
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build-bazel Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli-ng-snapshots Your tests passed on CircleCI!
Details
ci/circleci: flake-jail Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test-browsers Your tests passed on CircleCI!
Details
ci/circleci: test-large Your tests passed on CircleCI!
Details
ci/circleci: test-large-ivy Your tests passed on CircleCI!
Details
ci/circleci: test-win Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

angular-automatic-lock-bot bot commented Sep 13, 2019

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants
You can’t perform that action at this time.