status-im / status-fiddle

Online UI editor for status-react
10 stars 9 forks source link

Implement parinfer editor and autocompile react native views #3

Closed flexsurfer closed 6 years ago

flexsurfer commented 6 years ago

Implement similar functionality to http://escherize.com/cljsfiddle/, with the next differences 1) page should be simpler - only two forms, code editor and a resulting view 2) compilation should be automatic (with error handling), no run button 3) code for parinfer editor should be as simple as possible with minimum assets 4) it should be possible to enter react-native-web components and see the result

image

Edited: please see comments to https://github.com/status-im/status-fiddle/pull/5

status-open-bounty commented 6 years ago

Balance: 0.000000 ETH Tokens: SNT: 1100.00 Contract address: 0x56b5812c4dee81ec744c75fc47a75975c7adab19 Network: Mainnet Paid to: poiga Visit https://openbounty.status.im to learn more.

flexsurfer commented 6 years ago

hey @poiga do you want to continue work? or maybe @foopang wants to try?

foopang commented 6 years ago

@flexsurfer thanks for inviting me to work on it, maybe I can try next time. I am pretty sure @poiga can deliver better work than I do :)

shaunlebron commented 6 years ago

@poiga @flexsurfer

👋 Just a heads up—it's much easier to use Parinfer through the official parinfer-codemirror library now. I'm on call for questions!

ghost commented 6 years ago

@shaunlebron any CDNs for that?

flexsurfer commented 6 years ago

that's cool @shaunlebron , thanks , i'll take a look how we can use it

shaunlebron commented 6 years ago

@poiga you can use unpkg

flexsurfer commented 6 years ago

@poiga added little bit SNT for research

flexsurfer commented 6 years ago

@poiga https://github.com/shaunlebron/parinfer-codemirror/blob/master/demo.html this looks much simpler, so we need just to "add" CodeMirror to reagent form and listen to cm content changes

ghost commented 6 years ago

@flexsurfer I will Inversigate

ghost commented 6 years ago

@shaunlebron I am searching for some "on edit" callback for 'cm = CodeMirror(document.body);' instance. any advice please?

shaunlebron commented 6 years ago

@poiga try cm.on('change', ...) or cm.on('changes', ...)

shaunlebron commented 6 years ago

@poiga btw, Parinfer will not try to correct code when changes come from cm.setValue—this helps us avoid reaction loops. So it should be okay syncing your reagent state with CodeMirror using setValue after receiving its value from cm.getValue inside on('change'), if that's what you're trying.

I personally have been bitten too much by trying to use React to control the state of components not designed for React, so you may wanna avoid it completely. But I'm here for questions whichever you decide.

ghost commented 6 years ago

@shaunlebron I am working on https://github.com/poiga/status-fiddle/blob/some-work-with-cljsfiddle/src/cljs/status_fiddle/views.cljs line 15. Looks like this lib does the job. Nice!

shaunlebron commented 6 years ago

@poiga @flexsurfer Great work! Please let me know if something is misbehaving with parinfer-codemirror! My incentive is to make it very solid, so I'm willing to change/fix things depending on how people are using. Thanks! đź‘Ť