Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vanilla repl #779

Closed
wants to merge 29 commits into from
Closed

vanilla repl #779

wants to merge 29 commits into from

Conversation

felixroos
Copy link
Collaborator

@felixroos felixroos commented Nov 2, 2023

approaches #776

hopeful outcomes:

  • simplicity of the codebase (easier to read / change / maintain)
  • better performance

this is a bigger refactoring, with the goal of getting rid of @strudel.cycles/react + its dependency on @uiw/react-codemirror.
Currently, the main pieces of the react package are useStrudel (used in main repl) + MiniRepl (used in docs).
It also holds all of the codemirror themes.
I came to realize that react is not very practical to implement these things, as they are mostly data structures + state management without much ui. It was never a well thought out decision, as the use of react for these non-ui things just grew out of the ui written with react (which is still a good choice imo).
Instead, the plan is to implement the main repl + the mini repl with the @strudel/codemirror package, which is a much thinner wrapper around the core repl (repl.mjs). It is just vanilla js, using codemirror directly instead of going through another wrapper package (@uiw/react-codemirror).

What I've done so far:

  • pull module loading / eval scope population / audio init into prebake + adapt Repl + MiniRepl to it
  • improve codemirror package to support new highlighting logic + some settings (theme, font)
  • manage repl state inside repl.mjs directly using nanostores (not sure about this yet)
  • handle custom keyboard shortcuts in CodeMirror (react package) to see how good codemirror handles them + use them in MiniRepl + Repl
  • refactor nano-repl
  • smarter way to reset sounds on shuffle
  • add /vanilla route with new version of main repl
  • keeping / for testing + maybe PRs will split to be able to test it longer

todo:

  • implement remaining settings in codemirror.mjs
  • test all main repl functions
  • refactor draw / onPaint logic
  • refactor MiniRepl
  • fix: panic will silence fx sends, then add reevaluate + panic stop
  • test nano-repl

@felixroos felixroos mentioned this pull request Dec 14, 2023
@felixroos
Copy link
Collaborator Author

repackaged this partly in #863

@felixroos felixroos closed this Dec 14, 2023
@felixroos felixroos mentioned this pull request Dec 28, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant