Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs:(Tour of Hero Chapter - Http) #1066

Merged
merged 3 commits into from
May 19, 2016

Conversation

thelgevold
Copy link
Contributor

@wardbell @johnpapa @Foxandxss @filipesilva
I am creating a new PR for my TOH Http chapter due to an issue with my original branch.
Your previous comments can be found here: #1044

I consider this ready for review now, so please let me know if there is anything I should change.

As we discusses I am sticking to promises, but mention that alternatives like Observables exist. I am happy add to this if you think we need more details about Observables since I don't really cover details about them beyond acknowledging their existence :-)

I am using the in memory web api, but link to the appendix in the http developer guide for the configuration details. Let me know if we need to bring more of the details into the TOH guide.

Thanks,
Tor

@Foxandxss
Copy link
Member

Sure, let me read it and I will comment out the little details I see

:marked
## Heroes and Http

Let's look back at our `HeroService` implementation in the <a href="/docs/ts/latest/tutorial/toh-pt4.html">services</a> chapter. Specifically let's revisit the point we made about using promises when loading heroes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this "callbacks" to previous content as a recap but about this one... I guess that the user will have this HeroService open from his work through the tutorial so she/he can see the function you are talking about. Problem I see is that the link sends you to the entire document instead of showing the concrete piece you are talking about.

Personally I would give a better link or simply +makeExample using the toh-4 source and showing it directly.

Thoughts?

@Foxandxss
Copy link
Member

So I read it, very nice, I like it. I left you a few comments but let's see what @wardbell has to say about them.

The only part I found more problematic is the "Integration with Http" one. I love what we are doing with the tutorial, about going the "the whole nine yards" (explaining everything) and that part is a bit rushed.

To be honest, I am not sure what to do here. Perhaps I would add a few snippets in how you import all the needed stuff and how I apply them (including the in memory stuff). Give a little explanation (basically the one you put about not using a real http server but an in memory one) and put a subsection linking to the detailed documentation.

The idea is to not force the user to go to another page to complete the tutorial.

WDYT?

@thelgevold thelgevold force-pushed the tour-of-heroes-http-tor branch from fb567f9 to 72681cd Compare April 9, 2016 13:09
@thelgevold
Copy link
Contributor Author

Thanks for your feedback @Foxandxss .

I have made a few tweaks based on your suggestions.
-Included the function declaration in the snippers
-used underscore for private methods
-called out the save method in HeroService

I have to think about HTTP_PROVIDERS and maybe provide a snippet for that in isolation . I purposely tried to avoid bringing in too much of the api simulation stuff since I think it might be confusing. My guess is that most users will integrate directly with their own apis so seeing SEED_DATA and XHRBackend in the snippet might confuse them....

@Foxandxss
Copy link
Member

I think that it is better to reach some middle ground. Not giving all the details like the attached document nor leaving the user do it by himself. A little information + snippets + link to more details is a good middle ground for me.

I don't think that people have a Heroes API so they are more likely going to do what yo do in the tutorial, so we need to explain them how to do it "our way" and if they want to implement so real backend, they can see that as an exercise.

@thelgevold thelgevold force-pushed the tour-of-heroes-http-tor branch from 72681cd to e1a9e7a Compare April 9, 2016 19:08
@thelgevold
Copy link
Contributor Author

Yeah, I think that is a fair point. I have added a snippet and tried to make it more clear which imports are needed for http in general, and which ones are there just for the simulator.

+makeExample('toh-6/ts/index.html', 'http', 'index.html (http)')(format=".")

:marked
The only other thing we have to do is import `HTTP_PROVIDERS` from `angular2/http` and register it `AppComponents`'s provider array.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are missing some words or something in this sentence. That and register it AppComponents' provider array is weird to read.

On the other hand, I think that AppComponents' doesn't have an extra s after the apostrophe in this case.

@Foxandxss
Copy link
Member

In my opinion, you did an awesome job with the new change. Not too much nor too little.

@thelgevold thelgevold force-pushed the tour-of-heroes-http-tor branch from e1a9e7a to 38dc1cc Compare April 10, 2016 01:38
@thelgevold
Copy link
Contributor Author

Thanks! Yeah I fixed the grammar error

@thelgevold thelgevold force-pushed the tour-of-heroes-http-tor branch from 38dc1cc to 2b98e2f Compare April 10, 2016 01:40
:marked
# Http

Our application has become a huge success and our stakeholders have already expanded the vision to include integration with a hero api.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove "already". Otherwise love the intro.

@thelgevold
Copy link
Contributor Author

@naomiblack I believe this is pending final review by @wardbell and @johnpapa

@johnpapa
Copy link
Contributor

I’ll review it this weekend. I’m speaking at 3 sessions, 2 full day workshop,s and filming 4 videos this week … so I’m a bit beat :)

@thelgevold
Copy link
Contributor Author

That sounds great!

@wardbell wardbell force-pushed the tour-of-heroes-http-tor branch from 64d76de to 86668a0 Compare April 23, 2016 22:04
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@wardbell wardbell force-pushed the tour-of-heroes-http-tor branch 2 times, most recently from 8cf2b1f to 913f1d3 Compare April 25, 2016 20:21
@wardbell wardbell force-pushed the tour-of-heroes-http-tor branch from 913f1d3 to 7cc61cc Compare May 19, 2016 01:42
@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@wardbell wardbell force-pushed the tour-of-heroes-http-tor branch from 7cc61cc to b676596 Compare May 19, 2016 01:58
@wardbell wardbell force-pushed the tour-of-heroes-http-tor branch from b676596 to e4db340 Compare May 19, 2016 06:38
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@wardbell
Copy link
Contributor

Well done, Tor! And thanks also to everyone who reviewed it.

I scrubbed and adjusted for our latest thinking about RxJS operators and where to configure the in-memory web api.

I added two more commits:

  1. Removed the Tutorial sample code because it is always the latest part in the series. THIS is now the latest in the series. I combined the old Tutorial e2e tests with Tor's for this chapter.

  2. Removed the unneeded HeroDetailComponent reference and directive from HeroesComponent as suggested in issue docs(ts/tutorial/routing): Remove HeroDetailComponent in HeroesComponent file #1398.

Merging now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants