-
Notifications
You must be signed in to change notification settings - Fork 318
zstd-codec support for decompressing files #382
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
Open
sarahfwang
wants to merge
17
commits into
nxp-imx:master
Choose a base branch
from
sarahfwang:nxp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
787880f
cleanup 2 at nxp/master
08b5fd6
webusb: add zstd decompress support for wic image
a4c7c4e
webusb: add zstd decompress support for wic image
65755ae
merge
wwang00 34a07ae
working on this, change later
wwang00 9816f3f
bunch of stuff that doesn't work
e311d62
scuffed, but logic is correct
b4c8df1
can decompress one chunk and do promises in an async callback
wwang00 8ab6186
decompress multiple chunks one after another
wwang00 fffc0d4
Merge branch 'master' of https://github.com/nxp-imx/mfgtools into nxp
d8a3095
todo: flash for board
9fd7296
decompress works
5a5926e
deleted a lot of Decompress copies and notes
33d942b
deleted some lines
9bd2e54
tyring to make it look better
8f7ecce
more pretty demo
880ead2
test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ CMakeCache.txt | |
*.clst | ||
*.snap | ||
node_modules | ||
build | ||
build | ||
*-lock.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
On branch nxp | ||
Your branch is ahead of 'nxp/master' by 2 commits. | ||
(use "git push" to publish your local commits) | ||
|
||
Changes not staged for commit: | ||
(use "git add <file>..." to update what will be committed) | ||
(use "git restore <file>..." to discard changes in working directory) | ||
modified: webusb/package.json | ||
|
||
Untracked files: | ||
(use "git add <file>..." to include in what will be committed) | ||
d.txt | ||
|
||
no changes added to commit (use "git add" and/or "git commit -a") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
window.ZstdCodec = require('zstd-codec').ZstdCodec; | ||
require("zstd-codec/lib/module.js").run((binding) => {console.log("running", binding); window.binding = binding} ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
errors you keep running into: | ||
|
||
must init git submodule for zstd | ||
must start the emsdk thing to use emcc in terminal | ||
updating node version to do serve -s build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,26 +3,24 @@ | |
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"-": "^0.0.1", | ||
"@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 commentThe reason will be displayed to describe this comment to others. Learn more. really need "fs" ? |
||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-scripts": "^5.0.1", | ||
"web-vitals": "^2.1.4" | ||
"web-vitals": "^2.1.4", | ||
"zstd-codec": "^0.1.4" | ||
}, | ||
"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 commentThe reason will be displayed to describe this comment to others. Learn more. supposed, need run browserify before react-script |
||
"eject": "react-scripts eject" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
|
@@ -35,5 +33,8 @@ | |
"last 1 safari version" | ||
] | ||
}, | ||
"proxy": "http://localhost:5000" | ||
"devDependencies": { | ||
"@babel/core": "^7.22.9", | ||
"babelify": "^10.0.0" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useEffect, useState } from "react" | ||
import useDecompress2 from '../logic/useDecompress2' | ||
|
||
const Decompress = () => { | ||
const [flashFile, setFlashFile] = useState(); | ||
const [{ | ||
requestUSBDevice | ||
}] = useDecompress2(flashFile); | ||
|
||
useEffect(()=> { | ||
console.log(ZstdCodec) | ||
console.log(window.binding); | ||
}, []) | ||
|
||
return ( | ||
<div> | ||
file to decompress: | ||
<input type="file" onChange={(e) => setFlashFile(e.target.files[0])}/> | ||
|
||
<button onClick={requestUSBDevice}>Pair USBDevice </button> | ||
</div> | ||
) | ||
} | ||
|
||
export default Decompress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
.new-app { | ||
font-family: Arial,sans-serif; | ||
padding-left: 2rem; | ||
} | ||
|
||
.button { | ||
background-color: white; | ||
color: black; | ||
padding: 5px 10px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 10px; | ||
border: thin black solid; | ||
text-transform: uppercase; | ||
font-weight: 600; | ||
cursor: pointer; | ||
} | ||
|
||
.button-secondary { | ||
background-color: darkorange; | ||
color: white; | ||
padding: 5px 10px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 10px; | ||
border: thin darkorange solid; | ||
text-transform: uppercase; | ||
font-weight: 600; | ||
cursor: pointer; | ||
} | ||
|
||
.file-action-container{ | ||
width: 14rem; | ||
} | ||
|
||
.file-name-container { | ||
align-items: center; | ||
margin-right: 4rem; | ||
} | ||
|
||
.popup-container { | ||
width: 40rem; | ||
} | ||
|
||
.file-input-container { | ||
background-color: white; | ||
color: black; | ||
padding: 5px 10px; | ||
text-align: center; | ||
text-decoration: none; | ||
display: inline-block; | ||
font-size: 10px; | ||
border: thin black solid; | ||
text-transform: uppercase; | ||
font-weight: 400; | ||
} | ||
.file-input { | ||
display: none; | ||
} | ||
|
||
.instruction-title { | ||
margin-bottom: 1rem; | ||
} | ||
|
||
.instruction-elt { | ||
margin-bottom: 0.5rem; | ||
} | ||
|
||
.instruction-container { | ||
flex:1; | ||
} | ||
|
||
.popup { | ||
margin-top: 2rem; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?