Best practices for rendering lots of Carta instances #130
-
First, amazing job on this library! I'm a beginner in Svelte, if anything, and it's been really instructive. I'm building a dramaturgy-inspired design system in Svelte, it's basically alternative chat UI for multi-agent environments to be used in LLM context. My team is looking into computational literature, so we needed to make summat that would better reflect the underlying environment: many agent-characters, really elastic, and turns out the standard screenplay format works quite well as general-purpose chat UI! Carta works great for us so far, in fact we use it for both action points and dialogue, however because there are many items like that, we would often need to render 100's of
There's also been this weird error in the DevTools, I wonder if it could somehow be related to Carta or just noise?
I'd looked into options to disable the highlighter, but On the different note: when we use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, I'm glad you like this project. You asked quite a lot of questions, I'll try to answer briefly to all of them.
|
Beta Was this translation helpful? Give feedback.
Hello,
I'm glad you like this project. You asked quite a lot of questions, I'll try to answer briefly to all of them.
Shiki
is because everytime aCarta
class is created, it also comes with a new instance ofShiki
, an highlighter which is imbedded in the class and used for highlighting markdown in the editor. While I could definetely use a singleton for that now that you point it out (I might create an issue for that), since from what I understand most of yourCarta
classes are instantiated for the<Markdown>
component, you could just use oneCarta
instance for all of them (should work fine for almost all cases).