Coder Social home page Coder Social logo

dashron / bifocals Goto Github PK

View Code? Open in Web Editor NEW
50.0 50.0 3.0 120 KB

A node.js View library with support for asynchronous sub-views (aka partials), and interchangeable rendering systems.

Home Page: bifocalsjs.com

License: MIT License

JavaScript 97.93% HTML 2.07%

bifocals's People

Contributors

dashron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bifocals's Issues

just an idea

What if there was a special kind of view that you could render separately, and then if it finished it would be included in the served html page, and if not, then an ajax call would be made from the client's partially rendered version to fill in the rest of the content

This is a pretty specific use case, been running through my head because I have an app that does a lot of data processing, and I don't want the user waiting 30 seconds before the page fully loads (however when there's a cache hit the response is instant).

Feel free to close this issue, this was just this easiest way for me to run the idea past you. TBH it's probably pretty simple to write some routes that make this easy.

Kill renderer object, just use a function

This should improve performance, be easier to support, allow express integration, and allow bifocals to use any existing templating functions written to be used in express

Delayed Rendering Mode

Investigate it's usability.

Idea:
Render templates immediately with placeholders for all the child views.
Root is written exactly as is, but does not call end until all children are complete.
Children are delayed, and written as script tags outside of the root template. These are then injected on the client side as soon as they are available.

is event emitter necessary?

it is left over from early implementation. I believe it is not used at the moment, would it be worth adding some events?

Express.js integration?

I see a great view system in Bifocals, supporting the sort of nesting (and so smartly!) that I see as necessary in any reasonably complex website, and a great web framework in Express.js, which is template/view-agnostic,

My question is, why can't the two play together? It seems that your handling of status codes and routing concerns puts you at odds with Express.

I read your comment on Hacker News about Express, and wonder why you feel it is necessary to bring these web server-like elements to bear on the view handling process? Is it critical to the async nature of the rendering in some way?

Just curious. This isn't criticism at all.

Thanks!

FIX TABS + SPACES!

Work uses spaces, personally I use tabs, I think my editor was confused.

Improve statusRedirect

301: permanent redirect
303: redirect away from http post
307: retry identical request at the provided uri

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.