Bleeding Edge Web

edgeATX.github.io/slides

edgeatx.slack.com
[email protected]

Bleeding Edge Web: October 2015

Announcements

News from the Bleeding Edge

— Corey Butler (@goldglovecb)

The Road Four Node

— Evan Lucas (@evanhlucas)

Lightning Talks

Thanks to our venue sponsor:

Capital Factory

Thanks to our food sponsor:

PayPal

News from the
Bleeding Edge

Browser
Update

Browser Pop Quiz

Last version check — September 2015:

Chrome Firefox Opera Edge Safari
45 41 32 13 8

Browser Pop Quiz

As of October 27, 2015:

Chrome Firefox Opera Edge Safari
45
46
41 32
33
13
13+
8
9

See last month's talk for notes about Microsoft Edge Versioning.

Chrome 46

Release notes

"Simplified" CSS Motion Paths

Chrome 46

Automating resource selection with Client Hints

<picture>
  <!-- serve WebP to Chrome and Opera -->
  <source
    media="(min-width: 50em)"
    sizes="50vw"
    srcset="/image/thing-200.webp 200w, /image/thing-400.webp 400w,
        /image/thing-800.webp 800w, /image/thing-1200.webp 1200w,
        /image/thing-1600.webp 1600w, /image/thing-2000.webp 2000w"
    type="image/webp">
  <source
    sizes="(min-width: 30em) 100vw"
    srcset="/image/thing-crop-200.webp 200w, /image/thing-crop-400.webp 400w,
        /image/thing-crop-800.webp 800w, /image/thing-crop-1200.webp 1200w,
        /image/thing-crop-1600.webp 1600w, /image/thing-crop-2000.webp 2000w"
    type="image/webp">
  <!-- serve JPEGXR to Edge -->
  <source
    media="(min-width: 50em)"
    sizes="50vw"
    srcset="/image/thing-200.jpgxr 200w, /image/thing-400.jpgxr 400w,
        /image/thing-800.jpgxr 800w, /image/thing-1200.jpgxr 1200w,
        /image/thing-1600.jpgxr 1600w, /image/thing-2000.jpgxr 2000w"
    type="image/vnd.ms-photo">
  <source
    sizes="(min-width: 30em) 100vw"
    srcset="/image/thing-crop-200.jpgxr 200w, /image/thing-crop-400.jpgxr 400w,
        /image/thing-crop-800.jpgxr 800w, /image/thing-crop-1200.jpgxr 1200w,
        /image/thing-crop-1600.jpgxr 1600w, /image/thing-crop-2000.jpgxr 2000w"
    type="image/vnd.ms-photo">
  <!-- serve JPEG to others -->
  <source
    media="(min-width: 50em)"
    sizes="50vw"
    srcset="/image/thing-200.jpg 200w, /image/thing-400.jpg 400w,
        /image/thing-800.jpg 800w, /image/thing-1200.jpg 1200w,
        /image/thing-1600.jpg 1600w, /image/thing-2000.jpg 2000w">
  <source
    sizes="(min-width: 30em) 100vw"
    srcset="/image/thing-crop-200.jpg 200w, /image/thing-crop-400.jpg 400w,
        /image/thing-crop-800.jpg 800w, /image/thing-crop-1200.jpg 1200w,
        /image/thing-crop-1600.jpg 1600w, /image/thing-crop-2000.jpg 2000w">
  <!-- fallback for browsers that don't support picture -->
  <img src="/image/thing.jpg" width="50%">
</picture>

Chrome 46

Automating resource selection with Client Hints (cont...)

Use this instead...
<meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width">
...
<picture>
  <source media="(min-width: 50em)" sizes="50vw" srcset="/image/thing">
  <img sizes="100vw" src="/image/thing-crop">
</picture>

Developers can now negotiate with the server to download the best image variant for a device using straightforward HTTP request headers. These headers communicate DPR, Viewport-Width, and the intended display width of the resource being fetched to the server.

The answer to a good and sustainable optimization strategy for images, and other resources with similar properties is simple: automation. If you’re hand-tuning your resources, you’re doing it wrong: you’ll forget, you’ll get lazy, or someone else will make these mistake for you—guaranteed.

Chrome 46

ES2015: "Spread" Operator

Old Way
function myFunction(x, y, z) { }
var args = [0, 1, 2];
myFunction.apply(null, args);
Using Spread
function myFunction(x, y, z) { }
var args = [0, 1, 2];
myFunction(...args);

// myFunction(-1, ...args, 2, ...[3]);

Chrome 46

new.target

