Git Product home page Git Product logo

ioweb2016's Introduction

Build Status

Google I/O 2016 web app

Setup

Prerequisites

  • Go 1.6.
  • Google App Engine SDK for Go 1.9.35+. Once installed, make sure the SDK root dir is in $PATH. You can verify it's been setup correctly by running goapp version, which should output something like go version go1.6 (appengine-1.9.35).

Setup

  1. git clone https://github.com/GoogleChrome/ioweb2016.git
  2. cd ioweb2016
  3. npm install

If you plan on modifying source code, be a good citizen and:

  1. Install EditorConfig plugin for your favourite editor. The plugin should automatically pick up the .editorconfig settings.
  2. Obey the pre-commit hook that's installed as part of gulp setup. It will check for JavaScript and code style errors before committing to the master branch.

Running

Run gulp serve to start the app.

Normally the app is running in "dev" environment but you can change that by providing --env argument to the gulp task:

# run in dev mode, default:
gulp serve
# set app environment to production:
gulp serve --env prod
# or run as if we were in staging:
gulp serve --env stage

Not that this does not change the way the backend code is compiled or the front-end is built. It merely changes a "environment" variable value, which the app takes into account when rendering a page or responding to a request.

Running in stage or prod requires real credentials when accessing external services. You'll need to run a one-off gulp decrypt which will decrypt a service account private key.

Other arguments are:

  • --no-watch don't watch for file changes and recompile relative bits.
  • --open open serving url in a new browser tab on start.
  • --reload enable live reload. Always watches for file changes; --no-watch will have no effect.

Building

Run gulp. This will create dist directory with both front-end and backend parts, ready for deploy.

Note: Build won't succeed if either gulp jshint or gulp jscs reports errors.

You can also serve the build from dist by running gulp serve:dist, and navigating to http://localhost:8080.

serve:dist runs the app in prod mode by default. You can change that by providing the --env argument as with other serve tasks. For instance:

# run in stage instead of prod
gulp serve:dist --env stage

Deploying

To deploy complete application on App Engine:

  1. Run gulp serve:dist which will build the app in dist directory and start local server.
  2. Perform any necessary manual checks.
  3. Run GAE_SDK/goapp deploy -application io-webapp-2016 -version <v> dist/backend/.

Backend

Backend is written in Go, hosted on Google App Engine.

cd backend && goapp test will run backend server tests. You'll need to make sure there's a server.config file in the backend dir.

Debugging

A list of tools to help in a debugging process. NOT available in prod

Proxy with the service account credentials

http://HOST/io2016/debug/srvget?url=<some-url>

The backend will GET some-url and respond back with the original status code, content-type header and the content.

Useful for browsing original CMS data on staging GCS bucket:

go/iowastaging/debug/srvget?url=https://storage.googleapis.com/io2015-data-dev.google.com.a.appspot.com/manifest_v1.json

Configuring Firebase

Creating Databases/Shards and setting them up

When setting up your own version of the Google IO Web app you need to create new Firebase databases, set them up and configure the app to use them. First, create one or more (depending on how many shards you need) Firebase databases from http://firebase.com and note their Databases URLs. In the backend/server.config file list the Firebase Databases URLs in the firebase.shards attribute.

For each Firebase databases you need to configure configure Login and Auth:

  • Open the Auth settings page: https://<firebase-app-id>.firebaseio.com/?page=Auth
  • If the database is going to be used on prod enter events.google.com in the Authorized Domains for OAuth Redirects field or whichever domain your app will be served from in prod.
  • Below click on the Google tab then Enable Google Authentication
  • Provide the Google Client ID that you are using for auth.

Deploy Security rules to Firebase Databases

Run the following command to deploy the Firebase Security rules to all shards:

gulp deploy:firebaserules

Note: You may be prompted to log in to Firebase if you haven't previously done so.

By default the above will deploy rules to the dev Firebase shards. To deploy the rules to other environments' shards run:

gulp deploy:firebaserules --env {prod|stage}

Send GCM push notifications

http://HOST/io2016/debug/push

Follow instructions on that page.

On staging server this is go/iowastaging/debug/push

