filamentgroup / loadCSS

Load CSS asynchronously
MIT License
6.72k stars 534 forks source link

Version 3 #298

Closed c-vetter closed 1 year ago

c-vetter commented 5 years ago

Based on #296

I'd like to trim the code and enable use-cases that do not support pre-IE9 browsers, alongside the current IE6+ support. To that end, I created a new build script that splits a modern and a legacy version from each source script.

This also includes a first stab at having proper build targets for CJS, ESM, and global namespace. The difference from the previous strategy being that the decision for a specific export happens before the file is delivered to the end user.

I consider this an alpha version and would like your feedback on whether you think this is worthwhile and will be welcome. I'd like to PR this into a v3 branch, if you were to create one.

Necroskillz commented 5 years ago

Can onloadCSS also be exported as cjs/esm etc. Unless I'm missing something it's currently not possible to use it (require/import) as a module.

c-vetter commented 5 years ago

@Necroskillz

Can onloadCSS also be exported as cjs/esm etc. Unless I'm missing something it's currently not possible to use it (require/import) as a module.

You are correct, there is actually a ticket on this issue: #171

I commented there about this issue a moment ago.

c-vetter commented 5 years ago

@scottjehl @zachleat Would you kindly take a look? I think this is almost release-worthy. I'd appreciate your input 🙂

c-vetter commented 5 years ago

It's still lacking documentation, which I will add soon.

scottjehl commented 5 years ago

Wow, @rasenplanscher this is some extensive work. We really appreciate all the help you're bringing here. We're pretty slammed with project work at FG at the moment so it's going to take us a bit to get a look through this one - particularly given that there's a fair amount of changes in here. Thankfully you've split it out nicely so reviewing by commits should be reasonable.

We hope to be in touch on it soon thanks again

c-vetter commented 5 years ago

@scottjehl Thank you for the heads-up 🙂 I know those phases, all good. Looking forward to your feedback.

lidqqq commented 4 years ago

I think it's a great change!

Do you have a plan to proceed this PR ?

c-vetter commented 4 years ago

@lidqqq Thanks for the revival! 🙂 I'll update the PR to make it mergeable 👍