Skip to content
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
run: pnpm build:types
- name: Check internal types
run: pnpm type-check:internals
- name: Check @handlebars/parser types
run: pnpm type-check:handlebars
- name: Check published types
run: pnpm type-check:types

Expand Down Expand Up @@ -222,7 +220,7 @@ jobs:
SHOULD_TRANSPILE_FOR_NODE: true
run: pnpm build
- name: test
run: pnpm test:node && pnpm --filter "@handlebars/parser" test
run: pnpm test:node

blueprint-test:
name: Blueprint Tests
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/glimmer-syntax-prettier-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
- "packages/@glimmer/interfaces/**"
- "packages/@glimmer/util/**"
- "packages/@glimmer/wire-format/**"
- "packages/@handlebars/parser/**"
pull_request:
paths:
- ".github/workflows/glimmer-syntax-prettier-smoke-test.yml"
Expand All @@ -27,7 +26,6 @@ on:
- "packages/@glimmer/interfaces/**"
- "packages/@glimmer/util/**"
- "packages/@glimmer/wire-format/**"
- "packages/@handlebars/parser/**"
workflow_dispatch:

permissions:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ npm-debug.log
# couple of the files. Once it is, we can switch this over to just ignoring
# `types/stable` entirely.
types/stable

# Generated Peggy parser (regenerate with: pnpm build:hbs-parser)
packages/@glimmer/syntax/lib/hbs-parser/parser.js
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ docs/
**/smoke-tests/
**/types/
**/type-tests/
packages/@handlebars/**/*.l
packages/@handlebars/**/*.yy
CHANGELOG.md
package.json
pnpm-lock.yaml
internal-docs/**/*.md
packages/@glimmer/syntax/lib/hbs-parser/parser.js
packages/@glimmer/syntax/lib/parser/html5-named-char-refs.js
*.peggy
tracerbench-testing/
12 changes: 1 addition & 11 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export default [
'**/type-tests/',
'internal-docs/guides/**',
'packages/@glimmer-workspace/**',
'packages/@handlebars/parser/lib/parser.js',
'packages/@handlebars/parser/src/**',
'packages/@glimmer/syntax/lib/hbs-parser/parser.js',
'tracerbench-testing/',
],
},
Expand Down Expand Up @@ -189,15 +188,6 @@ export default [
'import/namespace': 'off',
},
},
{
files: ['packages/@handlebars/parser/spec/**/*.js'],

languageOptions: {
globals: {
...globals.mocha,
},
},
},
{
files: [
'packages/*/tests/**/*.[jt]s',
Expand Down
1 change: 0 additions & 1 deletion internal-docs/guides/development/build-constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ The build system has specific rules for what gets inlined vs treated as external
- TypeScript helper library (`tslib`)

**Always External:**
- `@handlebars/parser`
- `simple-html-tokenizer`
- `babel-plugin-debug-macros`
- Other `@glimmer/*` packages (to avoid duplication)
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"actions-up": "pnpm dlx actions-up",
"bench": "node ./bin/benchmark.mjs",
"bench:precompile": "node --expose-gc bin/precompile.bench.mjs",
"build:hbs-parser": "peggy --format es --allowed-start-rules Template,ExpressionWithParamsAndHash packages/@glimmer/syntax/lib/hbs-parser/hbs.peggy -o packages/@glimmer/syntax/lib/hbs-parser/parser.js",
"build:js": "rollup --config",
"prepare": "pnpm build:hbs-parser",
"build:types": "node types/publish.mjs",
"build": "npm-run-all build:*",
"docs": "ember ember-cli-yuidoc",
Expand All @@ -56,7 +58,6 @@
"test:browserstack": "node bin/run-browserstack-tests.js",
"test:wip": "vite build --mode development --minify false && testem ci",
"type-check:internals": "tsc --noEmit",
"type-check:handlebars": "tsc --noEmit --project packages/@handlebars/parser/tsconfig.json",
"type-check:types": "tsc --noEmit --project type-tests",
"type-check": "npm-run-all type-check:*"
},
Expand Down Expand Up @@ -126,6 +127,7 @@
"mitata": "^1.0.34",
"mocha": "^11.0.0",
"npm-run-all2": "^8.0.0",
"peggy": "^5.1.0",
"prettier": "^3.5.3",
"qunit": "^2.19.4",
"recast": "^0.22.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/@ember/template-compiler/lib/compile-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ function buildCompileOptions(_options: EmberPrecompileOptions): EmberPrecompileO
}

if (options.strictMode) {
options.keywords = STRICT_MODE_KEYWORDS;
// Include fn/on as keywords for runtime compilation so the strict mode
// validation pass allows them. The auto-import-builtins plugin will
// rewrite them to __ember_keywords__.fn / __ember_keywords__.on.
options.keywords = [...STRICT_MODE_KEYWORDS, 'fn', 'on'];
}

return options;
Expand Down
10 changes: 3 additions & 7 deletions packages/@glimmer-workspace/test-utils/lib/syntax-error.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { formatSyntaxError } from '@glimmer/syntax';

export function syntaxErrorFor(
message: string,
code: string,
moduleName: string,
line: number,
column: number
): Error {
let quotedCode = code ? `\n\n|\n| ${code.split('\n').join('\n| ')}\n|\n\n` : '';

let error = new Error(
`${message}: ${quotedCode}(error occurred in '${moduleName}' @ line ${line} : column ${column})`
);

const error = new Error(formatSyntaxError(message, code, moduleName, line, column));
error.name = 'SyntaxError';

return error;
}
1 change: 1 addition & 0 deletions packages/@glimmer-workspace/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {},
"dependencies": {
"@glimmer/interfaces": "workspace:*",
"@glimmer/syntax": "workspace:*",
"@glimmer/util": "workspace:*"
},
"devDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion packages/@glimmer/syntax/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export {
SpanList,
} from './lib/source/span-list';
export { BlockSymbolTable, ProgramSymbolTable, SymbolTable } from './lib/symbol-table';
export { generateSyntaxError, type GlimmerSyntaxError } from './lib/syntax-error';
export {
formatSyntaxError,
generateSyntaxError,
type GlimmerSyntaxError,
} from './lib/syntax-error';
export { cannotRemoveNode, cannotReplaceNode } from './lib/traversal/errors';
export { default as WalkerPath } from './lib/traversal/path';
export { default as traverse } from './lib/traversal/traverse';
Expand Down
Loading
Loading