Re-sync local datastore with remote

http://HOST/io2016/debug/sync

Frontend Testing

Frontend tests are run via https://github.com/Polymer/web-component-tester

Configuration is in wct.conf.js.

To run tests, install wct globally:

npm install -g web-component-tester

and run:

wct

License

Apache 2.0 ยฉ 2016 Google Inc.

ioweb2016's People

Contributors

blasten avatar brendankenny avatar daschechter avatar ebidel avatar hermanya avatar jeffposnick avatar keanulee avatar nicolasgarnier avatar paulfarning avatar pengying avatar philipwalton avatar robdodson avatar sashaburchuk avatar tdreyno avatar wibblymat avatar x1ddos 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

ioweb2016's Issues

Push registration: use propel lib

[EDIT - @wibblymat] Need to make sure that the push registration flow is smooth. The UI/UX needs to be reviewed.

We should also switch out as much custom code as possible in favor of the Propel library.

Schedule firebase/UI bugs

Issues I see that we need to look into:

  • sigin on on the schedule page doesnt update the UI
  • sign out on th schedule page doesnt remove checks
  • my schedule page: logging in on this page is pretty busted
  • already logged in: myschedule page doesnt show data on page refres
  • session detail: back arrow doesnt always close popup
  • filtering does not uncheck boxes
  • state fo FAB + button is not always right see #84
  • firstOfBlock needs to be recalculated for myschedule and filtering. The latter produces bugs like this:

screen shot 2016-03-16 at 7 14 45 pm

Remove templates for pages

We really don't need these any more now that pages are elements. We'll need to dynamically change page meta data (this was taken care of by the server on page load) when a page loads / transitions. Last year, we didn't do the latter :(

SyntaxError: Unexpected strict mode reserved word

@ebidel @brendankenny I can't seem to run any of the gulp tasks:

$ gulp
gulpfile.js:46
let reload = function() {
^^^
SyntaxError: Unexpected strict mode reserved word
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Liftoff.handleArguments (/usr/local/lib/node_modules/gulp/bin/gulp.js:116:3)
    at Liftoff.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/liftoff/index.js:192:16)
    at module.exports (/usr/local/lib/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)

I did run npm install before executing gulp.

$ node --version
v0.12.8

$ npm --version
3.5.2

Countdown: loading perf and suggestions

Some stuff we need to work out:

  • This immediately takes up 2 GB of RAM on my MBP, then gc's to 1.6GB. I think you said there was low hanging fruit on chat?
  • we can offload a lot of the file loading into a build-time script. @brendankenny can help
  • for licensing, it would be easier to bower install bpgdec8a.js instead of checking it in.
  • when the element is removed from the DOM (detached) it needs to clean up after itself.
    Other things to explore:
  • do the worker stuff in bootstrap.js so it's done right away at page load and doesnt have to wait on Polymer/<coutdown-timer> to load.
  • could we define a Uint8Array array with the pre-decoded output? That could be loaded directly in the app when the home page loads.
  • have the Go server to do the decoding (https://github.com/chai2010/bpg) and figure out how to get it to the client

Save user data (viewed videos, starred sessions etc...) in Firebase

We'll store the following information in Firebase and move away from using Google Drive app data:

  • Viewed videos
  • Starred sessions
  • Last activity timestamp: Not sure yet if we're updating this only when user auth or at every write
  • WebPush Subscription Data for the user
  • Session Feedback

Content does not display in Firefox

I tried the p1 branch of the site in Firefox Nightly, and the main content area is just a white space.

screen shot 2016-02-18 at 12 21 47

My primary suspect is the error in the console about animations:
NotSupportedError: Animation with a target not bound to a document is not yet supported.

Offline: Reduce number of files sw precaches for phase1

We can save users' bandwidth by reducing the number of items we're needlessly caching. There are some uneeded files (esp for phase 1):

  • All the ?partial urls can go
  • bower_components/webcomponentsjs/webcomponents.min.js can go
  • unused page urls in phase1(/offsite, /onsite, /widget, etc.) It's only home and faq for phase1

For the last one, would it be possible to glob out entire directories? For example, we don't need all the images/onsite/, images/offsite/ now, but will later. The images will also be different so users will get uneeded images, cached.

Since we're no longer using templates/page.html for each page (they're elements now), maybe we should setup a manual list of page names and image directories to cache?

var PrecacheConfig = [["./","3bf0607ade46c9186dbcea16d5a3a49c"],["./?partial","a571166c09791ea01844936122774a8b"],["about","e7bfa32cd04bae4007a5406fe3d8868a"],["about?partial","e035d5c6252bdeafd73b007ebd51b501"],["bower_components/es6-promise/dist/es6-promise.min.js","69d3624630f5e2d043741d048872430a"],["bower_components/webcomponentsjs/webcomponents-lite.min.js","2c53f5231be8b6a0faefaa47d3e2137f"],["bower_components/webcomponentsjs/webcomponents.min.js","7ed13199f438d50e134e909f00eb4eec"],["data-worker-scripts.js","5011d45e54d8dabed29a2ae402775541"],["elements/elements.html","1f3502e30c977becd01ab17f4d8c80f7"],["elements/elements.js","52f6330603bdec0dc7ebd851216ec35b"],["embed","4739c2416689eb9b43790f029cf0bfe6"],["embed?partial","c2fb5be8ae16b78b0f37b1cf34d098ce"],["error_404","1b121b996e0203350c2ae8a68f7b213c"],["error_404?partial","cdd11e4b19640880da7c74af88a0738c"],["error_500","014ff9721be9bbb3c79f63ec38f821e4"],["error_500?partial","3c8f392705df541dc4c4399b73bf842a"],["faq","59f54aecf86567034f166c60de0d48d0"],["faq?partial","1f0035495972c0aa3b3a05ed624562b2"],["favicon.ico","bdd381fe7a8825bcf664b7f1ca96431f"],["form","8bcfe5328642d62a89158e0ccd222889"],["form?partial","923336718f9aa51f9e94abe69395fb8b"],["home","3bf0607ade46c9186dbcea16d5a3a49c"],["home?partial","a571166c09791ea01844936122774a8b"],["humans.txt","11eb77d7907e2c10c0ed7285cb430719"],["images/google-logo.svg","9c6ad27fab8abbc8072e3113169ed5d5"],["images/google_play_45.png","8e903b49edef08d6b29991f931b9bcaa"],["images/hash.png","abca25acebb323f337284d6c4619e801"],["images/home/cardboard.jpg","69b80fe0c04b369d97c7702bb51ee063"],["images/home/recap.jpg","97207d8341bc258a288615f8d7f0518e"],["images/io-logo-grey.png","000b3968dc6f7ca5e64f30817340cd7d"],["images/io-logo-white.png","104e313972d455fd010892bff0374df3"],["images/[email protected]","ee8201d91eb0afa367c7c5771ea67b96"],["images/io.png","b9efd08457b244c68c62d17ddd9be89b"],["images/io15-color.png","e559b3808822fb49aae59d5a3eb8fca1"],["images/offsite/stage-887.jpg","c6ac0cf209aedbfcb2c75512fc036e2f"],["images/offsite/[email protected]","7b48a6c026d6b08e5ec604e6d2fe81b2"],["images/onsite/Image-01.jpg","402bacd570dfbe68240f5da16df25bec"],["images/onsite/[email protected]","3200a41b19a8f3a651209c3114da44d8"],["images/onsite/lyft_pink.svg","94a9d66fd5a545be7e9a00d94ec9876b"],["images/onsite/map/io_floor1_label.jpg","9478f7b2b0029796d7ad0f3402271a1e"],["images/onsite/map/io_floor2_label.jpg","c023f2d9bb84f496c879d5b2684036bf"],["images/onsite/map/io_floor3_label.jpg","455c5f3cd72fd62777baa6347a34a03d"],["images/onsite/onsite2.jpg","279cd1ff7bdc28aca8a31a07a3c24ce7"],["images/onsite/onsite3.jpg","d69038bbb3e39ecf1bca00986e52d786"],["images/onsite/onsite_large.jpg","48ba10041cb280176fb50b2a4b8a3b31"],["images/onsite/onsitedude.jpg","ddeb49bda63dcd530fe9dadaf6ab4650"],["images/play-video-button-grey.png","d35fd202b671fcb9c7d16833e202d6d5"],["images/play-video-button.png","183a33b6e99b0a75fba2afeb23a6288f"],["images/schedule/channel1.png","707fee09c96e5d6b236da9c9086251bd"],["images/schedule/channel2.png","376b2bf545e3c5e6e6d818857acc084f"],["images/schedule/channel3.png","939341fd4001dfbdff4b175d146ae834"],["images/schedule/profile_placeholder.png","2b0b2305cb4ba2e87775e814743350fd"],["images/schedule/session_placeholder.jpg","7703bcfbd5dddb72671d798d375260ba"],["images/schedule/sessiondetail.jpg","5f1e8e058af814ec529d8a91fe7c61cc"],["images/schedule/[email protected]","0ef31150a83a142745a3c70fc0a46381"],["images/share-twitter.svg","4bbd29384a998d765ed5929586f0cef0"],["images/touch/homescreen144.png","0d13cdf30430acf611122ce49081d49c"],["images/touch/homescreen192.png","4fa11cbc3c002a8c18637f0a076c9297"],["images/touch/homescreen48.png","d7ef582c756834e4a66738abc23958e4"],["images/touch/homescreen72-fav.png","154175dec37da0bea07476675d95281d"],["images/touch/homescreen72.png","5c226be7b2b4dddc1cbec8fac8282d40"],["images/touch/homescreen96.png","a07df4cea81a25e58bf43305d7980ab3"],["offsite","7b22bf25c1c45cb748435b188faa2205"],["offsite?partial","2ac5eb0a7db139c97cd6a083da879752"],["onsite","9938c8557df9c383bfeecb8c1a14c746"],["onsite?partial","de06d140a3d4f731f0fd9478c4e56551"],["registration","7f9ed7ac8924f5b4c783224459837787"],["registration?partial","e9e75b8020dc232af7f1313cf560e7b0"],["schedule","13bc390c241c0fec309919de96920408"],["schedule?partial","753a2589a7207988a285f099909b3ffc"],["scripts/analytics.js","624a0ed8c245aa08ced29a4d347028a0"],["scripts/site-libs.js","1c74bbb0c2fa37de94e0de237dbed04c"],["scripts/site-scripts.js","0d3de3c6a252471a073e5208554b4a93"],["scripts/sw-toolbox-scripts.js","692aa43e6da2afb889b556608007c22d"],["styles/main.css","9120df4c75f33e66d6ad484050e929cb"],["styles/pages/error.css","96aa897460afada57c2513b3d506423a"],["styles/pages/permissions.css","aabaa6cfc7de2948c19a11e742d2f947"],["styles/pages/upgrade.css","89037cac1b941d27d7d2688330add6b0"],["upgrade","4c57fdaf323f8c303c093100e1478c31"],["upgrade?partial","c6e85b999d7e12ba8451bb38490b3514"],["videos","55e74bf70542c5baf72c0b4f37bf4e9c"],["videos?partial","a6e31a8eed252e8377b97e079f57fe52"],["widget","164180a2d8f7cba2049e42e8e0720add"],["widget?partial","e1b562d44db6da9d8b2cc22f0e846c47"]];

