Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update s2 to use published version from npm #1422

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 9 additions & 1 deletion frameworks/keyed/s2/package-lock.json

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

11 changes: 8 additions & 3 deletions frameworks/keyed/s2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
"version": "1.0.0",
"description": "s2 demo",
"js-framework-benchmark": {
"frameworkVersion": "1.0.0",
"frameworkHomeURL": "",
"issues": [800]
"frameworkVersionFromPackage": "s2-engine",
"frameworkHomeURL": "https://gr0uch.github.io/s2",
"issues": [
800
]
},
"scripts": {
"build-dev": "echo 0",
Expand All @@ -20,5 +22,8 @@
"repository": {
"type": "git",
"url": "https://github.com/krausest/js-framework-benchmark.git"
},
"dependencies": {
"s2-engine": "^1.0.17"
}
}
13 changes: 11 additions & 2 deletions frameworks/keyed/s2/src/bench.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import s2 from './main.min.js'
import s2 from '../node_modules/s2-engine/dist/main.mjs';
//s2.debug=true
cleanupTemplates();

Expand Down Expand Up @@ -49,7 +49,7 @@ function select () {
this.cls = 'danger';
}

const [node, proxy] = s2(state, document.querySelector('#main'))
const [proxy, node] = s2(state, document.querySelector('#main'))
document.body.appendChild(node)
window.p = proxy

Expand All @@ -75,6 +75,15 @@ var id = 0
function create (label, number) {
return function () {
bench(label, function () {
// Technical note: the keyed behavior for array replacement can be forced
// by resetting it first. Removing this would default to non-keyed behavior.
//
// This *could* be the default behavior in the library itself, but would be
// a de-optimization for the common use case of replacing an array with another.
// Even if the default behavior was keyed, non-keyed could still be forced by
// mutating objects in the array.
proxy.rows = null

proxy.rows = buildData(number)
})
}
Expand Down