Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Conversation

@feloy
Copy link
Contributor

@feloy feloy commented Nov 19, 2017

Refs issue #150

VSCode has made some reformatting (mostly " -> '), I can revert them if needed.

@codecov-io
Copy link

codecov-io commented Nov 19, 2017

Codecov Report

Merging #161 into master will decrease coverage by 5.31%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #161      +/-   ##
==========================================
- Coverage   91.02%   85.71%   -5.32%     
==========================================
  Files           7        8       +1     
  Lines          78       91      +13     
  Branches        5        4       -1     
==========================================
+ Hits           71       78       +7     
- Misses          6       13       +7     
+ Partials        1        0       -1
Impacted Files Coverage Δ
src/app/operators/operators.component.ts 100% <100%> (+14.63%) ⬆️
src/app/app.component.ts 57.14% <52.63%> (-42.86%) ⬇️
src/app/services/seo.service.ts 70% <70%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 989fd3a...2dd4ab7. Read the comment docs.

.fragment
.subscribe(name => this.scrollToOperator(name));
this._subscription = this._activatedRoute.fragment.subscribe(name =>
this.scrollToOperator(name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@feloy - This subscription is not required anymore since we don't use fragments.

constructor(private _title: Title, private _meta: Meta) {}

public setHeaders(titleParts: string[], description: string) {
this._title.setTitle([...titleParts, this.siteTitle].join(' \u2022 '));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Right now the title is combine all combination RxJS Documentation . I would have expected the reverse, just wanted to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is recommended to put most specific words at the beginning of the title

public homeDescription = 'The complete RxJS documentation...';
public operatorsDescription = 'All the RxJS operators...';
public companiesDescription = 'Companies that use RxJS...';
public teamDescription = 'People behind the RxJS Documentation project...';
Copy link
Collaborator

@ashwin-sureshkumar ashwin-sureshkumar Nov 20, 2017

Choose a reason for hiding this comment

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

Would it be better to utilize an const Object for page seo meta data, something like

{ 
     home : { 
         title : 'Home page title',
         description: 'Home page description', 
      },  
      .....
}

This way we can access it per page

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not store this data in the route config and listen to router events to update the title and SEO instead of setting it from each component?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree, this seems ideal. ☝️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you agree that I make it the way it is done in this sample app, defining the data in the route config directly (via an external file if we want to facilitate translations) and processed with guards:

https://github.com/feloy/ng-universal-demystified/blob/master/src/app/app.module.ts

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with using the route config but don't think it needs to be processed with guards. You can get the activated route from the route tree in the NavigationEnd event.

Here is an plunker: http://plnkr.co/edit/6iVjZcnqKBi7Dpp3KrFX?p=info

The components.ts has the example code.

@ashwin-sureshkumar
Copy link
Collaborator

@feloy - This is awesome ! just few comments and questions.

@feloy
Copy link
Contributor Author

feloy commented Nov 20, 2017

Thanks @ashwin-sureshkumar I'll work on the comments during the week.

@ladyleet
Copy link
Member

😍👯

private _router: Router,
private _activatedRoute: ActivatedRoute,
@Inject(OPERATOR_TOKEN) public operators: OperatorDoc[],
private _seo: SeoService

Choose a reason for hiding this comment

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

Since this is an Angular project I believe it's worth sticking to their official style guide that discourages from prefixing private variables with _. See https://angular.io/guide/styleguide#style-03-04

Copy link
Collaborator

@btroncone btroncone Nov 20, 2017

Choose a reason for hiding this comment

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

This is debatable, in the material docs project _ is being used for private. I prefer this convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to stick to the existing code in the project and use _

import { Router, ActivatedRoute } from '@angular/router';
import { SeoService } from '../../../services/seo.service';
import { OperatorDoc } from '../../../../operator-docs/operator.model';
import 'rxjs/add/operator/pluck';

Choose a reason for hiding this comment

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

Maybe it'll be better to use only lettable operators when this project is already using RxJS 5.5.2?

Copy link
Member

Choose a reason for hiding this comment

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

hi @martinsik and thanks for popping in to say hi! :) thx for reviewing this PR.

this.operator =
this.operators.filter(
(operator: OperatorDoc) => operator.name === name
)[0] || this.notfound();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use a map here rather than filtering through array each time?

@feloy
Copy link
Contributor Author

feloy commented Nov 20, 2017

I would like to add some tests, otherwise I think I've replied to all your comments.
Edit: I also have to put the operators in a map once and for all instead of filtering each time

this.operators.filter(
(operator: OperatorDoc) => operator.name === name
)[0] || this.notfound();
if (name in this.operatorsMap) {
Copy link
Collaborator

@ashwin-sureshkumar ashwin-sureshkumar Nov 24, 2017

Choose a reason for hiding this comment

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

@feloy - Can use Map instead of object to create a map of operators. This works as well, but map being explicit. Just a suggestion

@ashwin-sureshkumar
Copy link
Collaborator

@sumitarora @btroncone - Can you please review when you get a chance ?

@sumitarora
Copy link
Collaborator

@feloy Can you rebase it and have 1 commit for all the work.

@sumitarora
Copy link
Collaborator

@ashwin-sureshkumar Reviewed and approved just if @feloy Can rebase it that would be great else should be good to merge.

@feloy
Copy link
Contributor Author

feloy commented Nov 27, 2017

Ok, I'll make a rebase asap

@ashwin-sureshkumar ashwin-sureshkumar merged commit 4432b01 into ReactiveX:master Nov 27, 2017
@ladyleet
Copy link
Member

so lovely! this is great @feloy!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants