2018-01-21 03:19:24 +00:00
|
|
|
import { loadCSS } from 'fg-loadcss';
|
|
|
|
|
2018-01-15 01:13:42 +00:00
|
|
|
const importURLSearchParams = () => import(
|
|
|
|
/* webpackChunkName: 'url-search-params' */ 'url-search-params'
|
|
|
|
).then(Params => {
|
|
|
|
window.URLSearchParams = Params
|
|
|
|
Object.defineProperty(window.URL.prototype, 'searchParams', {
|
|
|
|
get() {
|
|
|
|
return new Params(this.search)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2018-01-15 07:24:27 +00:00
|
|
|
const importTimeline = () => import(
|
|
|
|
/* webpackChunkName: 'Timeline' */ '../_components/Timeline.html'
|
|
|
|
).then(mod => mod.default)
|
|
|
|
|
2018-01-17 04:34:09 +00:00
|
|
|
const importIntersectionObserver = () => import(
|
2018-01-19 15:17:33 +00:00
|
|
|
/* webpackChunkName: 'intersection-observer' */ 'intersection-observer'
|
2018-01-17 04:34:09 +00:00
|
|
|
)
|
|
|
|
|
2018-01-17 08:06:24 +00:00
|
|
|
const importRequestIdleCallback = () => import(
|
|
|
|
/* webpackChunkName: 'requestidlecallback' */ 'requestidlecallback'
|
|
|
|
)
|
|
|
|
|
2018-01-19 04:57:15 +00:00
|
|
|
const importIndexedDBGetAllShim = () => import(
|
|
|
|
/* webpackChunkName: 'indexeddb-getall-shim' */ 'indexeddb-getall-shim'
|
|
|
|
)
|
|
|
|
|
2018-01-21 03:19:24 +00:00
|
|
|
const importDialogPolyfill = (() => {
|
|
|
|
let cached
|
|
|
|
return () => {
|
|
|
|
if (cached) {
|
|
|
|
return Promise.resolve(cached)
|
|
|
|
}
|
|
|
|
loadCSS('/dialog-polyfill.css') // TODO: handle error
|
|
|
|
return import(/* webpackChunkName: 'dialog-polyfill' */ 'dialog-polyfill').then(res => {
|
|
|
|
cached = res
|
|
|
|
return cached
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})()
|
|
|
|
|
2018-01-15 01:13:42 +00:00
|
|
|
export {
|
2018-01-15 01:50:29 +00:00
|
|
|
importURLSearchParams,
|
2018-01-17 04:34:09 +00:00
|
|
|
importTimeline,
|
2018-01-17 08:06:24 +00:00
|
|
|
importIntersectionObserver,
|
2018-01-19 04:57:15 +00:00
|
|
|
importRequestIdleCallback,
|
2018-01-21 03:19:24 +00:00
|
|
|
importIndexedDBGetAllShim,
|
|
|
|
importDialogPolyfill
|
2018-01-15 01:13:42 +00:00
|
|
|
}
|