Skip to content

docs(router): Move ActivatedRoute example to mini-app - #29755

Closed
frederikprijck wants to merge 1 commit into
angular:masterfrom
frederikprijck:docs/router
Closed

frederikprijck wants to merge 1 commit into
angular:masterfrom
frederikprijck:docs/router

Conversation

@frederikprijck

@frederikprijck frederikprijck commented Apr 7, 2019 •

Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?
As requested in #29752, this PR moves the example of that PR to a mini-app in such a way that the example is guaranteed to be compilable.

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@frederikprijck
frederikprijck marked this pull request as ready for review April 7, 2019 20:49
@frederikprijck
frederikprijck requested a review from a team April 7, 2019 20:49
@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎉 Thx ❤️

The CI failure is legit. You need to apply this change; i.e. change packages/tsconfig.json like this:

-    "examples/*/main.ts",
+    "examples/**/main.ts",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you are not using ts_library and protractor_web_test_suite here (👀), you don't need to import them 😁

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: Since the component metadat are not relevant for the example (and it seems confusing to have an ActivatedRouteComponent with an example-app selector), consider either hiding them away or create an additional AppComponent:

Option 1:

@Component({
  // #enddocregion activated-route
  selector: 'example-app',
  template: '...',
  // #docregion activated-route
})

Option 2:

@Component({selector: 'activated-route', template: '...'})
export class ActivatedRouteComponent { ... }
// #enddocregion activated-route

@Component({selector: 'example-app', template: '...'})
export class ExampleAppComponent { ... }

Comment thread packages/router/src/router_state.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: A different name would seem more "realistic" 😛 E.g. app.component.ts or activated-route.component.ts.

@gkalpak gkalpak added comp: docs area: router target: patch This PR is targeted for the next patch release labels Apr 9, 2019
@ngbot ngbot Bot added this to the needsTriage milestone Apr 9, 2019
@frederikprijck
frederikprijck requested a review from a team April 10, 2019 19:51
@mary-poppins

Copy link
Copy Markdown

@frederikprijck

Copy link
Copy Markdown
Contributor Author

@gkalpak I've updated the PR to resolve your comments!

@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@mary-poppins

Copy link
Copy Markdown

@gkalpak gkalpak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One minor comments. Other than that LGTM.
Thx for working on this ❤️

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please ensure that this comment does not end up in the code snippet?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@gkalpak gkalpak added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed state: WIP labels Apr 11, 2019
@mary-poppins

Copy link
Copy Markdown

@brandonroberts

Copy link
Copy Markdown
Contributor

@gkalpak shouldn't the Bazel config go into the router folder so its consistent with the setup of the other examples?

@gkalpak

gkalpak commented Apr 17, 2019 •

Copy link
Copy Markdown
Member

Not all example are set up equally 😛
For example, upgrade examples have per-directory BUILD.bazel files. As far as I understand (and it is not very far when it comes to bazel), it makes sense to have on config per project. Some examples are set up to have one project per top-level directory (and load the sub-examples as routes to that main app) and others are/will be set up as one project per sub-directory.

In some case it makes a difference (e.g. the upgrade examples use different bootstrapping, so they can all be part of a single app), but in this case it probably doesn't. I just thought that having a project in the sub-directory avoid unnecessary boilerplate. It might make sense to move to the "one main app - multiple sub-examples as routes" if we get more router examples.

In any case, I don't feel strongly about this. Leaving it up to you. (You know more than me about running examples with bazel anyway 😉)

@frederikprijck

Copy link
Copy Markdown
Contributor Author

Im not sure if i should still make changes of not. I think both arguments make sense...

@gkalpak

gkalpak commented May 7, 2019

Copy link
Copy Markdown
Member

CI is red and it doesn't look like a flake. (Might need another rebase on master.)

@mary-poppins

Copy link
Copy Markdown

@gkalpak gkalpak added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels May 8, 2019
@alxhub

alxhub commented May 8, 2019

Copy link
Copy Markdown
Member

Presubmit (note this will have the build_test failing due to a missing g3 patch for another PR still pending in the sync)

@alxhub alxhub closed this in 9a807bd May 8, 2019
alxhub pushed a commit that referenced this pull request May 8, 2019
@frederikprijck
frederikprijck deleted the docs/router branch May 12, 2019 14:02
BioPhoton pushed a commit to BioPhoton/angular that referenced this pull request May 21, 2019
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: router cla: yes effort1: hours risk: low target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants