question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Most 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 required 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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ngokevincommented, Jul 2, 2018

Yeah, after I dig in a bit and get set up, I think I’d get to playing with some unit tests.

1reaction
ngokevincommented, Jul 2, 2018

Thanks for filing! I haven’t started working on the project or anything but benefits of splitting up IMO could be:

  • Being able to see what parts of the codebase were changed in Git (imagine core.js ++500 additions --250 deletions versus vr.js +250 additions, xr.js +200 additions).
  • Not having to jump up and down a single file when editing multiple parts of it.
  • Easier to unit test individual modules.
  • Split out and organize parts of the code to make it easier to find things (e.g., what parts run in a window worker and what parts doesn’t).
  • Easier to avoid Git conflicts during large refactors.

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 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found