'use strict';
class Parent {
  constructor() {
    // new.target is a constructor reference, and new.target.name is human-friendly name.
    console.log('Hello from Parent! ' + 'Constructed from ' + new.target.name + '()');
  }
}

class Child extends Parent {}

function notAConstructor() {
  console.log('Hello from notAConstructor()! My new.target is ' + new.target);
}

// Call all the constructors and the function when the page loads.
new Parent();
new Child();
notAConstructor();
Hello from Parent! I was constructed via new Parent()
Hello from Parent! I was constructed via new Child()
Hello from notAConstructor()! My new.target is undefined

Chrome 46

Preconnect

<link href='https://fonts.gstatic.com' rel='preconnect' crossorigin>
<link href='https://fonts.googleapis.com/css?family=Roboto+Slab:700|Open+Sans' rel='stylesheet'>

Chrome 46

Event.isTrusted

var greenButton = document.querySelector('#greenButton');
var redButton = document.querySelector('#redButton');

greenButton.addEventListener('click', function(event) {
  if (event.isTrusted) {
    ChromeSamples.log('User clicked the green button. It is a trusted event.');
  } else {
    ChromeSamples.log('User did NOT click the green button.');
  }
});

redButton.addEventListener('click', function(event) {
  greenButton.click();
});

// User clicked the green button. It is a trusted event.
// User did NOT click the green button.

Chrome 46

Generate DOMException from script

var domException = new DOMException(message, name)
  • Useful for polyfills & web components.
  • Chrome 46

    Cache API is SSL Only

    Part of Google's initiative to disable powerful API's over insecure connections.

    Chrome 46 (Mobile)

    Mobile Push Notifications (full implementation)

    Firefox 41

    Security fixes on 41.0.1.

    Opera 33

    Release notes

    Safari 9: Prepare for amazement.
    Is that WebRTC I see?

    Nope. No WebRTC.

    Safari 9

    Release Notes

    Impressions
    1. Meh.
    2. Hoped for WebRTC.

    Safari 9

    Safari 9

    Safari 9

    Safari 9

    AirPlay API

    if (window.WebKitPlaybackTargetAvailabilityEvent) {
      video.addEventListener('webkitplaybacktargetavailabilitychanged', function(event) {
        switch (event.availability) {
          case "available": /* turn stuff on */
          break;
          case "not-available": /* turn AirPlay button off */
          break;
        }
      })
    }
    

    webkitplaybacktargetavailabilitychanged = 39 characters!

    Safari 9

    Picture in Picture

    if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function") {
      // Toggle PiP when the user clicks the button.
      pipButtonElement.addEventListener("click", function(event) {
        video.webkitSetPresentationMode(video.webkitPresentationMode === "picture-in-picture" ? "inline" : "picture-in-picture");
      });
    } else {
      pipButtonElement.disabled = true;
    }

    Safari 9

    ECMAScript 6 Enhancements

    Edge 13

    Build 10565 Changelog

    Mostly consumer features:
  • Tab Preview (preview contents of a tab on hover)
  • Syncing Favorites and Reading list items
  • Drag and drop for file upload is now supported
  • "Save target as" is now supported from the right-click context menu

  • Initial support for docked F12 Developer Tools
  • CSS initial support
    (If the cascaded value of a property is the initial keyword, the property’s specified value is its initial value.)
  • CSS unset support
    (Treat as inherit or initial)
  • Libraries &
    Frameworks

    Notable Releases

    Node.js

    And now for something completely different...

    Git LFS (Large File Storage)

    Around the Community

  • The Return of @DailyJS?
  • Upcoming
    Events

    APIStrat

    Signup at austin2015.apistrat.com

    Hacktoberfest

    Get a free T-shirt.
    1. Sign up on the Hacktoberfest website right away.
    2. Open at least four pull requests on any GitHub-hosted open source project(s) by October 31st, 2015
    3. After the month is over, DigitalOcean will collect your shipping details and mail your shirt

    Node.js Interactive

  • December 8-9
  • Hilton - Portland, OR
  • Super Early Bird: $200 (SOLD OUT)
  • Early Bird: $325 (Expired 10/23)
  • Standard: $425 (Ends 11/21)
  • Late/Onsite: $525
  • events.linuxfoundation.org/events/node-interactive

    Node Knockout

  • Nov 7-8
  • Currently Full, but more spots will open soon on nodeknockout.com.
  • Thanks!

    http://www.meetup.com/bleeding-edge-web/

    http://edgeATX.github.io/slides

    Corey Butler — @goldglovecb

    Bleeding Edge Web

    /

    #