sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

Legacy support plans #1701

Closed johnny-mh closed 3 years ago

johnny-mh commented 3 years ago

Hello guys. Thank you for your effort. it's great! very interesting šŸ˜

My English is not very good, so please understand.

Recently. I refactored some codes related with legacy support.

1. shimport isn't IE11 friendly.

According to documentation. --legacy option make legacy build and support internet explorer.

But internet explorer has not fetch but shimport need that.

So i refactored builder to concatenation below scripts.

and it works without any errors.

2. But legacy/client.js isn't legacy friendly.

legacy build result looks like below script. (I'm using Rollup)

(import codes are interted by babel-preset + browserslist)

import 'core-js/modules/es.array.for-each.js';
import 'core-js/modules/es.array.index-of.js';
import 'core-js/modules/es.array.slice.js';
import 'core-js/modules/es.object.keys.js';
/* .. many core-js import codes .. */

// and sapper build result
var successkid = "/client/465898c830bb9d2c.jpg";

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

but build directory does not contain 'core-js' scripts. and shimport transformation ignore module syntax.

Even if shimport tranform import syntax. It occur performance cost for replacing that codes.

Internet explorer 11 does not work upper settings.

Is there any plans for legacy supports?


image Full page refreshed at click navigation link. (I've tested at IE11)

loader.js is shimport and necessary polyfill concatenation results. (You can see loader.js fetching 2 times.)

antony commented 3 years ago

IE11 is thankfully dying, it is being forcefully removed from existence by its own authors, and we don't intend to provide built-in support for it, nor give any reason to encourage it's use.

If you wish to support IE11 you can do so using polyfills and babel configuration. See here https://github.com/antony/sapper-ie for an example.

benmccann commented 3 years ago

IE11 is thankfully dying, it is being forcefully removed from existence by its own authors

Can you share some details about what you mean by this @antony? I tried to search for it and the only thing I found was a single article with the headline "Microsoft confirms it will NEVER EVER remove IE from Windows 10". I can't wait for IE to die, so hopefully I'm missing something