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

docs(AppShell): add guide for the App Shell Runtime Parser #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgechev
Copy link
Member

@mgechev mgechev commented Jul 11, 2016

No description provided.

import { provide } from '@angular/core';
import { APP_BASE_HREF } from '@angular/common';
import { APP_SHELL_RUNTIME_PROVIDERS } from '@angular/app-shell';
import { HelloMobileAppComponent } from './app/';
Copy link
Member

Choose a reason for hiding this comment

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

Should this be ./app/hello-mobile.component?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a barrel generated by the CLI.

Copy link
Member

Choose a reason for hiding this comment

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

I should have known better 😛

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd look nicer without the trailing slash, './app'

@mgechev mgechev force-pushed the app-shell-parser-guide branch from ca2103d to 8967411 Compare July 11, 2016 10:54
context.ngShellParser.match(event.request)
.then((response: any) => {
if (response) return response;
return (<any>self).caches.match(event.request)
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't you use context here (instead of <any>self)?

@mgechev mgechev force-pushed the app-shell-parser-guide branch from 8967411 to 2734416 Compare July 11, 2016 13:34
.then(() => context.ngShellParser.fetchDoc())
.then((res: any) => context.ngShellParser.parseDoc(res))
.then((strippedResponse: any) => {
return (<any>self).caches.open(SHELL_PARSER_CACHE_NAME)
Copy link
Member

Choose a reason for hiding this comment

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

self --> context (?)

@mgechev mgechev force-pushed the app-shell-parser-guide branch 3 times, most recently from b201161 to 4d680e2 Compare July 11, 2016 18:31
@mgechev
Copy link
Member Author

mgechev commented Jul 11, 2016

All the comments are addressed. Let me know if you find anything else.


Now we're going to take a look at another part of the Angular Mobile Toolkit - the App Shell Runtime Parser. The Runtime Parser is a library which has the following features:

- Automatically generates the App Shell of our application by using a predefined template.
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't clearly describe what the parser does. Should make clear that the shell is extrapolated from a fully dynamic prerendered page (though the words "dynamic" and "prerendered" aren't necessarily the most meaningful words to drive the point home). The sentence as it reads now sounds like it's describing the pre-renderer instead of the parser.

@mgechev mgechev force-pushed the app-shell-parser-guide branch from 4d680e2 to d1fcf53 Compare July 13, 2016 07:58
@jeffbcross
Copy link
Contributor

After chatting with @mgechev about this, we decided to wait until the Service Worker extensibility feature (#59) to be complete, so the guide can be simpler.

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

Successfully merging this pull request may close these issues.

3 participants