enjalot / enjalot/blockbuilder
investigate postMessage for providing data from local files
- Dominant language
- JavaScript
- Stars
- 332
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
The way that we load local data files (like `data.csv` or `world-110.json` might be included in a block) is probably non-optimal. In [parseCode.js](https://github.com/enjalot/blockbuilder/blob/master/public/js/utils/parseCode.js#L107) we basically copy the data into the index.html as javascript. This can really balloon the size of the blob for the iframe. I suspect this may cause some crashes when rapidly editing a block with larger files.
An alternative would be to use `postMessage` to request data files by name from within the iframe. This should be relatively straightforward to implement since we [already override](https://github.com/enjalot/blockbuilder/blob/master/public/js/utils/parseCode.js#L135) the browser XHR inside the iframe, and we [use postMessage](https://github.com/enjalot/blockbuilder/blob/master/public/js/utils/parseCode.js#L247) for a small feature from within as well.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.