Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Integrate code editor in developer playground #160

Open
martincollignon opened this issue Sep 27, 2019 · 18 comments
Open

Integrate code editor in developer playground #160

martincollignon opened this issue Sep 27, 2019 · 18 comments

Comments

@martincollignon
Copy link
Contributor

martincollignon commented Sep 27, 2019

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.
@ovbm
Copy link
Contributor

ovbm commented Sep 27, 2019

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

@ovbm ovbm changed the title Code could be editable directly in the developer playground Integrate code editor in developer playground Sep 27, 2019
@corradio
Copy link
Member

corradio commented Sep 27, 2019 via email

@mohinderps
Copy link

Can I take this ?

@corradio
Copy link
Member

I believe this would depend on #161

@ovbm
Copy link
Contributor

ovbm commented Sep 30, 2019

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

@mohinderps
Copy link

Cool!

@ovbm
Copy link
Contributor

ovbm commented Sep 30, 2019

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

@mohinderps
Copy link

mohinderps commented Sep 30, 2019

Sure. Give me some time.

@mohinderps
Copy link

mohinderps commented Oct 1, 2019

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?

@corradio
Copy link
Member

corradio commented Oct 1, 2019 via email

@mohinderps
Copy link

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

@corradio
Copy link
Member

corradio commented Oct 1, 2019 via email

@mohinderps
Copy link

mohinderps commented Oct 2, 2019

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?

@martincollignon
Copy link
Contributor Author

@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?

@mohinderps
Copy link

@martincollignon, yes for sure.

@corradio
Copy link
Member

corradio commented Oct 8, 2019

@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

@martincollignon
Copy link
Contributor Author

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

@mohinderps
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants