Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JS runtime for user code #74

Open
feroult opened this issue May 6, 2016 · 1 comment
Open

Add JS runtime for user code #74

feroult opened this issue May 6, 2016 · 1 comment

Comments

@feroult
Copy link
Owner

feroult commented May 6, 2016

I'm planning to add a javascript runtime for user code on YAWP!

With that it will be possible to define endpoints, actions, hooks, pipes, etc, and deploy them automatically without recompiling everything and deploying YAWP! again.

Rhino seems to be outdated and Nashorn is only supported in Java 1.8, which means that we need to go to Appengine Flexible Environment. At first, this is not a real problem, I think that this is just a matter of time anyways.

For the JS part, I was thinking about TypeScript, because it can provide more meta information on classes and methods. Does anyone with experience in TS want to help or give some advise?

Regards

@luanpotter
Copy link
Collaborator

I believe the first step will be to alter EndpointFeatures (and RepositoyFeatures) class to support these changes. Because right now, it just hold references to the classes via Class objects. Those are pretty much immutable as far as I know, or otherwise a pain to make changes to. So we should create proper classes to hold information about the models directly, and upon startup parse all the Classes and fill our own data structure. Then it would be easy to add new fields or whatever. The only problem are the methods, for which references will still have to be kept, for the ones defined in Java, but new ones need to be able to be created with JS code.

Also, there will be a problem regarding changing the Java code after a change via JS, because the models will no longer reflect the reality. But I don't think that's a huge problem for now.

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

No branches or pull requests

2 participants