You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just to give my 2c, I'm not sure if exports.development and exports.production target conditionsa are widely supported, so some import.env shenanigans may still be necessary until that's widely adopted.
#4063
Closed
Heyitsquoracom opened this issue
Apr 18, 2024
· 1 comment
Just to give my 2c, I'm not sure if `exports.development` and `exports.production` target conditionsa are widely supported, so some `import.env` shenanigans may still be necessary until that's widely adopted.
On the topic of this, I find this section a lot more interesting and that's often been on my mind:
you end up in a mix of CJS and ESM, and the instanceof checks break on you.
In my opinion, with graphql-js’ unique situation of being a reference standard implementation, it's rather unfortunate that the schema-parts of this library are limited to reference equality when it comes to inheritance chains and checks, and I'd love to see this part be simply removed and replaced. (Be that with static constants, symbol checks, typed Symbol.toStringTag checks, etc)
This might of course force some level of API-intercompatibility with graphql itself across versions, but that's already a reality that exists for the AST, which sees much more re-use and adoption.
imho the problem of ESM and CJS exports being both imported and then intercompatible, which can sometimes happen in Node, is an optimisation-opportunity/issue that's to be fixed and discovered by users, but it's highly inconvenient that the instanceof checks break in these scenarios.
Fixing the ESM/CJS bundling issues doesn't get rid of the underlying problem of the instanceof checks imho. So no matter what the outcome here is, I'd love to see that addressed too, if everyone's in favour
On the topic of this, I find this section a lot more interesting and that's often been on my mind:
In my opinion, with
graphql-js
’ unique situation of being a reference standard implementation, it's rather unfortunate that the schema-parts of this library are limited to reference equality when it comes to inheritance chains and checks, and I'd love to see this part be simply removed and replaced. (Be that withstatic
constants, symbol checks, typedSymbol.toStringTag
checks, etc)This might of course force some level of API-intercompatibility with
graphql
itself across versions, but that's already a reality that exists for the AST, which sees much more re-use and adoption.imho the problem of ESM and CJS exports being both imported and then intercompatible, which can sometimes happen in Node, is an optimisation-opportunity/issue that's to be fixed and discovered by users, but it's highly inconvenient that the
instanceof
checks break in these scenarios.Fixing the ESM/CJS bundling issues doesn't get rid of the underlying problem of the
instanceof
checks imho. So no matter what the outcome here is, I'd love to see that addressed too, if everyone's in favourOriginally posted by @kitten in #4062 (comment)
The text was updated successfully, but these errors were encountered: