bloom-contrib icon indicating copy to clipboard operation
bloom-contrib copied to clipboard

Integrate code editor in developer playground

Open martincollignon opened this issue 5 years ago • 18 comments

Purpose:

Be able to write and edit code of an integration directly in the playground.

  • On integration selection its code is shown in playground code editor.
  • Create a button "New integration", which fills the editor with a template for new creation.
  • run button runs the code.

martincollignon avatar Sep 27 '19 12:09 martincollignon

Possible candidates: https://www.npmjs.com/package/react-simple-code-editor

ovbm avatar Sep 27 '19 13:09 ovbm

Also: react-monaco-editor

On Fri, Sep 27, 2019 at 3:02 PM Olivier Baumann [email protected] wrote:

Possible candidates: https://www.npmjs.com/package/react-simple-code-editor

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tmrowco/tmrowapp-contrib/issues/160?email_source=notifications&email_token=AAMUIKHXTBZTFEAUXLIXYETQLX75BA5CNFSM4I3GBONKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7Y2FCY#issuecomment-535929483, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUIKH7DYWLQ4VHANRUCXDQLX75BANCNFSM4I3GBONA .

--

Olivier Corradi

Founder, CEO

https://www.linkedin.com/in/oliviercorradi https://twitter.com/corradio

tmrow.com

corradio avatar Sep 27 '19 14:09 corradio

Can I take this ?

mohinderps avatar Sep 27 '19 16:09 mohinderps

I believe this would depend on #161

corradio avatar Sep 27 '19 16:09 corradio

#161 Should be merged today so you could start working on it soon.

ovbm avatar Sep 30 '19 07:09 ovbm

Cool!

mohinderps avatar Sep 30 '19 07:09 mohinderps

It's merged, if you want to have a go. If you do, assign the issue to yourself and add it to the "in progress" column on the project: https://github.com/tmrowco/tmrowapp-contrib/projects/2

ovbm avatar Sep 30 '19 10:09 ovbm

Sure. Give me some time.

mohinderps avatar Sep 30 '19 11:09 mohinderps

Once I have a string of code from the code editor, how do I run connect and other functions from that string of code? Do I need to parse it to create on object of all the required methods or Is there some other way out?

mohinderps avatar Oct 01 '19 09:10 mohinderps

It's not easy to be honest. I think the best could be to pass it through websocket to the backend which could either:

  1. run eval to evaluate the code

  2. write it to the filesystem where the integration resides such that it causes the backend to reload, and also makes it easier to commit in git

  3. is probably the simplest. We can make a "save" feature that saves it to disk later on?

On Tue, Oct 1, 2019 at 11:46 AM Mohinder Saluja [email protected] wrote:

Once I have a string of code from the code editor, how do I run connect and other functions from that string of code? Do I need to parse it or Is there some other way out?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tmrowco/tmrowapp-contrib/issues/160?email_source=notifications&email_token=AAMUIKF7BLQV3EHWDMZAEJ3QMML57A5CNFSM4I3GBONKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAAVOTY#issuecomment-536958799, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUIKBHH657B4UKZHHVBETQMML57ANCNFSM4I3GBONA .

--

Olivier Corradi

Founder, CEO

https://www.linkedin.com/in/oliviercorradi https://twitter.com/corradio

tmrow.com

corradio avatar Oct 01 '19 09:10 corradio

Let me see if this can be done with eval and get back to you. And then we can decide further.

mohinderps avatar Oct 01 '19 10:10 mohinderps

sounds good, thanks!

On Tue, Oct 1, 2019 at 12:09 PM Mohinder Saluja [email protected] wrote:

Let me see if this can be done with eval and get back to you. And then we can decide further.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tmrowco/tmrowapp-contrib/issues/160?email_source=notifications&email_token=AAMUIKEQSB2CSL5EGSHIO7DQMMOUDA5CNFSM4I3GBONKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAAXSSY#issuecomment-536967499, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMUIKG7ZSEPWUVLYKJRDQ3QMMOUDANCNFSM4I3GBONA .

--

Olivier Corradi

Founder, CEO

https://www.linkedin.com/in/oliviercorradi https://twitter.com/corradio

tmrow.com

corradio avatar Oct 01 '19 10:10 corradio

Hey

  1. I wanted to test an integration through playground. Which one of the existing integrations would be the right one to do so. And also I would need the credentials to do so.

  2. A typical integration code will have import statements too. For example, Uber integration has the following imports:

import { ACTIVITY_TYPE_TRANSPORTATION, TRANSPORTATION_MODE_CAR } from '../../definitions';

import env from '../loadEnv'; import { OAuth2Manager } from '../authentication'; import { HTTPError } from '../utils/errors';

Now how to eval this code. I can transform the imports to requires, but how am I actually gonna import the content of those files?

mohinderps avatar Oct 02 '19 09:10 mohinderps

@FelixDQ @corradio would one of you mind to give a hand here? @mohinderps , once you have the answer, could you update our Readme with these details?

martincollignon avatar Oct 08 '19 07:10 martincollignon

@martincollignon, yes for sure.

mohinderps avatar Oct 08 '19 07:10 mohinderps

@mohinderps isn't it possible to eval all the source code's content, including the import? I don't think it will be good to transform to requires instead. Maybe someone from the JS community can help us on evaluating files that include import statements

corradio avatar Oct 08 '19 15:10 corradio

Hi @mohinderps , any chance you've had time to look at this?

martincollignon avatar Oct 20 '19 18:10 martincollignon

Hey @martincollignon. I am not sure about how to go forward with this. As @corradio said, and I agree with him, someone from the JS community needs to help.

mohinderps avatar Oct 22 '19 03:10 mohinderps