Skip to content

Conversation

yaacovCR
Copy link

@yaacovCR yaacovCR commented Jun 19, 2025

@glasser

strategy: use babel to transform our dependency

(A) globally: add @babel/preset-env as a devDependency to support 3 below

(B) in package using an esm dependency such as graphql canary:

  1. switch our "ts-jest" preset to "ts-jest/presets/js-with-babel"
  2. override the default transformIgnorePatterns with an exception for our package of interest
  3. add a babel config file with the @babel/preset-env preset targetting node

-- The babel config files could be a base + override like the other configs in this repo, but it is pretty abbreviated, and this is just a demonstration, so I held off.

context: graphql/graphql-js#4437

@apollo-librarian
Copy link

apollo-librarian bot commented Jun 19, 2025

❌ Docs preview failed

The preview failed to build.

Build ID: 7ce9a93c138c7e984289a7b7

Errors

General: Failed to fetch GitHub source: OK

@yaacovCR
Copy link
Author

Failing tests seem to be the expected ones secondary to the node version restrictions within the graphql-js esm canary.

strategy: use babel to transform our dependency

(A) globally: add @babel/preset-env as a devDependency to support 3 below

(B) in package using an esm dependency such as graphql canary:
1. switch our "ts-jest" preset to "ts-jest/presets/js-with-babel"
2. override the default transformIgnorePatterns with an exception for our package of interest
3. add a babel config file with the @babel/preset-env preset targetting node

-- The babel config files could be a base + override like the other configs in this repo, but it is pretty abbreviated, and this is just a demonstration, so I held off.
@glasser
Copy link
Member

glasser commented Jul 3, 2025

#8083 (comment)

@glasser glasser closed this Jul 3, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants