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 should build the website #40

Open
NiLSPACE opened this issue Aug 21, 2016 · 12 comments
Open

JavaScript should build the website #40

NiLSPACE opened this issue Aug 21, 2016 · 12 comments

Comments

@NiLSPACE
Copy link
Member

Instead of PHP building all the HTML we should create an API that JavaScript uses to build the website. This way we can create a plugin for Cuberite that allows people to download plugins from the webadmin.

@bearbin
Copy link
Member

bearbin commented Aug 21, 2016

Javascript should not build the website. This is a website, not a webapp. Adding an API would be good, however.

@NiLSPACE
Copy link
Member Author

NiLSPACE commented Aug 21, 2016

It doesn't have to be a complete webapp. Just something similar to this: http://javascript.nilspace.nl/Semester4/Opdracht15/index.php (It's something I had to create for school)

If you look at the network usage (ctrl + shift + q on Firefox) You see that the information for the table rows are received via JS. After that JS puts together a table to show. The same can be done for the index page of the repo. This can save some bandwidth and will make the website feel faster since the whole page doesn't have to be reloaded every time.

And if we're creating an API anyway, why not use it here as well?

@tigerw
Copy link
Member

tigerw commented Aug 21, 2016

I made it with the goal that zero JS would be used :P

@NiLSPACE
Copy link
Member Author

Really? For what reason if I may ask? :P

@tigerw
Copy link
Member

tigerw commented Aug 21, 2016

So it still works without JS, no? All these fancy-pants web developers are JS-this and JS-that these days; they never think and consider how much all that code slows down a poor iPad 1st gen (which I have).

@bearbin
Copy link
Member

bearbin commented Aug 21, 2016

@tigerw I entirely agree. Websites should always work without javascript, and if it is necessary, it should be written in the spirit of progressive enhancement

@NiLSPACE
Copy link
Member Author

If many people are against it then I guess we can close this?

@sphinxc0re
Copy link

@NiLSPACE I like your idea. I mean it's not really a website since it's not only showing content

@curioussavage
Copy link

I understand what @tigerw is saying, we hear that at reddit over and over again from all 10 of our users that are stuck with opera mobile or something 😛 Server side rendering with JS is pretty easy to do these days though.

However I also set out to build a plugin repository a month or two ago because I was going to have some free time for the next few months(or so I thought) and I decided to try to build it on a different stack with minimal JS. I have a flask app running. Almost feature complete except I added votes and I really don't know SQL so I couldn't figure out how to do the joins to filter by most votes... oh well.

The biggest downside to my app and this one IMO is design, they both look terrible (no offense intended) I'm a crappy designer myself. who did cuberite.org? Is there anyone in the community that has some design chops?

On a different note IMO the easiest solution might actually be JS I mean how many cuberite plugins are there? How many will there be? I might be wrong but I think the number is really low. Low enough that a cron job to scrape github every night and update a file (maybe JSON or whatever) and then we have a tiny server that just renders a page with all the plugins, Instead of bothering with a database we can just filter the list client side with that evil JS. Not a crazy single page app just a little filtering. I'm sure there is a JQuery plugin we can just drop in. Less maintenance and no accounts/security concerns. Probably more efficient in this case where we only have a few dozen results.

@curioussavage
Copy link

Actually if we did run a little API/db of plugins then we could write a plugin to hit our api of scraped plugins from github to download.... that actually might be a good argument for running a database.

@madmaxoft
Copy link
Member

It's not only about old slow devices, it's also a bit about security. Quite a lot of people I know like to actually disable JS in their browser to minimize the attack vectors.

On the other hand, I have to ask, how does GitHub login work? Will it work without JS? If not, then the entire point is invalid.

@curioussavage
Copy link

We could get clever and make a way to filter plugins with CSS When js is disabled.

Not too familiar with oauth but I think auth shouldn't be necessary. If anything scraping plugins from github might help encourage plugin authors to follow the conventions for info.lua

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

No branches or pull requests

6 participants