Comments (2)
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.
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)
- How to insert HTML generated by other libraries HOT 2
- Failing to work with style properties? HOT 12
- Next major release HOT 5
- browserify browser-split error HOT 7
- 3.0 final release HOT 11
- Update class module to keep current values in `className` attribute
- Add badges…
- Switching to Typescript HOT 7
- Support for outputting prettified HTML HOT 2
- [Feature] Support ReadableStream output HOT 1
- Ability to render html with event handlers HOT 1
- Type definition errors HOT 2
- HTML tags should be encoded HOT 6
- Add unexpected tagName `div` when there is not `div` selector in vnode HOT 5
- <svg><defs><linearGradient><stop /><linearGradient/></defs></svg> has bug
- run error!
- passing "truthy" values for classes should add them to the output
- Current `browser` key in package.json won't allow requiring submodules
- Request: handle props:innerHTML HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snabbdom-to-html.