Skip to content

Commit

Permalink
Merge pull request #1217 from glimmerjs/revert-1216-update-benchmark-…
Browse files Browse the repository at this point in the history
…env-api

Revert "[BREAKING] Update benchmark-env API"
  • Loading branch information
Chris Garrett authored Dec 2, 2020
2 parents 5453b7b + 7c350cb commit 5787762
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions benchmark/benchmarks/krausest/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createBenchmark } from '@glimmer/benchmark-env';

import ApplicationTemplate from './components/Application.hbs';
import Application from './components/Application';
import RowTemplate from './components/Row.hbs';
import Row from './components/Row';
import buildData from './utils/data';

Expand All @@ -11,8 +13,8 @@ import buildData from './utils/data';
export default async function render(element, isInteractive) {
const benchmark = createBenchmark();

benchmark.basicComponent('Row', Row);
benchmark.basicComponent('Application', Application);
benchmark.basicComponent('Row', RowTemplate, Row);
benchmark.basicComponent('Application', ApplicationTemplate, Application);

/** @type {{[name: string]: any}} */
const args = {
Expand Down
2 changes: 1 addition & 1 deletion packages/@glimmer/benchmark-env/src/create-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function createBenchmark(): Benchmark {
templateOnlyComponent: (name) => {
registry.registerComponent(name, null, TEMPLATE_ONLY_COMPONENT_MANAGER);
},
basicComponent: (name, component) => {
basicComponent: (name, _template, component) => {
registry.registerComponent(name, component, basicComponentManager);
},
render: registry.render,
Expand Down
3 changes: 2 additions & 1 deletion packages/@glimmer/benchmark-env/src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dict } from '@glimmer/interfaces';
import { Dict, Template } from '@glimmer/interfaces';
import { SimpleElement } from '@simple-dom/interface';

/**
Expand Down Expand Up @@ -27,6 +27,7 @@ export interface Benchmark {
*/
basicComponent<TComponent extends object = object>(
name: string,
_template: Template,
component: new (args: ComponentArgs) => TComponent
): void;

Expand Down

0 comments on commit 5787762

Please sign in to comment.