Skip to content

Commit 391715f

Browse files
committed
trying to run ember-eui
explore - sub expressions in on modifier word boundary replacement fix compiler, add helper/modifier/component helpers better modifiers EuiAccordion, EuiPanel pretty plugin + + carrying args exploration + + + + playing with ember component reactivity inside let argument +
1 parent 14c0abd commit 391715f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4766
-200
lines changed

index.html

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
<link rel="stylesheet" href="/src/style.css" />
1515
</head>
1616
<body>
17+
<script>
18+
window.global = window;
19+
</script>
1720
<div id="app"><!--ssr-outlet--></div>
1821
<script type="module">
1922
import App from "/src/index.ts";

package.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,23 @@
6666
"devDependencies": {
6767
"@glint/core": "^1.3.0",
6868
"@glint/template": "^1.3.0",
69+
"@babel/core": "^7.23.6",
70+
"@babel/plugin-syntax-decorators": "^7.23.3",
71+
"@babel/preset-typescript": "^7.23.3",
72+
"@babel/standalone": "^7.23.8",
73+
"@ember-eui/core": "^8.0.4",
74+
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
75+
"@glint/environment-ember-template-imports": "^1.2.1",
76+
"@glint/environment-glimmerx": "^1.2.1",
6977
"@lifeart/tiny-router": "^0.0.8",
7078
"@playwright/test": "^1.40.1",
7179
"@types/babel__core": "^7.20.5",
7280
"@types/qunit": "^2.19.9",
7381
"autoprefixer": "^10.4.16",
82+
"babel-import-util": "^2.0.1",
7483
"backburner.js": "^2.8.0",
84+
"express": "^4.18.2",
85+
"happy-dom": "^13.0.6",
7586
"nyc": "^15.1.0",
7687
"postcss": "^8.4.33",
7788
"prettier": "^3.1.1",
@@ -90,8 +101,6 @@
90101
"vite-plugin-dts": "^3.7.0",
91102
"vitest": "^1.1.1",
92103
"zx": "^7.2.3",
93-
"express": "^4.18.2",
94-
"happy-dom": "^13.0.6",
95104
"glint-environment-gxt": "file:./glint-environment-gxt"
96105
},
97106
"dependencies": {

plugins/babel.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ export function processTemplate(
104104
);
105105
}
106106
},
107-
CallExpression(path: any) {
107+
// @ts-expect-error context is not used
108+
CallExpression(path: any, context: Context) {
108109
if (path.node.callee && path.node.callee.type === 'Identifier') {
109110
if (path.node.callee.name === 'scope') {
110111
path.remove();
@@ -122,6 +123,24 @@ export function processTemplate(
122123
path.node.arguments.pop();
123124
}
124125
}
126+
} else if (path.node.callee.name === 'precompileTemplate') {
127+
// const template = path.node.arguments[0].quasis[0].value
128+
// .raw as string;
129+
// const isInsideClassBody = context.isInsideClassBody === true;
130+
// const hasThisInTemplate = template.includes('this');
131+
// let hasThisAccess =
132+
// isInsideClassBody === true || hasThisInTemplate;
133+
// // looks like it's function based template, we don't need to mess with it's context hell
134+
// if (context.isInsideReturnStatement === true) {
135+
// hasThisAccess = true;
136+
// }
137+
// hbsToProcess.push({
138+
// template,
139+
// flags: {
140+
// hasThisAccess: hasThisAccess,
141+
// },
142+
// });
143+
// path.replaceWith(t.identifier('$placeholder'));
125144
}
126145
}
127146
},

plugins/compiler.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type Plugin } from 'vite';
22
import { Preprocessor } from 'content-tag';
33
import { transform } from './test';
4-
import { MAIN_IMPORT } from './symbols';
4+
// import { MAIN_IMPORT } from './symbols';
55
import { type Flags, defaultFlags } from './flags.ts';
66
import { HMR, fixExportsForHMR, shouldHotReloadFile } from './hmr.ts';
77

@@ -50,6 +50,7 @@ export function compiler(mode: string, options: Options = {}): Plugin {
5050
} else {
5151
defineValues = {};
5252
}
53+
defineValues['process.env.BABEL_TYPES_8_BREAKING'] = false;
5354

5455
return {
5556
define: defineValues,
@@ -83,12 +84,15 @@ export function compiler(mode: string, options: Options = {}): Plugin {
8384
);
8485
}
8586
}
86-
if (!code.includes(MAIN_IMPORT)) {
87-
return;
88-
}
87+
// if (!code.includes(MAIN_IMPORT)) {
88+
// return;
89+
// }
8990
let result: string | undefined = undefined;
9091
if (scriptFileRegex.test(file)) {
9192
const source = code;
93+
// if (code.includes('precompileTemplate')) {
94+
// console.log(code);
95+
// }
9296
const result = transform(
9397
source,
9498
file,

plugins/converter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ASTv1 } from '@glimmer/syntax';
1+
import { type ASTv1 } from '@glimmer/syntax';
22
import {
33
type HBSControlExpression,
44
type HBSNode,
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import * as runtime from './runtime.ts';
2+
(globalThis as any)['dt7948'] = runtime;

0 commit comments

Comments
 (0)