Open bjhess opened 6 days ago
🤔 it looks like your alignment isn't being added to the editor. Could you show me thats setting up the editor? A minimal reproduction would be super helpful if possible, otherwise I'm largely just guessing.
As for the dependency tree, I dont love it either. I even relaxed versioning in the latest release back to "^2.2.0"
to allow for better deduplication, but its largely a product of the "every extension is a package" approach of TipTap, and ProseMirror itself being like 5+ packages.
Nothing about this "sparks joy"
https://generator.jspm.io/#U2NhYGBkDM0rySzJSU1hKMrIzMvXTU3JLMkvcjDQMzTSMwAAEiVj2iIA
However, it is hard to beat the ecosystem of ProseMirror and TipTap, so it is a tradeoff.
There is a pre-bundled /exports/bundle/index.module.js
for CDN usage, but could hit some weird edge cases about duplicate dependencies because dependencies are "inlined" in that pre-bundled version, so I try not to have people use it unless they really need to.
https://rhino-editor.vercel.app/tutorials/getting-started#manual-importmaps-installation
Sorry, yes, we add it as a part of our initialization process via:
rhino.addExtensions([
Heading,
Typography,
PastedMarkdown,
Youtube,
TextAlign.configure({
types: ['heading', 'paragraph'],
alignments: ['left', 'center', 'right']
})
])
A minimal reproduction would be super helpful if possible, otherwise I'm largely just guessing.
I'm hoping the best way is for me to figure out how to do that via the base library Rails test app, and then maybe push up a branch with the breakage? Alternatively I can maybe put together a little Rails app with the minimum necessary to recreate? I'm happy to set up whatever your preference would be long-term for bug troubleshooting. (Either one may take me a minute, though!)
Sorry, yes, we add it as a part of our initialization process via:
rhino.addExtensions([ Heading, Typography, PastedMarkdown, Youtube, TextAlign.configure({ types: ['heading', 'paragraph'], alignments: ['left', 'center', 'right'] }) ])
A minimal reproduction would be super helpful if possible, otherwise I'm largely just guessing.
I'm hoping the best way is for me to figure out how to do that via the base library Rails test app, and then maybe push up a branch with the breakage? Alternatively I can maybe put together a little Rails app with the minimum necessary to recreate? I'm happy to set up whatever your preference would be long-term for bug troubleshooting. (Either one may take me a minute, though!)
That works for me, but because you are using importmaps, it may be different since the test rails app is using Vite. I'm hoping to start putting sandboxes together to make things easier to clone down and work with.
I tried my best to get the Rhino repo in line with what we have, and alignment didn't break so it seems unlikely that Rhino is the culprit. Here's what it looked like: https://github.com/bjhess/rhino-editor/commit/e0c95d2dcfd22218d6d056f4638d3c4013e6d351
So I tested with JSPM importmaps and it seems to be working fine.
https://codepen.io/paramagicdev/pen/poMpgEY
However, I did notice a double load issue.
Confirmed bug with arrays:
- ary.push(ext.flat(1) as unknown as AnyExtension);
+ ary = ary.concat(ext.flat(1) as unknown as AnyExtension);
Should fix it. I'll work on a regression test + fix the double extension loading issue.
Thank you!
I'm not very comfortable filing this as an issue because I don't have a lot of information to provide. And I find the dependency tree for these things maddening and there's a > 50% chance this issue has nothing to do with Rhino. But I thought I'd file the issue so I can start understanding where the borders and boundaries are, as well as understanding @KonnorRogers's preferences on these things.
Right now we have the Tiptap TextAlign extension deployed successfully with:
When updating to the latest rhino-editor via
bin/importmap pin "rhino-editor"
, this puts us more like:Our editor button looks something like this (note the
click->rhino#alignRight
action):Our implementation of
alignRight
looks as so in ourrhino_controller.js
stimulus file:And our error: