-
Notifications
You must be signed in to change notification settings - Fork 875
docs(architecture): proofread, updated Dart app #1807
Conversation
@kwalrath @thso : Dart-side commit ready for review. |
header Dart difference: Module is a compilation unit | ||
:marked | ||
The term "module" used in this guide refers to a | ||
Dart _compilation unit_, i.e., a _library_ or _part_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. -> that is
(many people don't know what i.e. means)
Actually, though... do we really need to mention parts? They're strongly discouraged. Also, people might not know that each file without a library
directive is itself a library. Perhaps instead:
In this guide, the term module refers to a Dart compilation unit, such as a library. If a Dart file has no library
or part
directive, then that file itself is a library and thus a compilation unit. For more information...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed as you suggested with tweaks we agree to elsewhere (in particular clarifying that a Dart package is also a module).
Looking good! Once you address a few comments, the Dart side is good to go. |
5488fec
to
f20221c
Compare
Dart-side issues addressed. |
LGTM! @Foxandxss or @wardbell, who's going to review the TS side? |
70f6eeb
to
a59aafe
Compare
selector: 'sales-tax', | ||
template: ''' | ||
<h2>Sales Tax Calculator</h2> | ||
Amount: <input #amountBox (input)="0" type="number"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What triggered this change (also in TS)? I am not sure I like (input)
as the event name. I don't know, I guess it is just me but I liked (change)
more. Input is also the element name so as an event again is weird. Also input
sounds more like an input (pun intended) than as an output.
On the other hand, the number input is really broken in other browsers. I don't think they are fixed yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triggering on onInput
rather than onChange
makes for a more responsive user experience (UX). Again, using type="number"
makes for a better UX in those browsers that support it, and makes no difference (from the app processing point of view) in those browsers that do not support it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert to (change)
. We're not trying to be responsive. We're trying to make a point about how (someEvent)="0"
is a trick to cause dirty checking when the user enters something. (input)
invites the kind of distracting question that Jesus asked.
Please revert type="number"
. This is a distraction from the point. Again, we're not looking to produce the best app solution here. We're trying to make a narrow point. Let's not add distractions from that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Undone.
:marked | ||
Perhaps the first module we meet is a module that exports a *component* class. | ||
The component is one of the basic Angular blocks, we write a lot of them, | ||
and we'll talk about components in the next segment. For the moment it is enough to know that a | ||
component class is the kind of thing we'd export from a module. | ||
|
||
Most applications have an `AppComponent`. By convention, we'll find it in a file named `app.component.ts`. | ||
Most applications have an `AppComponent`. By convention, we'll find it in a file named `!{_app_comp_filename}`. | ||
Look inside such a file and we'll see a declaration like this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace like with such as:
Look inside such a file and we'll see a declaration such as this one.
Please update ts/architecture.jade as follows: |
I am uncomfortable with certain changes in the e2e tests, most especially the tests-that-are-not-tests such as
and
The second is also not accepted because it delegates to I think I know why you created these tests; they are a clever way to slip in an async operation w/o waiting for it. But they depend upon test order which test suites should not do. Move one of these tests and the suite fails. I realize that a great number of our e2e tests have this failing (when you see |
Unfortunately, this PR is NOT based on an IdeaBlade branch. That means I can't fix it. You and Kathy have the ability to add branches to Please base all future PRs on branches in |
<div *ngFor="let hero of heroes" (click)="selectHero(hero)"> | ||
{{hero.name}} | ||
</div> | ||
<ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why switch from <div>
to <ul><li>
? That a distraction. I wanted less code on the page. I didn't want to have to deal with the bullets of a <ul>
.
I'm not going to insist on reverting this. But I think you are mistakenly trying to improve the code at the expense of the clarity of the Template Syntax.
"LESS HTML IS MORE"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
1c87901
to
f38496f
Compare
- e2e tests now also cover the tax calculator. - Dart app updated to match TS (it had no sales tax calculator). - TS sample source cleanup (e.g. removed many unnecessary `docregions`). - Prose updated to include @kwalrath's revisions from a while ago, with some of my edits as well. Contributes to angular#1598 and angular#1508.
- e2e tests now also cover the tax calculator. - Dart app updated to match TS (it had no sales tax calculator). - TS sample source cleanup (e.g. removed many unnecessary `docregions`). - Prose updated to include @kwalrath's revisions from a while ago, with some of my edits as well. Contributes to angular#1598 and angular#1508.
f38496f
to
5b53d6b
Compare
Thanks. Merging. |
Note that there are two commits: one for each of TS- and Dart-side changes.
docregions
).Contributes to #1598 and #1508.