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
Riju frontend enhancement #91
Comments
Woah! That's really cool. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@firefish111 @ch1ck3n-byte Please keep conversations on topic. I've marked your preceding comments as spam, and will report future such comments to GitHub Support. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ch1ck3n-byte Not to put too fine a point on it, but you posted nine hi-resolution photographs of cows, followed by eight subsequent comments discussing the cows. As far as I can tell, this bears no relationship whatsoever to the pull request under discussion or this repository itself, and as such I consider it off-topic/spam. |
This comment has been minimized.
This comment has been minimized.
Hey @raxod502 this front end enhancement is currently a separate repo hosted on GitLab. I wanted to get some feedback. Also if this could be replaced with the current front end it will be nice for the end user. Let me know what you think. |
Hey @inaseem, I'm sorry for taking so long to get back to you. I've been occupied by trying to get the underlying infrastructure for Riju stabilized under the load of additional users. Now that things are in a pretty good place, I can look at the issue tracker backlog. As part of the infrastructure stabilization I made it so that LSP isn't enabled until the user explicitly requested it, and this change required some reworking of the frontend to add more interactivity. I took some inspiration from your design when doing this redesign, which you can see live at https://riju.codes/python. Would you mind sharing a link to the code for your version of the frontend, or making a pull request? I wasn't able to find it. One thing I wanted to flag was that I would prefer to avoid turning Riju into an SPA or dynamically loading the HTML content. I don't have any objection to adding JavaScript to power things like a language search, but it should remain optional rather than being required simply to load a static list of languages. I think there's a great middle ground between the current state and what you have that would be a big improvement, nonetheless. |
Hi @raxod502, thank you for the comment above. I understand that stabilizing the core is the hardest of all. The link that I have shared above was an SPA (create react app). And it uses material-ui (CSS in JS) for all the styling. I understand the concerns around SPA. Also the SPA version takes a while to load the webpage. Keeping those things and new features in mind I have migrated all the existing code to Next JS(server side generation). I am not creating a PR as of now as I think that there a few backend changes which are also required. The backend changes would mostly be the addition of 2 routes.
These would be consumed by the Next JS pages on server. Link for the repo: https://gitlab.com/inaseem/riju Answers to some expected questions: Please let me know If this is not something which can serve riju's front end requirements. |
Thanks for sharing the repo! I looked through the code, and I like that things are split into multiple files. And I've seen in past projects that the plain JavaScript approach can face scalability problems once the UI becomes sufficiently complex, so it seems reasonable to try to mitigate those concerns using React, which I've used with reasonable success in the past. In light of that, I think this change would be a welcome improvement, as long as it doesn't increase the code complexity too tremendously.
I'm curious about why these are needed. In the current implementation, the server embeds this information (the list of languages, for the index page, and the details of a single language, for the editor page) directly into the JavaScript served to the client: https://github.com/raxod502/riju/blob/15f959bbeb62b4db985c57a814751f69d880a4a8/frontend/pages/app.ejs#L21-L23 This feels better to me since there is no need for another round-trip API call to the server. Does Next.js not support dynamic templating? The above notwithstanding, per #90 it would actually be better to serve the frontend as a fully static website, which would make it impossible to rely on dynamic templating. So in that case we would need to do things the way you're suggesting anyways. In light of that, I don't see any reason why these API routes can't be added. |
@radox502
Next.js is actually serverless, and while you can run a custom server you can't do something like EJS, which you currently have. A small change might have to be made to the API to get that running. I would think maybe two API routes:
Then Next.js can use getStaticProps (i.e. fetch the data during build phase) so that the data is baked into the site. |
Hey @raxod502 as mentioned by @rayhanadev we can have a custom server, but templating like EJS isn't out of box. For now I have moved the logic to The only issue with getStaticProps is that after we have created a build and released, any new additions to langs object would only be generated in a new build. In a way we would have to manually build and release on each new language addition. If we instead fetch the list of languages and language details using an API route on |
Yeah, as much as it pains me to make a site dynamically loaded when it could be static, it does make sense to remove the dependency of the frontend on the backend language list. Having thought it over, I think we should add API routes for fetching the language list, and populate dynamically. We already require JavaScript for the main application to work, so requiring it for the main page I guess isn't the worst thing. |
Hi @raxod502 , I have forked and added the changes to front end folder. It's currently in a Few additional improvements:
Here is the link to the same branch on the forked repo. https://github.com/inaseem/riju/tree/enhancement/frontend Instruction for running locally,
If you want to check the dev build(it runs very slowly). You can simply go with |
Love it ❤️ |
Hmm, not sure I understand this, you should be able to create a PR just fine regardless of the branch name---I've done so here: #126 Will close this issue so we can continue discussion there. |
Hi, @raxod502 congrats on bringing Riju live again. I have spent a day recreating the Riju front end.
Here is the demo URL.
https://inaseem.gitlab.io/riju
Improvements:
Search
as scrolling to find a language option to click is a little tedious.Additional: (can be implemented/partially implemented)
Note: Clicking/selecting any language would open the JavaScript editor and terminal. It requires languages list from backend so for now its fixed for JavaScript. Also the option to switch language dropdown needs data so that is also on hold.
Screenshots:
Home page
Search
Editor page
Looking forward to hearing from you.
The text was updated successfully, but these errors were encountered: