Giter Site home page Giter Site logo

news's Introduction

NEWS

Setup

$ git clone https://github.com/polymer/news.git
$ cd news
$ npm i
$ npm start

Build

$ npm run build

Test the build

To test prpl-server build:

$ npm run serve:prpl-server

To test static build:

$ npm run serve:static

Deploying

Our production deployment of NEWS is hosted on App Engine with Node.js. It can be deployed with the same steps as PWA Starter Kit.

news's People

Contributors

abdonrd avatar dstoc avatar felixzapata avatar frankiefu avatar keanulee avatar notwaldorf avatar samuelli avatar shans avatar would-code-again avatar

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

news's Issues

Polymer CLI and News App Build Issue

Howdy Folks,

Thanks for the great demo app.

I am just trying to get it up and running and ran into a problem right away.

First of all you should know that I installed polymer-cli with

npm install -g polymer-cli

When I ran

polymer build

I got a warning for each html file in the articles folder

The error is very similar to the one reported here: polymer-cli/issues/546.

On that issue the recommended fix is to

install polymer-cli@next

If you do this, note that you should uninstall the existing polymer-cli

After installing polymer-cli@next the build process runs with two new deprecation warnings and then fails with a notice about the app entry point.

warn: [polymer-project-config]    "sourceGlobs" config option has been renamed to "sources" and will no longer be supported
 in future versions
warn: [polymer-project-config]    "includeDependencies" config option has been renamed to "extraDependencies" and will no l
onger be supported in future versions
error:   cli runtime exception: AssertionError: Polymer Config Error: entrypoint (/) does not resolve within root (/Users/s
merth/Sites/Javascript/Polymer/Polymer v2/news-app/news)
error:   AssertionError: Polymer Config Error: entrypoint (/) does not resolve within root (/Users/smerth/Sites/Javascript/
Polymer/Polymer v2/news-app/news)

You need to fix the polymer.json config file as follows:

{
  "entrypoint": "index.html",
  "shell": "src/news-app.html",
  "fragments": [
    "src/news-list.html",
    "src/news-article.html",
    "src/news-path-warning.html",
    "src/lazy-resources.html"
  ],
  "sources": [
   "src/**/*",
   "images/**/*",
   "data/**/*",
   "app.yaml",
   "bower.json",
   "index.html",
   "main.py"
  ],
  "extraDependencies": [
    "manifest.json",
    "bower_components/webcomponentsjs/webcomponents-lite.min.js"
  ]
}

It seems that polymer-cli@next doesn't accept "entrypoint": "/", but does accept "entrypoint": "index.html",

Now the build works.

I would be nice if the News demo app built using a stable release of polymer-cli. I think polymer-cli@next is the bleeding edge release???

Maybe the polymer.json file should be updated???

Link to old version of polymer

It is:

 <footer>
      <a href="https://www.polymer-project.org/1.0/toolbox/">Made by Polymer</a>
    </footer>

It should be:

 <footer>
      <a href="https://www.polymer-project.org/2.0/toolbox/">Made by Polymer</a>
    </footer>

About page

I would like to see an example of how to implement a link to a static page in the menu, like an "about" page.

Image resizes when you scroll down

On the article pages on iOS and Chrome Android, as well as the home page on iOS, the hero image appears to resize when the URL bar scrolls out of view. This causes the text to jump down, which can be jarring.

Would it be possible to make sure the hero image doesn't resize when the URL bar scrolls away or scrolls back into view?

Header jitters when you scroll quickly

If you go to the main article list, scroll way down, and then quickly scroll up, the header drops down and there is a small gap that jitters opened and closed above the header. You see about 1 px of white line about the header. Worse the faster you scroll up.

Consider using fallback-selection for default route

Currently if the route path is empty we set route.path to some default value.

_routePageChanged: function(page) {
  if (!page) {
    // set default route if route path is empty
    this.set('route.path', 'list/mobile-homepage');
    return;
  }

This could be undesirable as it will change the URL.
There is a property fallback-selection in iron-pages that we could use to set the default page. We should see if that makes sense to use in the News app. e.g.

<iron-pages role="main" selected="{{page}}" attr-for-selected="name" fallback-selection='list'>

Styling cleanup

  • Remove tap highlight: -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  • Add an extra space on either side of the dot so there's more separation from the date.
    screen shot 2016-08-15 at 10 22 45 am
  • Change all the black type to #383838 and background color to #fafafa

Article content

  • Remove margin in <figure> and make the text be Georgia italic and 54% Black.
  • Make <a> links bold underline (not the default blue).

Desktop

  • Change the logo letter-spacing: 10px and add margin-left: 11px

  • The kicker should be top aligned with the "Most Read" lines
    screen shot 2016-08-15 at 2 25 06 pm

  • "Most Read" lines should be 12% Black like the nav lines

  • Make time-ago white-space: nowrap so this doesn't happen
    screen shot 2016-08-15 at 2 29 44 pm

  • In "Scroll down nav bar", change logo font-size to: 23px; and background color from black to #212121
    screen shot 2016-08-15 at 2 40 25 pm

  • Change nav links in "Scroll down nav bar" to line-height: 32px; font-size: 15px;

  • The bottom nav links should be 40px spacing

    screen shot 2016-08-15 at 2 47 20 pm

headline styling issue on mobile

  • The headline will get chopped off.

screen shot 2016-08-12 at 11 48 09 am

  • In instances when the headline is so long that it overlaps with the header. We should make sure the Politics box is always at least 100px below the header.

screen shot 2016-08-12 at 7 52 18 am

a11y: Using keyboard with Firefox

With Firefox is not possible to use the keyboard to navigate through the elements. The focus jumps to all the document but not inside the elements.

Content should be network-first

I feel like, particularly for a news app, we should try to go to the network first for the content. E.g. you go pack to the site, and it tries to fetch the latest content rather than show you old articles.

Remove the search icon

Since it doesn't do anything, I think we should remove it from the top right so that people don't tap on it and think it's broken.

App shows blank screen on IE 11

Share server push strategies

It would be really interesting to know how you guys have setup your server (nginx I assume) to play nicely with Server Push

Here is the list of what I'd like to know:

  • Did you automate the deploy to automatically detect what resources are pushed?
  • Do different routes push same resources?
  • Why nginx this time? (polymer-shop is served through apache-server)

Share with us please ๐Ÿ˜ƒ

News-path-warning does not work

If I change the article namer or the category name in the web browser URL field, the news-app should show news-path-warning.html, ie 404 page, but does not.

It seem to show a list view with no items.

a11y issues

  • put the text "Opinions ยท September 7, 2016" inside anh1
  • "Most Read", "More Top Stories" and "Opinions" should be inside an h2 instead of h3
  • use h3 for the news articles on the list page

cc @robdodson feel free to add more issues if you find anything that could have be done a little better.

Feature idea: RSS feed ingestion

Would it be possible to distribute this in such a way so that someone could set an RSS feed for each topic category in their app, and the server and/or client could fetch all the documents in the RSS feed and use them/cache them for the content?

This would allow essentially one-edit setup for anyone with a RSS feeds.

This could also extend to the AMP version, where if you had RSS feeds of AMP docs you could get a PWA essentially for free.

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.