Closed ghost closed 6 years ago
hey @poiga thanks for your effort, this is the right direction :) is it possible to decrease number of assets and files, do we really need all these js and css files?
@flexsurfer Please try now. All should be good except styling of the divs.
thanks @poiga that's exactly what we need, let's just do something like
(defn main-panel []
[react/view {:style {:flex-direction :row :padding-vertical 50}}
[react/view {:style {:flex 1 :padding-horizontal 50}}
[code-mirror]]
[react/view {:style {:flex 1 :padding-horizontal 50}}
[dom-pane]]])
and we need two more things in this PR 1) errors handling, because now it crashes if enter something like
[:h1 "Hello World!"
[]]
2) and react-native-web
support, it should be possible to enter react/view
in editor
Thanks!
@poiga for 2 you just need to add [status-fiddle.react-native-web :as react]
(str "(ns cljs.user
(:refer-clojure :exclude [atom])
(:require reagent.core [status-fiddle.react-native-web :as react]))
(def atom reagent.core/atom)"
(or (not-empty cljs-string)
"[:div]"))
@poiga please share your thoughts about 1. errors handling, i think we could try on change before dispatch event , render first in some test div to do not crash our app, and if it rendered without errors we could dispatch event to render our reagent form, what do you think?
@flexsurfer I am investigating this problem at the moment. I may try your approach as well.
ok, thanks @poiga , no rush, just my thoughts, let's find better way
@flexsurfer I got an idea to use same assertions as Hiccup uses before rendering.
@flexsurfer please check now!
@poiga can we render the previous valid view and show warning text under form? so the idea while you typing code we should see previous valid render and warning text if current code can't be rendered, thanks
@poiga and also you forgot main thing :) initialize parinfer (.init js/parinferCodeMirror cm)
@poiga still crashes if type something like ["test test"]
with space or ["test!"]
@flexsurfer please check now!
@poiga react
ns doesn't work anymore, i mean [react/view]
not valid because this (not (keyword? (nth vec 0 nil))) false
@flexsurfer please check now!
thanks for your effort @poiga , i think we're done!
Fixes #3 status: wip
Just showing the progress. I need the your opinions Going to refactor many things here.