Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ESM and .mts/.cts extensions with jiti loader #1286

Merged
merged 5 commits into from
Mar 6, 2023

Conversation

beerose
Copy link
Collaborator

@beerose beerose commented Mar 3, 2023

Description

A second approach to adding ESM support. The previous one included using tsc and custom caching and this caching bit had a bunch of edge cases that I wasn't aware of in the beginning.

I replaced it with jiti loader and added more test cases. jiti is much faster than running tsc (similar time to cosmic loader).

Related to issues in graphql-code-generator: dotansimha/graphql-code-generator#8509 and dotansimha/graphql-code-generator#8862. More context in this PR: dotansimha/graphql-code-generator#9086.

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Extended existing tests.

Test Environment:

  • OS:
  • GraphQL Config Version:
  • NodeJS:

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests and linter rules pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
graphql-config 4.5.0-alpha-20230306151301-d7b29ec npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2023

💻 Website Preview

The latest changes are available as preview in: https://89159711.graphql-config.pages.dev

@beerose beerose marked this pull request as ready for review March 4, 2023 12:14
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2023

diff --git a/website/algolia-lockfile.json b/website/algolia-lockfile.json
index 802afac..05f4d98 100644
--- a/website/algolia-lockfile.json
+++ b/website/algolia-lockfile.json
@@ -72,7 +72,7 @@
         "anchor": "examples"
       }
     ],
-    "content": "5d4cca1d7d43f0035cfd8e97b7621806",
+    "content": "3f2010b9337e2dba13844da178eeceac",
     "url": "https://www.the-guild.dev/graphql/config/docs/",
     "domain": "https://www.the-guild.dev/graphql/config",
     "hierarchy": [

@dimaMachina dimaMachina merged commit 85bc332 into master Mar 6, 2023
@dimaMachina dimaMachina deleted the cts-mts-support-v2 branch March 6, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants