Coder Social home page Coder Social logo

unicorn's Introduction

Unicorn

This is my attempt at designing and developing a full-stack web framework. Unicorn is an embodiment of what I think a good web framework should be.

I believe that a good web framework should have a fast build-time during development, is close to vanilla languages as possible, and makes sense to read.

Motives

Below is notes that I have taken for what I believe is a "unicorn" web framework. It is a roadmap for what I plan to do.

Please note that this framework is currently in development and not ready for production.

Rules

  1. Don't be verbose.
  2. Everything must be modular.
  3. Be close to vanilla as possible.

Back End

Can plug in any database you want!
Routers should be built in.
Model should update live -> (mongo-oplog)

Still working on designing this...

Possibilities: autogenerated REST api? websockets?

PostCollection = new Mongo.Collection();

Post = new Model(function() {
  PostCollection.find({}, {post: 0});
});

Front End

Templates should look like HTML!
Copy and pasting bootstrap components should instantly work!
Can mix in Javascript.
Must have if, while, and for statements.
Must not be too verbose.

Meteor's templating engine is in HTML, and it has if, while, and for statements.
However, it does not allow for mixing in javascript! Doing equations or comparisons in the if statements doesn't work. You can do that using template helpers but doing so causes the code to be extremely verbose.

Jade's template isn't verbose and look extremely pretty! However, it is extremely far from vanilla HTML.

React can do everything, however if, while, and for statements are all so verbose! It would be nice to be able to use React for templating however with special syntax to use these keywords.

Underscore.js's templating seems like a great compromise due to it's ability to do inline-logic and it's closeness to vanilla HTML. Unfortunately, it seems like too large of a library. We are using Dot.JS instead with similar syntax.

Planned syntax:

<TestComponent>
  <div class="">Test</div>
</TestComponent>
<Homepage>
  <% if (thisIsTrue) { %>
    <p>Render this <%= andThisVariable %></p>
    <TestComponent />
  <% } %>
</Homepage>
Router.route('/', function() {
  Template.render('Homepage');
});

Testing

Should come with testing API. Allows for testing with any unit testing frameworks like Mocha.

unicorn's People

Watchers

James Cloos avatar Henry avatar  avatar

unicorn's Issues

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.