Skip to content

Commit

Permalink
fix(benchmarks): new packages import
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed Jan 30, 2022
1 parent d035bf4 commit ab56f8a
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 119 deletions.
2 changes: 1 addition & 1 deletion benchmarks/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck

import { createElement, patch } from '../src/index';
import { createElement, patch } from '../packages/million';
import Chart from 'chart.js/auto';
import confetti from 'canvas-confetti';
import { highlight } from 'sugar-high';
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/appendManyRowsToLargeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement, VNode } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(10000);
const createVNode = () => (
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/clearRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(1000);
const oldVNode = (
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/createManyRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(10000);
const oldVNode = <table></table>;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/createRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(10000);
const oldVNode = <table></table>;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/partialUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement, Delta } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(1000);
const oldVNode = (
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/removeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement, Delta } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement, Delta } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(1000);
const oldVNode = (
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/replaceAllRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const shuffleArray = (array: unknown[]) => {
for (
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/selectRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(1000);
const createVNode = () => (
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/suites/swapRows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/
// @ts-nocheck

import { createElement, Delta } from 'million';
import * as simple_virtual_dom from 'simple-virtual-dom';
import * as snabbdom from 'snabbdom';
import * as tiny_vdom from 'tiny-vdom';
import * as virtual_dom from 'virtual-dom';
import { createElement, Delta } from 'million';
import { Suite, vnodeAdapter } from '../benchmark';
import { buildData, patch } from '../data';
import * as tiny_vdom from '../tiny-vdom';

const data = buildData(1000);
const oldVNode = (
Expand Down
31 changes: 0 additions & 31 deletions benchmarks/tiny-vdom/README.md

This file was deleted.

63 changes: 0 additions & 63 deletions benchmarks/tiny-vdom/index.ts

This file was deleted.

5 changes: 3 additions & 2 deletions benchmarks/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ export default defineConfig({
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment',
jsxInject: `import { h, jsxs, Fragment } from 'million/jsx-runtime'`,
jsxInject: `import { h, jsxs, Fragment } from '@million/jsx-runtime'`,
},
resolve: {
alias: {
million: resolve(__dirname, '../src'),
'@million': resolve(__dirname, '../packages'),
million: resolve(__dirname, '../packages/million'),
},
},
plugins: [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"simple-virtual-dom": "^0.1.10",
"snabbdom": "^3.3.1",
"sugar-high": "^0.0.6",
"tiny-vdom": "^0.0.2",
"tslib": "^2.3.1",
"typescript": "^4.5.5",
"unbuild": "^0.6.9",
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"compilerOptions": {
"baseUrl": ".",
"paths": {
"million": ["src/index"],
"million/*": ["src/*"],
"million/jsx-runtime": ["src/jsx-runtime"]
"million": ["packages/million/index"],
"million/*": ["packages/million/*"],
"@million/*": ["packages/*"]
},
"jsx": "react-jsx",
"jsxImportSource": "million",
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default defineConfig({
},
resolve: {
alias: {
million: resolve(__dirname, './src'),
'@million': resolve(__dirname, '../packages'),
million: resolve(__dirname, '../packages/million'),
},
},
test: {
Expand Down

0 comments on commit ab56f8a

Please sign in to comment.