Uh oh!
There was an error while loading. Please reload this page.
feat(esm): add support for .gmrc as an ES Module - #140
Conversation
Uh oh!
There was an error while loading. Please reload this page.
benjie
commented
Sep 23, 2021
You know what... Let's just drop Node 10 support. Node 12 should handle this natively and 10 is no longer LTS anyway. |
benjie
commented
Sep 23, 2021
@guillaumervls Please could you test to see if this works in your setup? I anticipate it will. |
guillaumervls
commented
Sep 23, 2021
@benjie Yes it works! (also I've fixed the prettier fail) |
benjie
left a comment
There was a problem hiding this comment.
Looks good to me. This will need more than a patch bump and we'll have to officially remove Node 10 support, but I'll do that in a follow-up PR.
I'm working on PostGraphile this week and this does not seem urgent so I'm going to delay merging it, but it's approved ready to go 👍
andrew-w-ross
commented
Jul 14, 2022
@benjie Any chance this pr will ever get merged in? It's almost been a year and node 12 has reached eol let alone Node 10. |
benjie
commented
Jul 14, 2022
Just tested this on Node 16 and it breaks commonJS compatibility 😞 |
benjie
commented
Jul 14, 2022
It turns out this doesn't use the native import due to TypeScript configuration. |
benjie
left a comment
There was a problem hiding this comment.
I've pushed up a commit that tries to do the right thing the first time by hinting CJS or MJS; however the await import(relativePath) calls are being rewritten by TypeScript to await Promise.resolve().then(() => require(relativePath)) - i.e. they're not using ESM at all.
I wonder if anyone tried to run the previous version of this PR, my testing suggested that it doesn't work with CJS, and the rewriting of the import() implies it also wouldn't have worked with ESM?
Someone needs to tell TypeScript to not rewrite the await import(...) syntax, then I think this is good to go.
benjie
commented
Jul 14, 2022
@andrew-w-ross Feel free to raise a PR against this branch to fix the remaining issues. |
@benjie I gave it a go this evening and to actually fix it I'd have to change typescript module mode to |
andrew-w-ross
commented
Jul 26, 2022
@benjie Have you had a chance to look at that pr I opened? |
benjie
commented
Nov 8, 2023
(The above mentioned PR was #161 for anyone looking.)
|
codygordon
commented
Apr 20, 2026
@benjie what is the status of being able to use |
benjie
commented
Apr 22, 2026
Hard to say; I want to integrate the middleware system and potentially even the plugin system, the API surface area will potentially need to become more async, and I want to overhaul all the TypeScript stuff to work with ESM/etc smoothly and move to a minimum version of Node 22... Will also need to either update Jest to work smoothly with ESM or replace it with If you do fancy taking any of this on, you should take inspiration from how I set things out in the Graphile Crystal monorepo, and we should use |
Followup of #129 (comment)