Coder Social home page Coder Social logo

canteen's Introduction

canteen

the little framework that could

Coverage Status CI Code Climate

(documentation coming soon)

canteen's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

canteen's Issues

Package `get_data()` Template Loader

Write a new template loader that can load templates via the package get_data API, so setup.py-style installs can be supported for Canteen-powered apps.

Support for Compiled Assets

Add declarative configuration and supporting code structure to define and understand "compiled" assets, such as LESS and CoffeeScript. This can be the supporting structure for tools that autocompile or at least recognize their existence.

This should come with a few extra things:

  • ability to export assets (source + compiled) programmatically
  • ability to plug-in new tools and asset processing routines easily
  • ability to "watch" or notice changes in files and invoke configured routines
  • (maybe) ability to compile on-the-fly, caching the generated representation
  • (maybe) support for source maps

Design a Logo

We need a simple logo for Canteen; one that gracefully encapsulates how it feels to work with and use Canteen in your toolchain. Micah is a boss at this stuff so obvs it's in his wheelhouse :)

This is dependent on picking a name, of course, which is a separate issue (#7)

Docstrings: Second Pass

Make a second pass at initial docstrings. This round should include less-critical modules:

  • util - (struct, decorators, debug, config, cli)
  • rpc - (protocol.jsonrpc and exceptions)
  • dispatch and test

Support for Jade Templates

Figure out how we can support Jade-style templates. Is it a preprocessor for Jinja2, or its own template system?

Test Interface

Build a full interface for writing tests against a Canteen-powered application. We can probably use some sweet internals in Werkzeug for HTTP-level stuff, and realtime stuff is easy enough since it only needs a simple WSGI environment.

Construction-time Configuration

Allow use of config during construction time, when it may not have loaded before elements in Canteen.

Figure out a creative way to fix this that hopefully doesn't include the use of environment variables or hard-coded imports from Canteen into a developer's app, as that gets knar with circular dependencies/code ordering problems.

Toolchain Seed

Add simple scripts (that mirror things like web and fcm) for managing a local Canteen app environment. They should be deployable from a similar mechanism to the Application Seed (#16).

Dependency Injection (DI) Engine

Design and build the initial structure for a pervasive Dependency Injection system, that frees the developer from having to use or remember structure in their code by automatically loading, optimizing, and managing stateless business logic and exposing it via touchpoints for input and output (such as the World Wide Web).

More on this later.

Template Context Guide

Write a simple guide/reference that outlines what exists in the base template context provided by Canteen.

Service Middleware

Support for arbitrary Service Middleware is important to support features like caching, authentication/authorization, audit and error handling in the Service Layer.

Good candidate for implementation via Content Filters (#12).

Docstrings: First Pass

Make a first pass at adding docstrings everywhere they should be. Don't add parameters yet, just method descriptions.

These modules are most critical:

  • core (meta, injection, api and runtime)
  • base (handler, logic, page and protocol)
  • logic (http and realtime)
  • runtime (werkzeug, wsgiref, uwsgi, gevent and tornado)

SPDY Push Integration

Even though we probably won't be on Apache long and definitely won't be using mod_spdy or AppEngine, this is likely how Nginx will eventually handle SPDY Push and it's an easy win.

Essentially, all that is required is to add HTTP headers for associated static assets, under the name "X-Associated-Content". If Canteen is running behind mod_spdy on Apache or on AppEngine, the resources will be pushed (with an optional priority value) to the client along with the HTML response proper.

This issue is basically the SPDY-relevant version of generic HTTP Link Headers (#13), and is also a good candidate for implementation via Content Filters (#12).

Acyclic Dispatch (Realtime)

Add core support for dispatching Canteen in an acyclic fashion, without requirement for a request/response cycle.

This enables future features like WebSockets.

Service Auth

Once Service Middleware (#21) is fully supported, we need to write some base auth[entication,orization] middleware that allows basic and configurable protection for service methods.

Support for Content-Security-Policy

Add builtin support for generating Content-Security-Policy headers. This should probably go in HTTP logic and be heavily configurable.

Definitely a good idea to support report-only mode too.

Support for WebSockets

Natively support at least one environment for WebSocket-style dispatch. It should be possible to invoke Services over WebSockets automatically and author handlers that use a realtime-friendly interface.

This is dependent on support for Acyclic Dispatch (#18).

Pick a Name

We need a new name for Canteen! It was originally meant to be a placeholder name, and besides, it locks us into being a joke about Flask for the rest of time. Also there is a new PHP framework called Canteen (no joke!) that also specializes in DI, so it's just not a potable name to keep.

Also it's gross

Asset `get_data()` Loader

Support loading assets via get_data() so webapps can fully be installed via setup.py. Related to #24, which is the same thing but for templates.

Support for HTTP Link Headers

Support the expression of related static assets as HTTP Link headers. According to spec, sending such a header is equivalent to specifying a <link rel=''> tag in the HTML inline.

Currently, Chrome doesn't handle this properly and it seems only newer versions of Firefox and Opera would benefit, making this a good candidate for implementation via Content Filters (#12). Support for it now would mean instant use later when support improves (as it seems it will).

Relevant specifications:
http://www.w3.org/wiki/LinkHeader
http://tools.ietf.org/html/rfc5988

Browser notes:
http://www.chromium.org/spdy/link-headers-and-server-hint/link-rel-subresource
https://developer.mozilla.org/en-US/docs/Link_prefetching_FAQ
http://css-tricks.com/using-css-without-html/
http://meyerweb.com/eric/thoughts/2009/01/22/using-http-headers-to-serve-styles/
https://support.google.com/webmasters/answer/139394?hl=en

Note about rel="canonical" (should have its own issue someday): http://googlewebmastercentral.blogspot.com/2011/06/supporting-relcanonical-http-headers.html

Application Seed

Add a simple way to "autogenerate" a small seed app in the standard Canteen style. This should make it easier to get started with a getting started app, etc.

Structured AST Transforms

Design and build a structure to rewrite and transform Python AST as it is imported. This will allow better deferred processing of interdependent modules at construction time.

More details to come

Basic Tutorials

Write a tutorial for basic Canteen stuff, like making a Page or a Service. Basically package the simple Canteen lesson given to Keenies as a browsable/readable tutorial.

Content Filters

Design and construct core functionality in Canteen to expose an extensible interface to register, conditionally enable, execute and contain arbitrary filters on content at various stages of the request/response cycle.

Specifically, these filters should be conditionally executed based on request or runtime environment, such as an HTTP request's User-Agent header, or the presence of gevent versus tornado.

More to come on interface details.

Werkzeug: Broken Reloader

The server just crashes after code changes. It just crashes.
That's only half the equation - if it restarted, things would be wonderful.

But it doesn't.

It just crashes.

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.