Skip to content

Commit

Permalink
Swaps out expression objects for array pointers, much perf, more fast
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-schroeder committed Apr 14, 2023
1 parent dcce0a4 commit a940bfc
Show file tree
Hide file tree
Showing 8 changed files with 382 additions and 487 deletions.
57 changes: 21 additions & 36 deletions build/terser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,25 @@ let result = await minify(fs.readFileSync(inputFile, 'utf-8'), {
mangle: {
module: true,
reserved: [
'_k',
'_h',
'_g',
'_m',
'$on',
'$off',
'_do',
'_tk',
'_em',
'_p',
'key',
't',
'r',
'o',
'op',
'dc',
'html',
'exp',
'dom',
'tpl',
// '_m',
// '$on',
// '$off',
// '_em',
// 'key',
// 'memo',
// 't',
// 'r',
// 'w',
// 'html',
],
properties: {
reserved: ['$on', '$off', 'key', 'memo'],
},
},
compress: {
ecma: '2015',
ecma: '2022',
},
ecma: '2015',
ecma: '2022',
sourceMap: {
content: fs.readFileSync(tsSourceMap, 'utf-8'),
url: 'index.min.js.map',
Expand All @@ -51,7 +44,9 @@ fs.writeFileSync(outputFile, result.code, 'utf8')
fs.writeFileSync(outputFile + '.map', result.map, 'utf8')

// IIFE
const iifeInputFile = fileURLToPath(new URL('../dist/index.js', import.meta.url))
const iifeInputFile = fileURLToPath(
new URL('../dist/index.js', import.meta.url)
)
const iifeTsSourceMap = fileURLToPath(
new URL('../dist/index.js.map', import.meta.url)
)
Expand All @@ -63,27 +58,17 @@ let iifeResult = await minify(fs.readFileSync(iifeInputFile, 'utf-8'), {
mangle: {
module: true,
reserved: [
'_k',
'_h',
'_g',
'_m',
'$on',
'$off',
'_do',
'_tk',
'_em',
'_p',
'key',
'memo',
't',
'r',
'o',
'op',
'dc',
'w',
'html',
'exp',
'dom',
'tpl',
'$arrow'
'$arrow',
],
},
compress: {
Expand Down
4 changes: 2 additions & 2 deletions docs/demos/components/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const data = reactive({
const operations = {
'+': (carry, input) => carry + input,
'-': (carry, input) => carry - input,
'÷': (carry, input) => carry / input,
'×': (carry, input) => carry * input,
'÷': (carry, input) => carry / input,
'×': (carry, input) => carry * input,
}

function calculate() {
Expand Down
Loading

0 comments on commit a940bfc

Please sign in to comment.