-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor #27
Comments
Worth holding off on this until Polymer 2.0 is released mainline, and upgrade to that at the same time. Will update tasklist to reflect. |
Looking into richtext frameworks a bit more, Draft and Slate are really our only long-term viable options. They're both built on React, which would almost make them untenable for the weight, but there's preact-compat 🎉 . They both should work with that (brings preact to 100% API compatibility), which would make the React(ish) dep absolutely fine. |
@seaneking I had a play with Slate + preact-compat a little while back, it looks good. Unfortunately slate I'm pretty sure still injects a wrapper contenteditable div into the element. It isn't necessarily the end of the world, but it's a real pain. Note that we've been wrapping content during editing on Shady DOM browsers anyway, and so far hasn't been an issue. Also re: size - I don't think we should stress too much about the size. Given we're only going to load in the functionality when Simpla becomes editable, it's ok if it takes a moment to load in those dependencies. |
And wow, looks like Draft wraps up their content in 3 divs 😒 |
It's only while editing though, so as long as those elements don't have any styling associated to them it should be okay. The only edge case is if someone has relied on direct children for styling (ie: That said we should def look into if we can somehow keep their wrappers in shadow dom and reflect content to light dom, even if we just clone the content and hide the shadow dom stuff, or something to that effect. And re: size, are you sure we can only load in (as opposed to execute) a dep when editable? Even so, if we're not actually using React and just need it as a backing to a lib, then Preact would be awesome. Also slightly off-topic, but I think we should make Also FWIW if it comes down to it I'd much prefer to default to Draft, even if Slate has the cleaner API and such, because you just can't beat the fact that Draft has been battle-hardened on Facebook for years. |
What frustrates me, all we need (in my limited understanding of react) is just that As for the wrapper thing, unfortunately already tried that (though maybe try again with the new shadow DOM API) - essentially the |
I take it all back. Made a quick pen looks like it's working in the new v1, very very nice. That works on FF too using https://github.com/skatejs/named-slots polyfill. Still wouldn't work with Slate / Draft out of the box, but opens up a few doors. Edit: doesn't appear to work on Safari. Doesn't work at all in the codepen, doing it manually in safari you can click on contenteditable, and it becomes focused, but can't change the content. Also further digger shows flaws - I'd say its a bug that it is working, reading the spec it implies it shouldn't work AFAIK |
Just to clarify on the content editable and slot, it does work in some browsers, but it definitely is a bug and shouldn't happen. |
#29 Simpla-text needs to be rebuilt from the ground up to polished and ready for 1.0. The biggest change will be replacing Scribe with a modern, abstracted richtext framework that doesn't rely on the native (broken) contenteditable API.
Major components:
simpla-richtext-behavior
.utility
components)The text was updated successfully, but these errors were encountered: