Release 1.1.0
Done
- Fixed NPM releases
- Added environment to commands
- Test and coverage reports in gitlab
TODO
- Test re-renders
- Add useful commands (echo, env, ls, etc.)
- Add filesystem
Broken
The npm releases have issues with importing other files from within the package.
Retrospective
I did a much better job with small commits and using branches. I also improved my use of CI/CD with better test and coverage reporting. Despite the improvements in my test flow I still need to work on improving coverage. Some tests I tried to get to cover cases for the execution component did not cover the lines I intended them to. This combines with my lack of a good debug tooling in my editor, NeoVim, to make it difficult to write tests for specific lines.
Reasoning
The execution component exists as a result of the way preact checks props updates. Because the function for changing the env is passed with a bind it returns a new reference every time as a result the command re-renders which may cause a change to the env forcing the terminal to re-render. Yay, state loop :( /sar. To prevent this the execution component uses lifecycle methods to abort the render before it happens if there are no changes in the env.env, command, and commands props. This prevents re-renders that cause state loops, yay!