[Exploration] Configure per feature with packages#323
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
9d60316 to
45c53e1
Compare
|
I’m a bit torn here. On one hand, it’s nice to group related functionality together, and to keep things like node_layouts right next to the component registry. @johannesmutter what do you think, do you like the direction described here? |
|
Let me first describe my devx pain here: I'm using svedit now in 9 parallel running active projects, all very different on their surface, but also very similar in certain mechanics, e.g. all have a text node for heading, paragraph, with the same architecture, or a media block (with pipeline) or Slash Menus. In the most recent projects I have perfected the editing ergonomics for e.g. the TextBlock. But bringing them back to the repos that starter earlier is an effort ... haven't tried though to just ask an agent to do this work for me ... but if these components were from the start authored in a more isolated way, swapping them out would be much easier and code / UX wouldn't drift as much as it does now. Installing shadcn components is quite close to an ideal experience: everything nicely packaged. So in principle I like the package structure from the PR, and that it stays flat:
It also reminds of the Block Protocol. Their value proposition was: "Add new blocks to your app with zero marginal implementation cost". The implementation cost is gone now. But the systems thinker in me still things this is right path. A human will prefer cleanly separate modules. So this might boil down to the question: who will be the primary author of Node schemas and components? |
|
Thanks for the comments! Need to reflect more on this, just leaving this here as an experiment for later inspiration for now. It's a controversial topic. I see a lot of projects (especially libraries) moving towards less modularization and config interpretation. e.g. Wordgard (ProseMirror successor). The real use case for packages is on the app level, when you want defined extension points. Only the app knows which extension points to offer. E.g. Svedit doesn't know about a toolbar, but the app might let you configure tools that show up depending if a package is imported or not. So I feel like I might soon try that same thing, but in the Editable app. I feel like I can come up with a configurator pattern for Editable specifically, but not with a generic one that Svedit exposes. I guess Svedit better stays low-level, and hackable to the core. I think sharing functionality across projects like that one TextBlock package is a legit goal but usually backfires, as each app needs something else a little bit and has different assumptions. At least it's super hard to get universal "core commons" that are consumed by multiple projects. Marijn also commented on HN that he has a lot of same code in CodeMirror and Wordgard, but keeps it separate as that's less hassle than trying to make them generic 100% and maintain them in a shared place. |
No description provided.