Remove masthead ripple

From page-animation.js and the markup in the main page.

Put back ink on the nav tabs...like a BOSS

Update lazy loading / ajax system for polymer 1.0

<template ref> is no longer supported and there is not a viable replacement. Need to create custom elements for each page.

Pattern: https://github.com/kevinpschaaf/polymer-sc/blob/master/elements/sc-app.html#L165-L184

(which is similar to ๐ŸŽ… tracker's system)

This will be great for:

  • All page logic will still be self-contained and not attached to the main template
  • we can ditch the template hacks and script injection for browsers that don't support it.

Things that need to be worked out:

  • How to use/re-use shared properties/methods from the main page template.
  • SEO impact. The polymer team has done experiments here and things appear to be fine.

@jeffposnick for the fyi. This may also impact service worker caching.

data-worker.js errors in dist

I get js errors from data-worker.js when running gulp serve:dist

Looks like it's coming from scripts/helpers/schedule.js, Object.map() in function generateFilters(tags) {

Think this is due to babel

Update server config stuff for 2016

I updated server.config.template, but every time I generate the different configs, some contain 2015 data ("prefix": "/io2015", start date is the 2015 url) even though the template is up to date.

What am I doing wrong?

Offline support for Firebase read operations

We need to decide if/how we're going to handle fallbacks for read operations that would normally be done against Firebase when the user starts up offline.

If we are going to support that, then something IDB-based might end up making more sense than using the Cache Storage API, since the Cache Storage API only works with HTTP responses, and we're using a WebSocket-based Firebase connection.

Offline support for Firebase updates

Now that code like #69 is landing, the bits to handle offline updates need to go in.

As per discussion with the Firebase team, we're going to take an approach where we:

  • Write the update to IndexedDB.
  • Attempt to make the update in Firebase.
  • Upon completion of the Firebase update, remove the pending update from IndexedDB.

And then each time the page is initially loaded, we'd also want to check for any queued updates in IndexedDB and replay those.

A11y Master Bug

General

  • Offscreen, responsive side nav is focusable even when not displaying
  • Unknown elements might be ripples? Not sure but they take over focus when you click on some links

Masthead

  • No focus states for home button
  • Navigation initially announces 3 items but there's actually 5
  • No focus states for top level navigation
  • No role for 'Sign in'
  • 'Sign in' is not focusable
  • Top level navigation announces 'unknown' in VO
  • Hitting Enter on 'unknown' triggers ripple but page doesn't navigate
  • Need to manage focus when selecting a menu item

Home page

  • Back to top button focusable even when its hidden
  • Can focus outter and then inner back to top button. Inner button just announces 'button'
  • Back to top button needs label
  • Focus style on "Shoreline Amphitheatre Mountain View, CA" not visible against blue background
  • Map link could maybe have better description
  • Video button is not focusable

Schedule

  • Day 1 focuses first, only way to focus Agenda is shift+tab
  • Enter on Day 1 unknown element doesn't work
  • Clicking 'Browse Events' will need to manage focus
  • Filters need aria-labelledby
  • Should focus disappear after keyboard-pressing a filter button?
  • Using a screenreader, after you navigate past Travel it stops on an invisible toolbar
  • Event map overlay is a big can of worms :D

I/O Extended

  • Can't focus recap video button

Phase 1 removals

These need to be removed in the phase1 branch

  • - top nav items
  • - drawer nav items
  • - imports in elements.html that are uneeded
  • - comment out css in main.scss
  • - use hardcoded sundar tweet
  • - scripts at bottom of template

debugLog helper

There are a bunch of instances of

if (window.ENV !== 'prod') {
  console.log(...);
}

We should refactor that out to a global debugLog(...) helper.

Analytics: fire event to GA when users are logged in on page load

The question to answer is: how many concurrent signed in users do we have at any given time?

GA gives us users during a time/date range, but we don't know how many of those are signed in.
This would help us know correlate sign-in users to correlate with things like notifications support.

PWA Checklist

We should already be hitting most of these, but the sanity check is:

  • fast first paint
  • app shell concept
  • service worker, offline
  • manifest bits, updates to it

And make sure everything is up to date (e.g. manifest updates + banner event).

For first paint, we may need to redo the I/O loading animation, use body-bind, or go async with imports. I have some tricks.

Use h2 push

GAE supports http2 push. We should use it for a few critical resources on the main page.

Stop concatenating scripts/CSS?

Right now, we're concatenating our JS and CSS into a few larger bundles as part of our build process. This [might be/is] an anti-pattern when using HTTP/2. I'm assuming that most of the client traffic we'll receive will be from browsers that support HTTP/2.

Additionally, using individual JS/CSS files means that the caching will be more effective, both service worker and traditional browser caches. When a specific resource changes, that will be the only thing that needs to be refetched, vs. having to refetch the entire set of bundled assets.

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.