ember-cli / ember-compatibility-helpers

Helpers that allow you to write backwards compat Ember addons
MIT License
24 stars 20 forks source link

Support Babel 7 #25

Closed alexlafroscia closed 5 years ago

alexlafroscia commented 5 years ago

This change updates the addon to support Babel 7 (and ember-cli-babel) 7.

This could be treated as a breaking change, or not. Technically, babel-plugin-debug-macros supports both Babel 6 and 7 (right now) and the custom plugin that's part of this addon didn't need to be changed at all to support Babel 7. I'm just not sure if you want to go about supporting both versions, or make a hard break now and just support Babel 7.

Closes #24

pzuraq commented 5 years ago

This package is used by a few addons that have wider support matrixes/usage base, like ember-decorators, so I'm not sure if it'd be best to drop support entirely for babel 6 immediately. Would it be possible to support both at once? Or is it the same issue with @ember-decorators/argument where we'd need to include different versions of the transform?

rwjblue commented 5 years ago

I would prefer to add 7 without dropping older Babel version support...

alexlafroscia commented 5 years ago

Would it be possible to support both at once

Totally! This should "just work" -- let me look into how to run the tests against both to make sure that support doesn't regress in the future.

rwjblue commented 5 years ago

I think swapping the ember-cli-babel version in ember-try config could work, but the discrepancies in the fixtures (that you had to fix here) will require some extra work (to assert against both Babel 6 and Babel 7)...

alexlafroscia commented 5 years ago

@rwjblue any tips on how to handle those differences in the fixtures?

I've seen other Babel plugins that support multiple versions have two versions of the fixtures -- maybe two versions of the fixtures? Two different test suites? Not sure what would be the best approach.

alexlafroscia commented 5 years ago

What I'm going to try right now (and seems to be working) is to duplicate the Node tests and have separate Babel 6 and 7 directories, and then configure ember-try with 4 scenarios

The Ember tests really aren't anything right now, but if that ever changes this will handle it.

rwjblue commented 5 years ago

That sounds nice, thank you for keeping at it...

alexlafroscia commented 5 years ago

I'm not sure why, but my initial pass at getting the tests to pass against Babel 6 didn't work...

I started over, breaking up the changes into more sensible commits, and it seems to be all working now 🤷‍♂️

screen shot 2018-09-17 at 3 59 00 pm
pzuraq commented 5 years ago

Thanks again for getting this over the line @alexlafroscia!