Giter VIP home page Giter VIP logo

angular2-hn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular2-hn's Issues

Progressive Web Capabilities

So the next major step for this app would be to make it a full blown progressive web app, and there's a CLI build just for that - Angular Mobile Toolkit.

So here are some of the things that we can do to make this a progressive web application.

  • App Shell functionality
  • Work offline with the help of Service Workers
  • Manifest file so these apps can be installed from browsers

Now the mobile toolkit comes with these features built in to it's configuration but it's still in an alpha stage. Nonetheless I would still prefer to get this done using --mobile, otherwise we can look into using sw-precache and sw-toolbox as well.

P.S. Here's an earlier build of the application using the mobile toolkit so feel free to take a look and see how I did things there. The App Shell and manifest files seemed to have worked but it did not work offline.

Consider using link rel=preload to improve performance

Checking the latest deployment (https://angular2-hn.firebaseapp.com/) over normal 3G, performance is great but a lot of our JS work doesn't get completed until much later on: https://www.webpagetest.org/video/compare.php?tests=170514_00_bb389f33405b558ea644b37f565c8a56-r:1-c:0

I wonder if it would be worth adding in support for <link rel="preload"> so you can tell the browser early on that the following scripts are important:

<script type="text/javascript" src="inline.e195cb797c8ab56372da.bundle.js"></script>
<script type="text/javascript" src="vendor.a39b96651e0f11f342a5.bundle.js"></script>
<script type="text/javascript" src="main.f85b553fbaef45424581.bundle.js"></script>

I've suggested this to a number of sites where it has improved their time to interactivity (it hasn't for everyone) but it might be worth giving a shot.

I might separately also suggest registering SW after the window onload event so that there's no chance of network contention with the main page resources on first load: https://github.com/housseindjirdeh/angular2-hn/blob/master/src/index.html#L62

Supplied parameters do not match any signature of call target.

I get this error in my environment:

client?93b6:76 [default] /Users/vaughanjackson/OneDrive/Projects/AngularJS2/angular-hn/src/app/stories/stories.component.ts:12:17 
Supplied parameters do not match any signature of call target.

unless I alter the code to pass some kind of value into the fill() call:

export class StoriesComponent implements OnInit {
  items: number[];

  constructor() {
    this.items = Array(30).fill().map((x,i)=>i);  <= change 'fill()' to 'fill(0)' for example
  }

My environment is this:

vaughanjackson@Vaughans-MBP angular-hn (master) $ ng --version
angular-cli: 1.0.0-beta.16
node: 4.5.0
os: darwin x64
vaughanjackson@Vaughans-MBP angular-hn (master) $ 

Update [email protected]

Great app but It doesn't work with [email protected] can you update?

Gives this output:

It seems like you're using a project generated using an old version of the Angular CLI.
The latest CLI now uses webpack and includes a lot of improvements, include a simpler workflow, a faster build and smaller bundles.

To get more info, including a step-by-step guide to upgrade the CLI, follow this link:
https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.12

Leverage HTTP/2 server push

With Firebase, leveraging h2 push seems straightforward which is awesome. Tried this quite some time ago but didn't notice any particular wins, however I do think it's something worth exploring again.

AggressiveSplittingPlugin, although experimental, seems to be a viable solution to output multiple smaller chunks that can be pushed from the server. However, spent a bit of time trying to include it and it doesn't output the generated chunks to the html due to an issue with HTMLWebpackPugin. Definitely something to keep an eye on when this gets resolved.

Open to all kinds of suggestions and tips!

Returns to the top of the page when pressing back button

When I click on a link or comment from the front page and go back, the page goes right back to the top again. Any solutions? It happens on mobile and web.

P.S This is my favourite HN PWA, I love the color choices and I think this one of the only PWA's that supports comment collapsing.

header-text div covers clickable home link

The header-text div covers some of the logo you can click to go back to the homepage.
This affects both the mobile and desktop views. Encountered on Chrome 57 and Firefox 50 on OS X.

I will open a PR shortly to fix.

screen shot 2016-12-29 at 16 26 55

Crash trying to create a "file://" dist version

Hello, thanks for your tutorial and project.
I tried to create the prod version with
ng build --aot --prod --bh ./ # or variants
it works when served within a http server but it doesn't when it's called as "file://..."
while the basic angular/cli works generating the "app works!" trivial example.
I have to create a demo, static only, angular2 cli generated dist to be called as "file://" and I tried with your project. I suppose it is just a question of using the right commands 'cause it should not be necessary to have a real webserver, even for the html5 internal routing.
Am I wrong? What is the sequence of shell commands to get, in dist folder, a working version that can be called in the browser as "file://<absolute_path>/dist/index.html"? Thank you for your time.

Show poll results as bars

So thanks to @mateuszwitkowski, we have poll support :)

