Wk-notes-11-19-A11y-Polyfill

A11y practice

  • role is a promise, discribe what the element do

  • Tri-state checkbox: true/false/mixed

  • Slider: slide to get a value; multi-thumb slider: slider that pick a range

  • Spin button: have up and down to

Pitfalls

IE11 does NOT support Array.prototype.includes, it does NOT support new Set([iterable])

To reduce bundle size, hand pick polyfills, import modules from core-js from babel-polyfill

In polyfills.js

import 'core-js/modules/es6.symbol';
import 'core-js/modules/es6.object.keys';
import 'core-js/modules/es6.string.includes';

In index.js

import './polyfills';

In npm project, import can refer to any existing package from node_module, even if it's nested from other dependency

import '/modules/my-module.js';

[!! Javascript import] Import a module for its side effects only : Import an entire module for side effects only, without importing anything. This runs the module's global code, but doesn't actually import any values.

Last updated