GithubHelp home page GithubHelp logo

Comments (5)

amigalemming avatar amigalemming commented on June 10, 2024

Please, please, please, no JavaScript! JavaScript leads very quickly to unusable sites. I have disabled JavaScript for security reasons. But even with enabled JavaScript, most JavaScript sites do not work on browsers other than the browser of the developer.

from hackage-server.

chrisdone avatar chrisdone commented on June 10, 2024

I think what @amigalemming is saying is a good point, content archives should not stop working without JavaScript enabled. However, there's nothing wrong with implementing graceful degradation. Which is what Github does, for example.

from hackage-server.

dcoutts avatar dcoutts commented on June 10, 2024

So the reason to consider JS stuff is not because it's cool or slick, but because it could make the server side implementation simpler. The server already has to implement REST style PUT for resources, but the html pages cannot make use of this with html4 forms because they can only do POST using annoying form encodings. This means the server has both to support normal REST using normal representations and also POST using html form encodings. This is a pain, duplicates code and leads to tighter coupling of the presentation and data layers.

If we could use JS on the browser then we can use PUT and do sequences of operations, like any other REST client.

So this only helps if we don't have to also do the fallback to html4 forms & POST handlers.

from hackage-server.

chrisdone avatar chrisdone commented on June 10, 2024

The Hackage userbase is a peculiar one that likes to disable JavaScript a lot (I see this in the community often), so disregarding those needs for the sake of making dev work easier would obviously be insensitive. Though I'm interested to see why the model depends so much on the input method.

from hackage-server.

dcoutts avatar dcoutts commented on June 10, 2024

We could still do this for some of the admin parts of the site.

@chrisdone when you're using a more classic REST API style, setting some info may require a sequence of calls, e.g. POST to create some resource, PUT a couple extra optional attributes. But you cannot do that with a html UI using html4 forms. You need a POST handler matching just what the UI wants to set all in one go.

Here's a more concrete example: hackage has a users feature which has all the basics of user accounts, auth etc. then there's separate feature which manages some extra info about users (mostly for users corresponding to real people). Now a nice user admin UI will want to present all of this info and allow editing all of it together. That is, rather than a modular approach where there are separate pages and separate forms for setting basic and extended user info, a nicer UI will have one page/form to do all of it at once. The UI being less modular is ok, because a templating system makes that managable, but if it has to POST a single form result, then we still need a handler in there somewhere that takes the result, splits it up and sends the bits off to the various internal features. That's a pain. If the front end directly could do the small sequence of POST/PUTs requiresd, like any other REST client, then we don't need that special monolithic POST handler.

from hackage-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.