Skip to content

Commit

Permalink
chore: add comment about gjs file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
DeclanBoller committed Sep 18, 2024
1 parent b82aa86 commit 7075097
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/graphql-tag-pluck/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export default function generateConfig(
plugins.push('typescript');
break;
case '.gjs':
plugins.push('typescript', 'jsx');
// .gjs files need to be parsed as TypeScript because Ember relies on decorators, which are handled by TypeScript.
// without this, it throws a SyntaxError: Unexpected token, expected "{"
// when native decorators are supported, we should remove this
plugins.push('typescript');
break;
default:
plugins.push('jsx', ...dynamicFlowPlugins);
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql-tag-pluck/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,16 @@ const MissingAstroCompilerError = new Error(

const MissingGlimmerCompilerError = new Error(
freeText(`
GraphQL template literals cannot be plucked from a Glimmer template code without having the "@glimmer/syntax" package installed.
GraphQL template literals cannot be plucked from a Glimmer template code without having the "content-tag" package installed.
Please install it and try again.
Via NPM:
$ npm install @glimmer/syntax
$ npm install content-tag
Via Yarn:
$ yarn add @glimmer/syntax
$ yarn add content-tag
`),
);

Expand Down

0 comments on commit 7075097

Please sign in to comment.