Skip to content

Commit

Permalink
Begin moving towards invokable wire format
Browse files Browse the repository at this point in the history
- Eliminate special high-level opcodes
- By modifying the statements and expressions to use the new encoder APIs,
it will be easier for us to emit the encoder calls directly from the
wire format
- Split modifier and component to resolved variants
- Clarify args wire format
- Separate kinds of component invocations
- Disentangle the types of helpers
- Streamline components
  • Loading branch information
wycats committed Feb 21, 2025
1 parent c9d5c6c commit 3717287
Show file tree
Hide file tree
Showing 145 changed files with 10,411 additions and 6,250 deletions.
5 changes: 5 additions & 0 deletions .meta-updater/catalog/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"rollup": "^4.34.4"
}
}
12 changes: 10 additions & 2 deletions .meta-updater/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createUpdateOptions } from '@pnpm/meta-updater';
import repo, { getPackageInfo, WORKSPACE_ROOT } from '@glimmer-workspace/repo-metadata';
import { json, packageJson } from './formats/json.mjs';
import { code } from './formats/code.mjs';
import catalog from './catalog/package.json' with { type: 'json' };

/**
* @import { PackageInfo } from '@glimmer-workspace/repo-metadata';
Expand Down Expand Up @@ -67,11 +68,17 @@ export default () =>

update(scripts, 'test:publint', 'publint');

const devDependencies = /** @type { JsonObject } */ (actual.devDependencies ??= {});

for (const [name, version] of Object.entries(catalog.devDependencies)) {
if (name in devDependencies) {
update(devDependencies, name, version);
}
}

// Packages are built if they're published and have at least one `.ts` entry point that is
// not a `.d.ts` file **or** if they are explicitly marked as built via `repo-meta.built`.
if (pkg['repo-meta']?.built) {
const devDependencies = /** @type { JsonObject } */ (actual.devDependencies ??= {});

update(devDependencies, '@glimmer-workspace/env', 'workspace:*');

update(scripts, 'prepack', 'rollup -c rollup.config.mjs');
Expand All @@ -95,6 +102,7 @@ export default () =>
}

cleanup(actual, 'publishConfig');
cleanup(actual, 'devDependencies');
return actual;
},

Expand Down
2 changes: 1 addition & 1 deletion .prototools
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node = "22"
node = "lts"
pnpm = "latest-10"
16 changes: 5 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"[javascript][typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.fixAll.eslint": "always",
"source.formatDocument": "always"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
Expand Down Expand Up @@ -36,34 +36,28 @@
"eslint.codeAction.showDocumentation": {
"enable": true
},
"eslint.codeActionsOnSave.mode": "all",
"eslint.codeActionsOnSave.mode": "problems",
"eslint.enable": true,
"eslint.lintTask.enable": true,
"eslint.onIgnoredFiles": "warn",
"eslint.options": {
"overrideConfigFile": "./eslint.config.js"
},
"eslint.problems.shortenToSingleLine": true,
"eslint.runtime": "node",
"eslint.useFlatConfig": true,
"eslint.validate": ["javascript", "typescript", "json", "jsonc"],
"eslint.workingDirectories": [
{
"pattern": "."
"mode": "auto"
}
],
"explorer.excludeGitIgnore": true,
"files.exclude": {
"**/.DS_Store": true,
"**/.git": true,
"**/dist": true,
"ts-dist": true,
"**/node_modules": true,
"tracerbench-results": true
},
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true
},
"inline-bookmarks.expert.custom.styles": {
"active": {
"dark": {
Expand Down Expand Up @@ -128,7 +122,7 @@
"@bandaid(?!\\()"
]
},
"inline-bookmarks.view.showVisibleFilesOnly": true,
"inline-bookmarks.view.showVisibleFilesOnly": false,
"javascript.preferences.importModuleSpecifier": "project-relative",
"javascript.updateImportsOnFileMove.enabled": "always",
"rewrap.autoWrap.enabled": true,
Expand Down
2 changes: 2 additions & 0 deletions benchmark/benchmarks/krausest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
"@glimmer/opcode-compiler": "file:packages/@glimmer/opcode-compiler.tgz",
"@glimmer/program": "file:packages/@glimmer/program.tgz",
"@glimmer/reference": "file:packages/@glimmer/reference.tgz",
"@glimmer/syntax": "file:packages/@glimmer/syntax.tgz",
"@glimmer/util": "file:packages/@glimmer/util.tgz",
"@glimmer/validator": "file:packages/@glimmer/validator.tgz",
"@glimmer/wire-format": "file:packages/@glimmer/wire-format.tgz",
"@glimmer-workspace/env": "file:packages/@glimmer-workspace/env.tgz"
}
}
Expand Down
2 changes: 1 addition & 1 deletion bin/opcodes.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"AppendSafeHTML",
"AppendDocumentFragment",
"AppendNode",
"AppendText",
"AppendValue",
"OpenElement",
"OpenDynamicElement",
"PushRemoteElement",
Expand Down
26 changes: 15 additions & 11 deletions bin/setup-bench.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ $.verbose = true;
* can be used to reuse the checked out control branch.
*/
const FRESH_CONTROL_CHECKOUT = !process.env['REUSE_CONTROL'];
const FRESH_EXPERIMENT_CHECKOUT = !process.env['REUSE_EXPERIMENT'];

