webarkit / ARnft

A small javascript library for WebAR with NFT
GNU Lesser General Public License v3.0
219 stars 53 forks source link

Unnessasarry comment inside of dist/ARnft.js #283

Open tkapu opened 2 years ago

tkapu commented 2 years ago

If you look into the ARnft.js file, then you will notice that about half the file is just commented out Base64 code. I think, that should be removed to reduce the file size. ~1800kb to about ~750kb

kalwalt commented 1 year ago

Hi @tkapu ARnft is based on webarkit/jsartoolkitNFT the base64 code that you were reading is the WASM bitecode bundled with webpack, if you remove that code you will remove the core of it. Probably it is possible to reduce jsartoolkitNFT WASM code reducing emscripten code, but this is not a prority for me.

tkapu commented 1 year ago

Hi @kalwalt, i checked the files in the dist folder of webarkit/jsartoolkitNFT and they look fine. Are you sure, that the ARnft.js file is clean? When i open it with a file editor, the second line starts with //# and when i remove that line completely everything works fine, as before. When i use a minifier tool on the code, then it remove that comment/code as well.

kalwalt commented 1 year ago

I used the TerserPlugin as you can see https://github.com/webarkit/ARnft/blob/5a669820c6ea8fe088a344492bff14592dc201d3/webpack.config.js#L48-L56 I don't see this second line. Maybe have you build the distribution library with the dev option?

tkapu commented 1 year ago

I'm using "yarn build-ts" from the readme file. I was missing the optimization part, but it didn't change my result.

You can see the second line in the file hear on github