tleunen / babel-plugin-module-resolver

Custom module resolver plugin for Babel
MIT License
3.45k stars 205 forks source link

revert breaking change of reselect dependency update #446

Closed mansona closed 5 months ago

mansona commented 5 months ago

~both glob@9 and~ reselect@5 dropped support for Node 16. If we want to update [this dependency] then we should ship it as a major, not a patch

https://github.com/tleunen/babel-plugin-module-resolver/pull/445 is where the [package was] updated

tleunen commented 5 months ago

@mansona hmmm Reading the changelog for glob@9, it does support Node 16 and above. For reselest@5, it doesn't specify anything but the tests here didn't break for node 16, I'm not sure why.

Are you sure it's all related to this?

mansona commented 5 months ago

Hey @tleunen you're right, glob didn't change their node support, I think I confused myself when looking into this earlier today.

The real issue is reselect because v5 is now making use of optional chaining in their dist. It's true that they are not declaring this as a Node version change but I'm assuming that's because they are expecting the code to go through a babel transform in their testing suite. You can see the issue here: https://github.com/embroider-build/ember-auto-import/actions/runs/8741674479/job/23988288576?pr=620#step:6:17

node_modules/reselect/dist/cjs/reselect.cjs:166
        CURRENT_TRACKER?.add(this);
                        ^

    SyntaxError: Unexpected token '.'

I'm not exactly sure why your CI hasn't picked this up 🤔

tleunen commented 5 months ago

I see, thank you! Could you update the MR to revert only reselect then? I'll quickly throw another version

mansona commented 5 months ago

@tleunen updated 👍