/*
Expand Down Expand Up @@ -93,16 +94,18 @@ const pnpm = await which('pnpm');

// set up experiment
{
await $`rm -rf ${EXPERIMENT_DIRS.root}`;
await $`mkdir -p ${EXPERIMENT_DIRS.bench}`;
await $`cp -r ${EXPERIMENT_DIRS.src}/* ${EXPERIMENT_DIRS.bench}/`;
await $`${pnpm} build --output-logs=new-only`;
await buildKrausestDeps({
roots: { benchmark: EXPERIMENT_DIRS.bench, workspace: WORKSPACE_ROOT },
});
await $`rm -rf ${EXPERIMENT_DIRS.bench}/node_modules`;
await $({ cwd: EXPERIMENT_DIRS.bench })`${pnpm} install`;
await $({ cwd: EXPERIMENT_DIRS.bench })`${pnpm} vite build`;
if (FRESH_EXPERIMENT_CHECKOUT) {
await $`rm -rf ${EXPERIMENT_DIRS.root}`;
await $`mkdir -p ${EXPERIMENT_DIRS.bench}`;
await $`cp -r ${EXPERIMENT_DIRS.src}/* ${EXPERIMENT_DIRS.bench}/`;
await $`${pnpm} turbo prepack --output-logs=new-only`;
await buildKrausestDeps({
roots: { benchmark: EXPERIMENT_DIRS.bench, workspace: WORKSPACE_ROOT },
});
await $`rm -rf ${EXPERIMENT_DIRS.bench}/node_modules`;
await $({ cwd: EXPERIMENT_DIRS.bench })`${pnpm} install`;
await $({ cwd: EXPERIMENT_DIRS.bench })`${pnpm} vite build`;
}
}

// make sure that the origin is up to date so we get the right control
Expand Down Expand Up @@ -139,10 +142,11 @@ console.info({
await $`rm -rf ${CONTROL_DIRS.bench}`;
// Intentionally use the `krausest` folder from the experiment in both
// control and experiment
await $`mkdir -p ${CONTROL_DIRS.bench}`;
await $`cp -r ${EXPERIMENT_DIRS.src}/* ${CONTROL_DIRS.bench}/`;

await $({ cwd: CONTROL_DIRS.repo })`${pnpm} install`;
await $({ cwd: CONTROL_DIRS.repo })`${pnpm} build --output-logs=new-only`;
await $({ cwd: CONTROL_DIRS.repo })`${pnpm} turbo prepack --output-logs=new-only`;

const benchmarkEnv = join(CONTROL_DIRS.repo, 'packages/@glimmer-workspace/benchmark-env');

Expand Down
41 changes: 19 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"version": "0.92.0",
"license": "MIT",
"description": "Glimmer compiles Handlebars templates into document fragments rather than string buffers",
"repository": {
"type": "git",
"url": "git+https://github.com/glimmerjs/glimmer-vm.git"
},
"author": "Tilde, Inc.",
"type": "module",
"exports": null,
Expand All @@ -19,6 +15,7 @@
"browserstack:results": "ember browserstack:results",
"build:control": "rollup -c rollup.config.mjs",
"build:flags": "RETAIN_FLAGS=true ember build --env production --suppress-sizes",
"build:packages": "turbo run prepack",
"clean": "node ./bin/clean.mjs",
"link:all": "esyes ./bin/link-all.mts",
"lint:fix": "turbo test:lint -- --fix && prettier -w .",
Expand Down Expand Up @@ -47,14 +44,14 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@babel/preset-env": "^7.26.7",
"@babel/preset-typescript": "^7.26.0",
"@babel/runtime": "^7.26.0",
"@babel/traverse": "^7.26.4",
"@babel/types": "^7.26.3",
"@babel/runtime": "^7.26.7",
"@babel/traverse": "^7.26.7",
"@babel/types": "^7.26.7",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@eslint/config-inspector": "^0.7.1",
"@eslint/js": "9.17.0",
"@eslint/config-inspector": "^1.0.0",
"@eslint/js": "9.19.0",
"@glimmer-workspace/benchmark-env": "workspace:*",
"@glimmer-workspace/build-support": "workspace:*",
"@glimmer-workspace/eslint-plugin": "workspace:*",
Expand All @@ -63,7 +60,7 @@
"@glimmer-workspace/repo-metadata": "workspace:*",
"@glimmer/env": "0.1.7",
"@pnpm/meta-updater": "^2.0.3",
"@pnpm/workspace.find-packages": "^1000.0.3",
"@pnpm/workspace.find-packages": "^1000.0.7",
"@rollup/plugin-sucrase": "^5.0.2",
"@rollup/plugin-terser": "^0.4.4",
"@tsconfig/strictest": "^2.0.5",
Expand All @@ -74,11 +71,11 @@
"@types/eslint-community__eslint-plugin-eslint-comments": "workspace:*",
"@types/eslint-plugin-qunit": "workspace:*",
"@types/eslint__eslintrc": "^2.1.2",
"@types/node": "^20.17.10",
"@types/node": "^22.13.1",
"@types/preval.macro": "^3.0.2",
"@types/qunit": "^2.19.12",
"@typescript-eslint/parser": "^8.20.0",
"@typescript-eslint/utils": "^8.20.0",
"@typescript-eslint/parser": "^8.23.0",
"@typescript-eslint/utils": "^8.23.0",
"amd-name-resolver": "^1.3.1",
"auto-dist-tag": "^2.1.1",
"babel-plugin-macros": "^3.1.0",
Expand All @@ -89,26 +86,26 @@
"ember-cli": "~4.12.3",
"ember-cli-browserstack": "^2.1.0",
"ensure-posix-path": "^1.1.1",
"eslint": "^9.18.0",
"eslint": "^9.19.0",
"eslint-config-flat-gitignore": "^1.0.0",
"eslint-config-prettier": "10.0.1",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-interactive": "^11.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-x": "^4.6.1",
"eslint-plugin-jsonc": "^2.18.2",
"eslint-plugin-jsonc": "^2.19.1",
"eslint-plugin-n": "17.15.1",
"eslint-plugin-qunit": "^8.1.2",
"eslint-plugin-regexp": "^2.7.0",
"eslint-plugin-simple-import-sort": "12.1.1",
"eslint-plugin-unused-imports": "4.1.4",
"esyes": "^1.0.3",
"execa": "^7.2.0",
"fast-glob": "^3.3.2",
"fast-glob": "^3.3.3",
"glob": "^10.4.5",
"globals": "^15.14.0",
"js-yaml": "^4.1.0",
"knip": "^5.41.1",
"knip": "^5.43.6",
"loader.js": "^4.7.0",
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
Expand All @@ -119,16 +116,16 @@
"qunit": "^2.23.1",
"release-plan": "0.11.0",
"rimraf": "^5.0.10",
"rollup": "^4.31.0-0",
"rollup": "^4.34.4",
"semver": "^7.6.3",
"testem-failure-only-reporter": "^1.0.0",
"toml": "^3.0.0",
"tracerbench": "^8.0.1",
"ts-node": "^10.9.2",
"turbo": "^2.3.3",
"typescript": "^5.7.3",
"typescript-eslint": "^8.19.0",
"vite": "^6.0.10",
"typescript-eslint": "^8.23.0",
"vite": "^6.1.0",
"vitest": "^3.0.4",
"zx": "^8.3.0"
},
Expand All @@ -148,7 +145,7 @@
"packageManager": "[email protected]",
"pnpm": {
"notes": {
"override:@glimemr/syntax": "when we run prettier, we want to use our local copy of prettier, not the one it declared in its package.json. This ensures that we don't accidentally break prettier as we make changes to @glimmer/syntax"
"override:@glimmer/syntax": "when we run prettier, we want to use our local copy of prettier, not the one it declared in its package.json. This ensures that we don't accidentally break prettier as we make changes to @glimmer/syntax"
},
"overrides": {
"@glimmer/syntax": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CompileTimeComponent, EvaluationContext } from '@glimmer/interface
import { unwrapHandle } from '@glimmer/debug-util';

export function compileEntry(entry: CompileTimeComponent, context: EvaluationContext) {
return unwrapHandle(entry.compilable!.compile(context));
return unwrapHandle(entry.layout!.compile(context));
}

export async function measureRender(
Expand Down
2 changes: 1 addition & 1 deletion packages/@glimmer-workspace/benchmark-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@glimmer/interfaces": "workspace:*",
"eslint": "^9.18.0",
"publint": "^0.3.2",
"rollup": "^4.31.0-0",
"rollup": "^4.34.4",
"typescript": "*"
},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions packages/@glimmer-workspace/build/lib/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface PackageJSON {
readonly types: string;
readonly private: boolean;
readonly name: string;
readonly devDependencies?: Record<string, string>;
}

type SimpleExternal = { [P in string]: 'inline' | 'external' };
Expand Down
Loading

0 comments on commit 3717287

Please sign in to comment.