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
Is your feature request related to a problem? Please describe.
Currently, the graphql-tag-pluck package (and other tools relying on it, such as graphql-codegen) does not support loading GraphQL documents from files using Ember's .gts and .gjs file extensions. These file formats are introduced in Ember's First-Class Component Templates RFC, and are becoming more widely adopted in the Ember.js ecosystem.
Without support for these file extensions, developers working in Ember.js are forced to work around the problem by either duplicating GraphQL documents in separate .ts files or restructuring their code, which disrupts the natural workflow within Ember.js projects. This creates unnecessary friction, as GraphQL documents cannot be conveniently co-located with component logic when using these newer file formats.
Describe the solution you'd like
I would like graphql-tag-pluck to support plucking GraphQL documents from .gts and .gjs files, just as it does for .ts and .js files. This would enable developers working with Ember's first-class component templates to keep their GraphQL queries and mutations co-located with their component logic.
Describe alternatives you've considered
The primary alternative is to define GraphQL documents in separate .ts files and import them into .gts or .gjs files. While this works, it is inconvenient and reduces the benefits of co-locating code. For example:
It disrupts the modular structure that Ember encourages, where component templates, logic, and queries can be defined together in the same file.
It forces developers to maintain two separate files (one for the query and one for the component logic), increasing the potential for errors and reducing code clarity.
The text was updated successfully, but these errors were encountered:
] (#6521)
* tests: add test cases for gts and gjs files
* feat: support gts and gjs files
* chore: add changeset
* refactor/chore: glimmer package not required, just use @glimmer/syntax
* chore: remove comment
* refactor: make gts & gjs tests reflect glimmer components more accurately
* refactor: use embroider-build/content-tag instead of @glimmer/syntax
* fix: lint errors
* chore: why is prettier being difficult
* chore: add comment about `gjs` file parsing
* refactor: make code more succinct and remove redundant comment
Is your feature request related to a problem? Please describe.
Currently, the
graphql-tag-pluck
package (and other tools relying on it, such as graphql-codegen) does not support loading GraphQL documents from files using Ember's.gts
and.gjs
file extensions. These file formats are introduced in Ember's First-Class Component Templates RFC, and are becoming more widely adopted in the Ember.js ecosystem.Without support for these file extensions, developers working in Ember.js are forced to work around the problem by either duplicating GraphQL documents in separate .ts files or restructuring their code, which disrupts the natural workflow within Ember.js projects. This creates unnecessary friction, as GraphQL documents cannot be conveniently co-located with component logic when using these newer file formats.
Describe the solution you'd like
I would like graphql-tag-pluck to support plucking GraphQL documents from
.gts
and.gjs
files, just as it does for.ts
and.js
files. This would enable developers working with Ember's first-class component templates to keep their GraphQL queries and mutations co-located with their component logic.Describe alternatives you've considered
The primary alternative is to define GraphQL documents in separate
.ts
files and import them into.gts
or.gjs
files. While this works, it is inconvenient and reduces the benefits of co-locating code. For example:The text was updated successfully, but these errors were encountered: