-
Notifications
You must be signed in to change notification settings - Fork 302
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
zstd-codec support for decompressing files #382
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit message is not good enough.
"cleanup 2 at nxp/master" what's 2 means here? "nxp/master" is not necessary. All person only see nxp/master, suggested commit message like
clean up comments code for webusb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested commit message:
webusb: add zstd decompress support for wic image
webusb/index.js
Outdated
// require("../libwebusb/module.js").run((binding) => {window.binding = binding} ) | ||
// require("./node_modules/zstd-codec/lib/module.js").run((binding) => {window.binding = binding} ) | ||
// window.binding = "test"; | ||
// window.fs = require('fs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments code
@@ -3,26 +3,24 @@ | |||
"version": "0.1.0", | |||
"private": true, | |||
"dependencies": { | |||
"-": "^0.0.1", | |||
"@testing-library/jest-dom": "^5.16.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's "-" means here?
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^13.4.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"fs": "^0.0.1-security", | ||
"g": "^2.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really need "fs" ?
}, | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"build": "react-scripts build; browserify index.js -o build/bundle.js -t babelify --presets es2015; ", | ||
"test": "react-scripts test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supposed, need run browserify before react-script
@@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client'; | |||
import './index.css'; | |||
import App from './App'; | |||
import reportWebVitals from './reportWebVitals'; | |||
// import * as Z from 'zstd-codec' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed commented code
|
||
const processChunk = async(data, curr_len, i) => { | ||
console.log(data, curr_len, i); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid log data, it is too big
async function send_packet(raw_data) { | ||
await USBDevice.transferOut(1, raw_data); | ||
console.log("transferout", raw_data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid log data
if (!flashFile) return; | ||
|
||
const file = flashFile; | ||
let buff = await file.arrayBuffer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed ";"
let totalBytes = 0; | ||
|
||
console.log(data) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid log data, which just for debug
return null; | ||
} | ||
|
||
console.log("finishing unzipping"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am little confused here, after you decompress whole data, then trigger read. did you check memory usage here. You can stop here to check how many memory used by browser.
Thanks, I takes some times to merge your patches. |
No description provided.