Giter Club home page Giter Club logo

Comments (2)

acstll avatar acstll commented on June 1, 2024

Hey there @thurt

how that could be implemented on the client side WITHOUT javascript?

if you're mainly talking about a form, the answer is easy: natively, the way you did before client-side apps existed :)

The steps you describe seem right to me, I would go with "each actionable element is a kind of form submission which submits to the server", but removing the "kind of" bit since it should be indeed a simple form submission.

The way I do this (even when doing plain websites) is this (in same order):

  • write server side logic that should handle form submission
  • write the markup for the form (<form action="/some/path" method="post">...)
  • make it work enterily without JS, first
  • implement your client-side JS code on top of that same markup, overriding "native" behaviour
  • reuse server side logic

I hope this is useful to you.

from snabbdom-to-html.

thurt avatar thurt commented on June 1, 2024

Thank you @acstll. This is a very interesting train of thought. I will
experiment more on this when I have time.

I wonder about making a generic transformer function. In other words, a
person does not have to pre-write the form (i think you are suggesting
this). They just need to pass their vtree as a parameter, and the server
endpoint as a parameter, and they get in return a html string to send to a
js-disabled client.

The generic transformer would have to traverse vtree and replace "on"
methods with appropriate form elements.

What do you think? Its an idea anyway
Le 28 mars 2016 13:31, "Arturo Castillo Delgado" [email protected]
a écrit :

Hey there @thurt https://github.com/thurt

how that could be implemented on the client side WITHOUT javascript?

if you're mainly talking about a form, the answer is easy: natively, the
way you did before client-side apps existed :)

The steps you describe seem right to me, I would go with "each actionable
element is a kind of form submission which submits to the server", but
removing the "kind of" bit since it should be indeed a simple form
submission.

The way I do this (even when doing plain websites) is this (in same
order):

  • write server side logic that should handle form submission
  • write the markup for the form (...)
  • make it work enterily without JS, first
  • implement your client-side JS code on top of that same markup,
    overriding "native" behaviour
  • reuse server side logic

I hope this is useful to you.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/acstll/snabbdom-to-html/issues/12#issuecomment-202498701

from snabbdom-to-html.

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.