mattdesl / mattdesl/kami

Modularization

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
122
Forks
8
PR merge metrics
No merged PRs in 30d

Description

`kami` is currently pretty big for NPM standards. I'm considering splitting `kami` into a number of smaller modules.

`kami` will export three core modules:
- WebGLContext
- ShaderProgram
- VBO / IBO

The rest would be split like so:
- `kami-fbo` FrameBuffer
- `kami-basebatch` BaseBatch
- `kami-spritebatch` SpriteBatch
- `kami-mesh` Mesh (wraps VBO/IBO)
- `kami-renderer` ImmediateModeRenderer
- `kami-texture` Texture
- `uv-region` TextureRegion (not kami specific)

This is a major breaking change, and demos will need to change to reflect the new structure.

Some downsides:
- Worse module discover. There is going to be a proliferation of kami modules
- Scattered documentation
- Folder fragmentation which makes development a bit more difficult and error-prone
##

Another solution would be to re-think some of the classes to make them truly modular, i.e. not depending on any other aspect of kami. The main difficulty with this is maintaining WebGL context loss.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current kami package structure and how the demos import its classes. Compare the proposed core modules and separate packages, including the WebGL context-loss concern, before choosing an approach. Done means the modular package structure is implemented and the demos reflect the new module boundaries.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.