Break up core.js
See original GitHub issueMost of the “browser” part of the Exokit browser is in core.js.
There is no good reason for it being contained in one file; it’s convenient but it makes the code seem scarier than it is to newcomers.
core.js
should already have a reasonably coherent layout and factoring; we just need to classify the pieces and break them up into their own files that are require
d in.
A lot of this is just copy-paste.
File/directory sections
This is a rough idea for the files/directories we’d probably want:
- Network
- GL
- Audio
- Video
- Canvas
- Scripting contexts
- VR
- XR
- Magic Leap
- Leap Motion
- Events
- DOM
- Observers
- Window
- Document
- Bootstrap
- Runtime loop/queues
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
zloirock/core-js: Standard Library - GitHub
Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2023: promises, symbols, collections, iterators, typed arrays, many other ...
Read more >[AskJS] Is it just me or is core-js fundamentally broken? - Reddit
I'm clearly missing something as there is no way this is even remotely acceptable.
Read more >Best way to break up a function - JavaScript - Stack Overflow
A couple of quick things: Move data preparation to a different function. Return false if no data to precess in order to avoid...
Read more >core-js is polyfilling more than needed (#235509) - GitLab
No tasks are currently assigned. Use tasks to break down this issue into smaller parts. Linked items. 0.
Read more >Code Splitting - webpack
This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, after I dig in a bit and get set up, I think I’d get to playing with some unit tests.
Thanks for filing! I haven’t started working on the project or anything but benefits of splitting up IMO could be:
core.js ++500 additions --250 deletions
versusvr.js +250 additions, xr.js +200 additions
).When reading core.js, I’m not sure what’s contained inside it or what structure it has without reading the whole thing but would be easier to get a picture if I could see as directories + files. Plus your username is @modulesio 😃