preact-cli icon indicating copy to clipboard operation
preact-cli copied to clipboard

Use Babel 7.x; Extract "babel" package; Update "browsers" default

Open lukeed opened this issue 7 years ago • 7 comments

Not ready for merge – must resolve pre-existing Jest failures first.


What kind of change does this PR introduce?

Refactor, Feature

Did you add tests for your changes?

No, they're already a mess (again).

Summary

  • Better browser list

  • Upgraded Babel deps from beta to 7.x stable

  • Extracted Preact-specific config into @preact/babel package

  • Applied CLI-specific Babel config changes within CLI:

    • Read & disable babelrc
    • Attach fast-async support (#617)
  • Fixed my typo artifact (old ~> .babelrc)

Does this PR introduce a breaking change?

The default browsers changed, dropping default support for legacy browsers.. so technically, "yes" but this is going to be a major bump already.

The Babel behavior should be unchanged; if anything, it'd be beta to 7.x changes.

This allows non-CLI users to download & designate @preact/babel as a Babel preset.


GitHub killed my original PR notes... wut

lukeed avatar Sep 07 '18 18:09 lukeed

@lukeed Really appreciate this. Was looking for a dedicated preact babel preset to recommend the other day that works with babel v7 👍

marvinhagemeister avatar Sep 07 '18 19:09 marvinhagemeister

Me too! I want to slice up what I have on PWA's preset-preact (and 7.x here) into these bite-sized chunks.

Repeating config over & over again across build chains is silly

lukeed avatar Sep 07 '18 19:09 lukeed

Does this pass @ForsakenHarmony inspection now?

lukeed avatar Jan 25 '19 23:01 lukeed

still don't know how I feel about fast-async being excluded

also have babel-plugin-macros in there now 👀

I feel like it's best to just have this as like cli-babel-config or smth

ForsakenHarmony avatar Jan 25 '19 23:01 ForsakenHarmony

IE11 has more user share than Edge 17/18 as the time of writing this. I would not recommend going with that "better" not so better coverage.

tomasdev avatar Jan 29 '19 23:01 tomasdev

the difference is, ie 11 keeps us back a lot further than edge, which with that browser list probably doesn't even get special treatment

ForsakenHarmony avatar Jan 30 '19 01:01 ForsakenHarmony

I completely understand that, then the question I should have asked is: what's the purpose of preact-cli? towards production applications used by corporations, or more towards prototypes future-thinking that don't care about usage? Of course it's probably none of the extremes, and in the end it's configurable so... up to the owners. I just threw my opinion.

tomasdev avatar Jan 30 '19 02:01 tomasdev