diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0473597a..86f1a980 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -138,12 +138,6 @@ updating the `fixtures/` should make that a no-op. There are also some unit tests that run in Node using Mocha. You can find them in `tests/unit` and run them using `yarn run test-unit`. -## Legacy build - -Pinafore also offers a "legacy" build designed for older browsers. To build this version, use: - - LEGACY=1 yarn build - ## Debug build To disable minification in a production build (for debugging purposes), you can run: diff --git a/bin/build-inline-script.js b/bin/build-inline-script.js index 2a18dd5e..ffb1ce9e 100644 --- a/bin/build-inline-script.js +++ b/bin/build-inline-script.js @@ -6,7 +6,6 @@ import { rollup } from 'rollup' import { terser } from 'rollup-plugin-terser' import replace from '@rollup/plugin-replace' import fromPairs from 'lodash-es/fromPairs' -import babel from 'rollup-plugin-babel' import { themes } from '../src/routes/_static/themes' import terserOptions from './terserOptions' @@ -22,13 +21,8 @@ export async function buildInlineScript () { plugins: [ replace({ 'process.browser': true, - 'process.env.LEGACY': JSON.stringify(process.env.LEGACY), 'process.env.THEME_COLORS': JSON.stringify(themeColors) }), - process.env.LEGACY && babel({ - runtimeHelpers: true, - presets: ['@babel/preset-env'] - }), !process.env.DEBUG && terser(terserOptions) ] }) diff --git a/package.json b/package.json index 6de3f5c4..ab3c995e 100644 --- a/package.json +++ b/package.json @@ -43,16 +43,8 @@ "build-vercel-json": "node -r esm bin/build-vercel-json.js" }, "dependencies": { - "@babel/core": "^7.10.5", - "@babel/plugin-transform-runtime": "^7.10.5", - "@babel/preset-env": "^7.10.4", - "@babel/runtime": "^7.10.5", "@rollup/plugin-replace": "^2.3.3", - "@webcomponents/custom-elements": "^1.4.1", - "@webcomponents/shadydom": "^1.7.3", - "array-flat-polyfill": "^1.0.1", "arrow-key-navigation": "^1.2.0", - "babel-loader": "^8.1.0", "blurhash": "^1.1.3", "cheerio": "^1.0.0-rc.3", "child-process-promise": "^2.2.1", @@ -75,9 +67,6 @@ "focus-visible": "^5.1.0", "form-data": "^3.0.0", "glob": "^7.1.6", - "indexeddb-getall-shim": "^1.3.6", - "intersection-observer": "^0.11.0", - "intl": "^1.2.5", "li": "^1.3.0", "localstorage-memory": "^1.0.3", "lodash-es": "^4.17.15", diff --git a/src/client.js b/src/client.js index 5681eae1..7bb5a668 100644 --- a/src/client.js +++ b/src/client.js @@ -1,4 +1,3 @@ -import './routes/_thirdparty/regenerator-runtime/runtime.js' import * as sapper from '../__sapper__/client.js' import './routes/_utils/serviceWorkerClient' import './routes/_utils/historyEvents' diff --git a/src/routes/_components/dialog/components/EmojiDialog.html b/src/routes/_components/dialog/components/EmojiDialog.html index 9235aee8..87edd5a1 100644 --- a/src/routes/_components/dialog/components/EmojiDialog.html +++ b/src/routes/_components/dialog/components/EmojiDialog.html @@ -68,40 +68,6 @@ import { doubleRAF } from '../../../_utils/doubleRAF' import { convertCustomEmojiToEmojiPickerFormat } from '../../../_utils/convertCustomEmojiToEmojiPickerFormat' - function applyShadowDomPolyfill (picker) { - // polyfill for :host, plus other fixes mostly targeted at KaiOS. - // We could use shadycss, but it doesn't really work for our use case (has to be injected - // into the web component's connectedCallback directly). - const style = picker.shadowRoot.querySelector('style') - style.remove() - if (!document.getElementById('emoji-picker-style')) { - let css = style.textContent - css = css.replace(/:host\(([.*?])\)/g, 'emoji-picker$1') - css = css.replace(/:host/g, 'emoji-picker') - css = css.replace(/\*/g, 'emoji-picker *') - css = css.replace(/\b(button|input|input\[type=search\])\s*\{/, 'emoji-picker $1{') - // fixes for KaiOS style bugs - css += ` - emoji-picker .emoji-menu { - grid-template-columns: repeat(8, 1fr); - } - - @media screen and (max-width: 320px) { - emoji-picker .emoji-menu { - grid-template-columns: repeat(6, 1fr); - } - .emoji-container { - width: calc(100% - 20px); - } - } - ` - const newStyle = document.createElement('style') - newStyle.id = 'emoji-picker-style' - newStyle.textContent = css - document.head.appendChild(newStyle) - } - } - export default { async oncreate () { onCreateDialog.call(this) @@ -117,9 +83,6 @@ } applyFocusVisiblePolyfill(picker.shadowRoot) registerShadowRoot(picker.shadowRoot) - if (process.env.LEGACY && !HTMLElement.prototype.attachShadow.toString().includes('[native code]')) { - applyShadowDomPolyfill(picker) - } this.on('destroy', () => unregisterShadowRoot(picker.shadowRoot)) if (!isUserTouching) { // auto focus the input on desktop doubleRAF(() => { // triple rAF because a11y tries to focus as well diff --git a/src/routes/_components/dialog/components/MediaAltEditor.html b/src/routes/_components/dialog/components/MediaAltEditor.html index ed35ebb7..e1d1d564 100644 --- a/src/routes/_components/dialog/components/MediaAltEditor.html +++ b/src/routes/_components/dialog/components/MediaAltEditor.html @@ -20,24 +20,21 @@ max={mediaAltCharLimit} style="width: 100%; text-align: right;" /> - - {#if !legacy} - - + - {/if} + {extractButtonText} + +