Skip to content

Commit 8e872c5

Browse files
committed
Wip
1 parent a5cc621 commit 8e872c5

File tree

3 files changed

+179
-25
lines changed

3 files changed

+179
-25
lines changed

packages/ember-repl/addon/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
"broccoli-file-creator": "^2.1.1",
6666
"change-case": "^4.1.2",
6767
"common-tags": "^1.8.2",
68+
"content-tag": "^1.0.1",
6869
"line-column": "^1.0.2",
6970
"magic-string": "^0.30.1",
7071
"mdast": "^3.0.0",

packages/ember-repl/addon/src/browser/gjs.ts

+17-14
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@ import { importSync } from '@embroider/macros';
33
import babelPluginEmberTemplateCompilation from 'babel-plugin-ember-template-compilation';
44

55
// TODO: use real packages, and not these copied files from ember-template-imports
6-
import babelPluginIntermediateGJS from './eti/babel-plugin';
7-
import { preprocessEmbeddedTemplates } from './eti/preprocess';
8-
import { TEMPLATE_TAG_NAME, TEMPLATE_TAG_PLACEHOLDER } from './eti/util';
9-
6+
// import babelPluginIntermediateGJS from './eti/babel-plugin';
7+
// import { preprocessEmbeddedTemplates } from './eti/preprocess';
8+
// import { TEMPLATE_TAG_NAME, TEMPLATE_TAG_PLACEHOLDER } from './eti/util';
109
import type { Babel } from './types';
1110

1211
const compiler = importSync('ember-source/dist/ember-template-compiler.js');
1312

14-
export function preprocess(input: string, name: string) {
15-
let preprocessed = preprocessEmbeddedTemplates(input, {
16-
relativePath: `${name}.js`,
17-
includeSourceMaps: false,
18-
includeTemplateTokens: true,
19-
templateTag: TEMPLATE_TAG_NAME,
20-
templateTagReplacement: TEMPLATE_TAG_PLACEHOLDER,
21-
});
13+
import { Preprocessor } from 'content-tag';
2214

23-
return preprocessed.output;
15+
const processor = new Preprocessor();
16+
17+
export function preprocess(input: string, name: string) {
18+
// let preprocessed = preprocessEmbeddedTemplates(input, {
19+
// relativePath: `${name}.js`,
20+
// includeSourceMaps: false,
21+
// includeTemplateTokens: true,
22+
// templateTag: TEMPLATE_TAG_NAME,
23+
// templateTagReplacement: TEMPLATE_TAG_PLACEHOLDER,
24+
// });
25+
26+
return processor.process(input, `${name}.js`);
2427
}
2528

2629
export async function transform(
@@ -33,7 +36,7 @@ export async function transform(
3336
return babel.transform(intermediate, {
3437
filename: `${name}.js`,
3538
plugins: [
36-
[babelPluginIntermediateGJS],
39+
// [babelPluginIntermediateGJS],
3740
[
3841
babelPluginEmberTemplateCompilation,
3942
{

pnpm-lock.yaml

+161-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)