New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(aio): enable data driven homepage announcements #22043
feat(aio): enable data driven homepage announcements #22043
Conversation
private findCurrentAnnouncement(announcements: Announcement[]) { | ||
return announcements | ||
.filter(announcement => new Date(announcement.startDate).valueOf() < Date.now()) | ||
.filter(announcement => new Date(announcement.endDate).valueOf() > Date.now()) |
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.
nice!
@Component({ | ||
selector: 'aio-announcement-bar', | ||
template: ` | ||
<!-- Announcement Bar --> |
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.
the comment is no longer needed
057ffe1
to
d4dc057
Compare
"message": "Join us in Atlanta for ngATL<br/>Jan 30 - Feb 2, 2018", | ||
"imageUrl": "generated/images/marketing/home/ng-atl.png", | ||
"linkUrl": "http://ng-atl.org/" | ||
} |
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.
This ngATL banner will never be shown as it has expired, but I am leaving it here as an example.
I have not yet added the ng-conf banner because the logo doesn't look right.
@@ -34,7 +35,7 @@ import { ResourceService } from './resource/resource.service'; | |||
* such as CodeExampleComponent, LiveExampleComponent,... | |||
*/ | |||
export const embeddedComponents: Type<any>[] = [ | |||
ApiListComponent, CodeExampleComponent, CodeTabsComponent, ContributorListComponent, | |||
AnnouncementBarComponent, ApiListComponent, CodeExampleComponent, CodeTabsComponent, ContributorListComponent, |
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 think this is not quite right. If we want to get good experience for loading the homepage, we need to bundle the AnnouncementBarComponent within the main bundle. Otherwise we won't be able to fully render the homepage without downloaded the main bundle and the embedded components bundle.
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.
Good point! So the two options are:
- Move the announcements component to the main bundle so it is loaded upfront.
- Move the announcement component to its own bundle, so we don't need to load the other embedded components on the homepage.
The former is simpler but makes the main bundle larger even if someone is going straight to the docs pages. The latter requires a second request, but this could be HTTP preloaded for the homepage.
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.
which do you prefer @IgorMinar ?
Move it to the main bundle please. It's not that much code.
…On Wed, Feb 7, 2018, 2:19 PM Pete Bacon Darwin ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In aio/src/app/embedded/embedded.module.ts
<#22043 (comment)>:
> @@ -34,7 +35,7 @@ import { ResourceService } from './resource/resource.service';
* such as CodeExampleComponent, LiveExampleComponent,...
*/
export const embeddedComponents: Type<any>[] = [
- ApiListComponent, CodeExampleComponent, CodeTabsComponent, ContributorListComponent,
+ AnnouncementBarComponent, ApiListComponent, CodeExampleComponent, CodeTabsComponent, ContributorListComponent,
which do you prefer @IgorMinar <https://github.com/igorminar> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#22043 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AANM6IpuJiID0kYBAdVhLhldbG_kltKbks5tSiFlgaJpZM4R7emY>
.
|
d4dc057
to
ee64148
Compare
Done - PTAL |
You can preview ee64148 at https://pr22043-ee64148.ngbuilds.io/. |
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.
thanks Pete!
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.