Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 17, 2019 10:04 am GMT

What To Expect When You're Expecting To Drop IE11

So you've decided to drop support for IE11 and move onto evergreen browsers only (IE11 is only about ~2% globally). That's great!

With that in mind, here's a giant list of the features you should use, today, safely, without polyfills or feature detection.

Before we start, of course, there'll always be old browsers. And, to be fair, browsers in emerging markets are more complex: like UC, KaiOS (based on an older Firefox), and Opera Mini. In these cases, I suggest serving no JS whatsoever (if possible), or encouraging users to upgrade.

Let's go!

The DOM

JavaScript Language

  • ES Modules, through <script type="module"> and import/export

  • Template literals such as template ${literals}

  • Classes like class Foo { constructor() { ... } }

  • Functions! Arrow functions, rest parameters, async functions that allow await, generators which can yield

JavaScript Library

  • Promise and fetch (no need for XMLHttpRequest anymore )

  • Methods on Array: find, includes; and on String: includes, padStart and padEnd

  • The Proxy object, allowing for interesting approaches

  • Methods on Object: entries and values, for iteration (like Object.keys)

  • The URL object (useful to check for query params and work with URLs)

  • The currentScript property ("what file am I")

  • You can safely dispatch a new CustomEvent('....') rather than dealing with weird intializers

JavaScript + The DOM

Whole New APIs

CSS

  • Grid

  • CSS Variables, such as --foo: blue;, used with color: var(--foo)

  • Sticky Position

  • CSS filters, allowing for visual effects like invert, drop shadow and hue changes

  • Image object-fit (Edge only supports it on <img>), allowing you to make an image contain or cover its contents rather than stretch

  • Improved media queries for pointer or mouse access Fun fact: this was one of the first demos I wrote working on Chrome.

  • New CSS cursors 'grab', 'zoom-in', 'zoom-out'

  • The ::placeholder pseudo-element, for styling the placeholder text inside an <input>

  • Using initial or unset as CSS values

  • The vmax unit, which is a percent of whichever's larger: width or height

  • Going along with the JS method, the CSS @supports at-rule

  • Read-only and read-write pseudo-class selectors (:read-write seems the more useful of the two)

  • Stroke and fill on text

    • ... although supported on all evergreens, you'll need to include the -webkit- prefixes: yes, even for Edge and Firefox
  • Risky bugs in IE11 are no longer an issue:

Phew!

You got this far! Congratulations!

If there's any I've missed, or good resources for any of these features, let me know below.

17


Original Link: https://dev.to/samthor/what-to-expect-when-you-re-expecting-to-drop-ie11-ifg

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To