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

JavaScript required for new apps #3378

Open
aparcar opened this issue Dec 1, 2019 · 20 comments
Open

JavaScript required for new apps #3378

aparcar opened this issue Dec 1, 2019 · 20 comments
Labels
RFC issue to Request for Comments

Comments

@aparcar
Copy link
Member

aparcar commented Dec 1, 2019

I'm wondering if all new LuCI apps should be written in JavaScript and LUA is from now on considered legacy and not accepted for new apps anymore.
The documentation seem straight forward enough to easily convert existing LUA code to JS.

Please share your thoughts.

@hnyman
Copy link
Contributor

hnyman commented Dec 1, 2019

I feel that it might be too strict to "require" JavaScript, but it might be "preferred".

Personally I think that it does not make much difference in simple uci config apps without much calculation, logic or interactive status screens. The goal of JS is to move the CPU intensive processing to the client side, but many apps are rather simple and just used for basic uci config.

@aparcar
Copy link
Member Author

aparcar commented Dec 1, 2019 via email

@feckert feckert added the RFC issue to Request for Comments label Dec 2, 2019
@jow-
Copy link
Contributor

jow- commented Dec 2, 2019

Yes, the goal is to get rid of Lua completely for the LuCI base.

@aparcar
Copy link
Member Author

aparcar commented Dec 2, 2019

Should we pin this?

@aparcar aparcar pinned this issue Jan 2, 2020
@aparcar aparcar changed the title [RFC]Require JavaScript for new apps? JavaScript required for new apps Jan 2, 2020
@howard0su
Copy link
Contributor

Where is migration guide to migrate from LUA-based to JS-based project?

@oxr463
Copy link

oxr463 commented May 20, 2020

So the JavaScript apps run on the client-side in the browser vs Lua running via cgi-bin on the device, right?

@feckert
Copy link
Member

feckert commented Dec 22, 2020

Unfortunately, I saw this too late and did not think on this, but I have merged this #4664 and it is written in lua.
I have now another P/R which is also lua and which I also just wanted to merge.
So that I don't make the same mistake in the review and tell people right away that we want javascript, we should communicate this clearly and be in agreement.

I can not revert this #4665 but I can request to write this #4664 in javascript or should I merge them?

@PolynomialDivision
Copy link
Member

write this #4664 in javascript or should I merge them?

I can rewrite that in javascript, but can u maybe link to a good example?
Maybe luci-mod-status is a good example?

@aparcar
Copy link
Member Author

aparcar commented Jan 15, 2021

@PolynomialDivision @howard0su

I'm afraid at this point the best documentation for migrating from Lua is the extensive LuCI JS documentation in combination with pull requests that did the migration in the past, there are multiple.

@PolynomialDivision if you go through the process and find the time it would be great to share the experience and write it down in a document.

@PolynomialDivision
Copy link
Member

@PolynomialDivision if you go through the process and find the time it would be great to share the experience and write it down in a document.

Okay. :) Actually, I have to do document that since we have to rewrite all our luci apps for our community wireless network. Maybe @jonnytischbein will help me? ;)

@theatischbein
Copy link
Contributor

theatischbein commented Jan 16, 2021

Okay. :) Actually, I have to do document that since we have to rewrite all our luci apps for our community wireless network. Maybe @jonnytischbein will help me? ;)

I would love to! :)

@PolynomialDivision
Copy link
Member

I tried now rewrite the luci-app-babeld in javascript:
#4780

@theatischbein
Copy link
Contributor

I did a new rewrite of @PolynomialDivision pr #4791 with javascript dom.

As @aparcar asked I would like to write down my process, but I'm not sure whether using the javascript dom instead of luci dom is okay ?
Also I'm unsure whether using the div classed table as requested here #3927 (comment) is implemented in right way.

Could you please give me some feedback ?

@stangri
Copy link
Member

stangri commented Feb 15, 2021

I was looking to start converting my luci apps and have some questions, should I ask them here or create a new migration-related issue?

@aparcar
Copy link
Member Author

aparcar commented Feb 15, 2021

@stangri please create single issues for that, I think @PolynomialDivision and @jonnytischbein are a tag team to tackle any upcoming questions.

@pmelange
Copy link
Contributor

It would be very helpful if luci-app-splash were ported to JS as an example of an app which has both public and also non-public (authorization requited) content. @PolynomialDivision @jonnytischbein, could you imagine doing this?

@theatischbein
Copy link
Contributor

theatischbein commented Jul 28, 2021

@pmelange in the next few weeks I won't be able to do that. But I am interested. :/

@pmelange
Copy link
Contributor

pmelange commented Sep 7, 2021

@pmelange in the next few weeks I won't be able to do that. But I am interested. :/

Is there any progress on this?

@bam80
Copy link
Contributor

bam80 commented Sep 27, 2022

Sorry for resurrecting the old topic.
I'll just leave this here as it wasn't apparently mentioned:
https://weimarnetz.de/blog/artikel/howto-write-new-luci-apps

With this example app it will be easier to develop new or migrate older LuCI apps. So we hope we can get rid of luci-lua dependencies to create smaller images and have faster routers.

@sourabh-burse

This comment has been minimized.

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

No branches or pull requests