Now the poll results show simply just like in Hacker News. I think it'll be pretty cool to show a nice poll results section wth bars (or chart) instead. I'm thinking separate bars with the largest result shown at 100% and the others as percentages based on their values (something just like this: https://app.hackerwebapp.com/#/item/6527104). We'll also want to make sure it fits for all screen sizes nicely.

I'm open to other ideas too! It doesn't have to be this exactly so let me know if you have any thoughts.

Open link on browser / share

I'm using the reader as app and so it opens the links inside the app.
Is there a way to open the link in another browser?
Can we get a share functionality to eg. send the current page per mail or add it to pocket (another reader app)?
Thank you very much!

Add poll loading indicator

Our poll results for poll items are fetched individually async, and we have it set up to only show once all the poll results have been fetched. It'll be nice if we had a loading indicator to show until all the poll results show.

Feel free to copy the same loading indicator I used through the app and modify it to fit the poll results area.

IE11 Polyfill?

To start, thank you for your great PWA article and the provided app.

Is there a way to configure the Service Worker internally in the app, either via a polyfill(s) or a flag, so that the app will work without the Service Worker caching in the older browsers such as IE10 or IE11?

Too awesome...

I have an issue. This is too awesome. I've been groping at a similar service for some weeks now and your code has taught me so much. Too much. Tone down the awesomeness will ya? Seriously though. Thanks!

Consider using @angular/service-worker and ng-pwa-tools

This project is using sw-precache instead of the latest @angular/service-worker and ng-pwa-tools.

At Google I/O last week, they announced that https://github.com/GoogleChrome/workbox would be the preferred option over sw-precache going forward.

However, Angular seems to be creating a better integrated SW and PWA story using the tools mentioned above. That said, it would be interesting to see if these tools actually reduce the size of the config and improve performance or load time.

Investigate support for Angular view compiler

It's been so great seeing how far this has come since you started adding sw-toolbox and sw-precache. Glad the suggestions were useful :)

On desktop, you're doing pretty well on our latest version Lighthouse as you know:

screen shot 2017-03-06 at 9 55 39 pm

Seems like switching to AoT support made a nice little dent :)

If you wanted to get those time to interactive numbers down further, you might consider trying out the new view compiler that landed in Angular master:

https://twitter.com/robwormald/status/834938328294154240

Are you using H/2 Server Push? (saw some related commits in master)

Realtime support

This app is awesome! I see that it uses REST requests rather than the realtime SDK. Is there a reason why you went this route?

Share functionality

@SeriousM mentioned that it would be great have the ability to share story links or the comment's page for a story. Would love to get some suggestions on whether anyone thinks this is something we definitely need and if so, how/what should we implement exactly.

Sending by mail should be simple, but should we include other avenues (social media) as well? Integration with Pocket has been mentioned, but not sure if we should spend time wrestling it's API if not too many people use it.

Poll support in mobile

So thanks to @mateuszwitkowski, we have poll support! :)

But they don't currently show in mobile :(. All that needs to be done is just updating the mobile section of 'item-comments.component.html' to include the poll information

Server side rendering

Would be interesting to see if we can get some parts of the app (if not all) working without any JS on the browser using Angular Universal. Never used Universal before so would love suggestions/tips.

Service worker functionality in README

Hey. I love this hn client, great work.

Is there a typo in the docs for the service worker (PWA) part and in the package.json.

It says:
npm run sw to generate the service worker file
npm run static-serve to load the application along with the service worker asset using lite-server

I had to:
npm run precache instead of npm run sw
install lite-server from npm
change static-serve script to use lite-server not live-server
npm run static-serve

Should we add more detailed steps to docs and/or change package.json script too?

You should build with AOT

It doesn't seem like you are leveraging a benefit of angular which is AOT and affecting the performance numbers.

I see you are using npm build, but perhaps not the right build which should be ng build --target=production --environment=prod --aot

Native packing

Very nice, @hdjirdeh
Thanks for sharing.
In the screencast I see you are running it fullscreen natively.
Did you use phonegap? Is it builtin in your project?

Class decorator issues

When running this code, I get the following error:
C:\Angular 2\angular2-hn-initial-setup\angular2-hn-initial-setup>ng serve

It seems like you're using the newest version of the Angular CLI that uses webpack.
This version does not require an angular-cli-build file, but your project has one.
It will be ignored.

Your global Angular CLI version (1.0.0-beta.28.3) is greater than your local
version (1.0.0-beta.22-1). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".

reflect-metadata shim is required when using class decorators

I haven't been able to find a solution.
Any ideas?

ng build ERROR

ERROR in [default] e:\learning\angular2\Angular2-HNews-master\src\app\stories\stories.component.ts:31:49
Property 'storiesType' does not exist on type '{ [name: string]: any; }'.

ERROR in [default] e:\learning\angular2\Angular2-HNews-master\src\app\user\user.component.ts:25:33
Property 'fetchUser' does not exist on type 'HackerNewsAPIService'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.