4 ms·
The inspector does write to inline styles, though if you try to listen for those changes with a mutation observer, it won't fire. I think they disable event pro
by danielvaughn 2y ago
The inspector does write to inline styles, though if you try to listen for those changes with a mutation observer, it won't fire. I think they disable event propagation for inspector-driven DOM changes, which limits your ability to make use of it at the application layer. I've briefly considered just forking chromium, but I don't know C++ and not sure it makes sense to invest in that level of effort.
I don't want to step on your toes by linking my own project, but essentially my idea is: the editor creates an object representation of the html/css which can then be transpiled into any framework the user wants (so long as there is an existing transpiler for it). Then the output could be hosted on npm or some other remote repository for the application repo to install.
- hoakiet98 2y ago> I don't want to step on your toes by linking my own project Not at all, it's in good spirit! Happy to talk through any technical details from my side :) > though if you try to listen for those changes with a mutation observer, it won't fire It doesn't have to fire an immediate mutation imo. When you click on an element to edit, you could inject a data-attribute into it (not sure if the Chrome Devtool let you do this but an extension might). At write-time, you can query the elements that were marked, get the delta and write it to code. You might've thought of this longer than I have so I think that might be a naive solution. > can then be transpiled into any framework the user wants You might be interested in Mitosis https://github.com/BuilderIO/mitosis https://github.com/BuilderIO/mitosis
- danielvaughn 2y agoI hadn't heard of Mitosis, that's super interesting. Thanks for sharing!
- hoakiet98 2y agonp!
- parentheses 2y agoI feel like the way this conversation has gone is one of the biggest pluses of this being OSS. The discussion is less competitive. Discussions in public affect contributorship, it's important that they are positive and have minimal ego.