Closed pcardune closed 3 years ago
The question is, "are there bugs in CMB that a language author might discover, which can only be explored in the language module?"
There are certainly bugs in CMB, waiting to be discovered. But ideally the design of the modules is such that a bug found in languageX can be replicated without languageX. And if that's true, there's not much gained by exporting the replay functionality.
Language development involves a few steps:
SRC -> AST
: Write a parser for your language, which somehow creates a CMB AST.AST- > DOM
: (Optional) Write some React code for any custom blocks you want to build, either because you don't like the ones CMB provides or because you've added new ASTNodes and you need to render themDOM -> <screen content>
: (Optional) Write some CSS to style those rendered blocksSteps 2 and 3 seem wildly unlikely to uncover bugs in CMB, and even Step 1 is using the most-used and least-complex part of CMB (literally just exported ASTNodes!).
The hard part comes from interacting with the block editor for languageX. The only language-dependent place where these bugs should be cropping up is in the AST creation: if the from/to fields aren't set correctly or the pretty-printer does the wrong thing, all hell breaks loose. But I don't think debugging that requires a replay button! CMB already throws an error for some of these issues, and I'm sure we can improve the quality of those errors within the library itself, rather than having to refactor.
Ok, this is very good information to know. Sounds like the answer is that it is not necessary or worth it to combine/unify the dev server pages for pyret-blocks/codemirror-blocks.
As I mentioned in #37, the dev server web pages from codemirror-blocks and pyret-blocks have diverged. The codemirror-blocks version has a tool for replaying redux action logs, which seems generally useful, and the pyret-blocks version has a tool for switching between themes.
If we want improvements to the codemirror-blocks dev server page to propagate to pyret-blocks, we'll need to do a bit of refactoring in both repositories. Is it worth it?