Add Firebase SDK realtime updates and Server-Side Rendering #126
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Firebase SDK realtime updates and Server-Side Rendering
Summary
This PR implements the two improvements identified in the README (lines 67-70):
Phase 1: Firebase SDK Integration
@angular/fire@6.1.5andfirebase@8.10.1(compatible with Angular 9)FirebaseAPIServicethat connects tohttps://hacker-news.firebaseio.com/v0/with realtime listenersAPIServiceabstraction layer that switches betweenHackerNewsAPIService(REST) andFirebaseAPIServicebased onsettings.useFirebaseSDKFeedComponent,ItemDetailsComponent,UserComponent) to useAPIServicePhase 2: Server-Side Rendering
@angular/platform-server,@nguniversal/express-engine)app.server.module.ts,main.server.ts, andtsconfig.server.jsonangular.jsonserver.ts) for SSRSettingsServicewithisPlatformBrowserchecksTesting Performed
Review & Testing Checklist for Human
🔴 Critical Issues to Address:
package-lock.json- This repo uses Yarn (yarn.lock exists). The addition of package-lock.json is causing CI/Snyk inconsistencies. Runrm package-lock.jsonand useyarnexclusively.ng build --prod && ng run angular-hnpwa:server:productionto verify server build works.🟡 Important Verification:
Test Plan:
yarn install(not npm)export NODE_OPTIONS=--openssl-legacy-provider && yarn startNotes
View original video (recording-aa207fe0-a7b8-4ddb-9f09-6d893a4824f4-edited.mp4)
https://node-hnapi.herokuapp.com)isPlatformBrowserchecks for SSR compatibilityLink to Devin run: https://app.devin.ai/sessions/d574293cf433481faf5aab3fbf7bf214
Requested by: Daniella Grimberg (daniella.grimberg@cognition.ai) / @danigrim