-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme Color IE issue (improve bundling, etc, for older browsers) #707
Comments
Please show a code snippet. |
The problem is that IE11 does not support CSS variables: https://caniuse.com/#feat=css-variables I added the proper polyfills and it works fine now. Since Docsify is advertised as "Compatible with IE10+", I guess a polyfill should be added to support CSS variables in IE. |
shipping polyfills may increase the package size. I think we should update the docs with the guided steps ? cc @jhildenbiddle @trusktr thoughts? also, @jhildenbiddle if we need to ship polyfill for css variables from core, thoughts about css-vars-ponyfill ? |
Best to have docsify handle loading all necessarily libraries (like poly/ponyfill) as needed via dynamic imports. This keeps the bundle size down, prevents users from having to manage multiple libraries just to get docsify working, and allows the docsify team to easily swap libraries for all users in future versions (e.g. switching from ponyfill "A" to ponyfill "B"). FWIW, docsify-themeable bundles css-vars-ponyfill, but this is only because times were different back when docisfy-themeable was created. If I were doing it today (and this is a change I will likely make in the future), I'd load css-vars-ponyfill via dynamic import instead of bundling: const hasCSSCustomPropSupport = window?.CSS?.supports?.('(--a: 0)');
if (!hasCSSCustomPropSupport) {
import('https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2')
.then((module) => {
// Do stuff...
});
} (If you unfamiliar with the |
We need to ship polyfill for dynamic import as well right ? |
Nope. Bundlers like Rollup and Webpack handle these without issue or need for a plug-in. |
ahh, yea |
What’s the issue with Rollup? Why Webpack vs Parcel, Snowpack, or some other bundler? Not pushing for one over another, just wondering what the rational is for moving away from the current tool? |
webpack is kind of optimal for creating a browser bundle. |
I haven't tried Parcel yet, but Parcel is Webpack with default
configuration to make life easy.
Users do need a polyfill for ES Modules in older browsers to make an output
`.esm.js` file consumable, which is something they can add (and doesn't
need to be shipped with Docsify). Perhaps we should mention it in the docs
when we get around to adding the ESM build.
*#!/*JoePea
…On Tue, Jun 2, 2020 at 11:11 AM Anix ***@***.***> wrote:
webpack is kind of optimal for creating a browser bundle.
We will be using rollup for the cli
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#707 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIVTTDI5XIP7QRMS7P7CTRUU6EBANCNFSM4GGLYLKQ>
.
|
As an idea, here's what Tween.js' output Probably not many people (if any?) will use the |
Let's move the bundler conversation over to #1168. |
Fixed in #1743 |
When I add
themeColor
it breaks in IE11 with this error:The text was updated successfully, but these errors were encountered: