surveyjs / survey-creator

Scalable open-source survey software to generate dynamic JSON-driven forms within your JavaScript application. The form builder features a drag-and-drop UI, CSS Theme Editor, and GUI for conditional logic and form branching.
https://surveyjs.io/open-source
Other
896 stars 370 forks source link

React support (builder) #24

Closed saltas888 closed 7 years ago

saltas888 commented 7 years ago

Do we have something for attaching the builder in a React project?

andrewtelnov commented 7 years ago

@saltas888 It is written using knockout version and we do not have immediate plans to create a react version and have in parallels two version knockout and react, as for library itself. However, you may use it as it is. Do you you have any issues with using the current version in your project? Knockout.js is about 50k in gzip.

Thank you, Andrew

saltas888 commented 7 years ago

Hello Andrew, Yes I made a page where the builder stands alone with knockout js and it works fine. However, I don't prefer using two different frameworks in the same project. Also I need to make some modifications in builder and I haven't any free time to learn the basic in knockout.

So Ι have been inspired from this builder and in the meantime I'm trying to build something similar in React but with much fewer options.

You have made a very good job :) thank you!

dmitry-kurmanov commented 7 years ago

@saltas888 , in fact knockout minified version is 54kb and with HTTP compression (gzip) just 20kb.

saltas888 commented 7 years ago

Yeah, I have noticed that but it's still being an extra library in a React project

dmitry-kurmanov commented 7 years ago

@saltas888 it is good idea to create reactjs version for surveyjs editor. We will think about it.

joshreid commented 7 years ago

@dmitrykurmanov @andrewtelnov Do you have any view on when a react version may be available?

andrewtelnov commented 7 years ago

@joshreid I have tried to divide a knockout and core code of the editor couple months ago. I have understand that it would require a lot of time and we have decided to postpone this task for a while. However, we are going to create examples of using our editor in different platforms, including react. In fact, since we've got several requests about this just on this week, we have decided to work on it right now. I hope in couple of days we will have these demos.

Thank you, Andrew

joshreid commented 7 years ago

Thanks Andrew, that sounds great!

andrewtelnov commented 7 years ago

@joshreid, @tsv2013 has created a repo to start with react and SurveyJS Editor: https://github.com/surveyjs/surveyjs_react_quickstart Could you please try it out?

Thank you, Andrew

joshreid commented 7 years ago

Awesome Andrew, thanks.

Just missing icomoon to compile on start (do you want to start a thread against new repo?):



Error in ./~/surveyjs-editor/surveyeditor.css
Module not found: ./fonts/icomoon.eot in [...]/surveyjs/node_modules/surveyjs-editor

 @ ./~/css-loader?importLoaders=1!./~/postcss-loader!./~/surveyjs-editor/surveyeditor.css 6:10143-10180 6:10203-10240```
tsv2013 commented 7 years ago

@joshreid Thank, you! I've fixed it with 47715c6ac06e84dbc93eb69fb2b3d42f6e512dc1 commit. Fix will be available with the nearest update. Can you as a temporary workaround copy https://github.com/surveyjs/editor/tree/master/src/fonts content in to the "fonts" folder of the "node_modules/surveyjs-editor" folder?

joshreid commented 7 years ago

Excellent - though it needs the folder as well - so I copied in fonts/* and it runs!

tsv2013 commented 7 years ago

@joshreid Good news!