Giter Site home page Giter Site logo

coconut.html's Introduction

Coconut HTML backend

A special coconut backend to render plain HTML, for use in static generators and server side rendering.

Usage:

coconut.html.Renderer.render('
  <div>Hello world!</div>
');

This will give you a tink.HtmlString, which you can serve, dump into a file, or process in any other way you may see fit.

Code removal

Because coconut.html can run on any platform, it removes quite a bit of code intended for client side use:

  • DOM event handlers
  • refs
  • life cycle callbacks
  • any fields annotated with @:clientside

All the removed code is not type checked, so that views which compile fine for the server may produce errors when you switch to client.

coconut.html's People

Contributors

back2dos avatar kevinresol avatar

Stargazers

Cédric Belin avatar David Klein avatar hlizard avatar francesco agati avatar Ben avatar Uldis Baurovskis avatar  avatar Dan Korostelev avatar Mark Knol avatar Jonas Nyström avatar  avatar

Watchers

francesco agati avatar grepsuzette avatar  avatar Mark Knol avatar James Cloos avatar  avatar Balázs Zubák avatar David Klein avatar

coconut.html's Issues

attribute missing in rendered result

function main() trace(coconut.html.Renderer.render('<Analytics />'));

class Analytics extends coconut.ui.View {
    function render() 
        <script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "xxxx"}'></script>
    ;
}

Traces: <script defer src="https://static.cloudflareinsights.com/beacon.min.js"></script> with the extra attribute missing. Nothing in the compiler output, apart from some deprecation warnings and Your coconut backend seems to be out of date (it's not).

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.