GithubHelp home page GithubHelp logo

tuespetre / html-mvc Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 248 KB

A 'polyfill' that activates client-side MVC for your server-rendered MVC application.

Home Page: https://htmlmvc.azurewebsites.net

HTML 1.57% JavaScript 98.43%

html-mvc's People

Contributors

tuespetre avatar

Watchers

 avatar

html-mvc's Issues

Write missing tests

multipart/json response parsing

  • Parsing the entire message
  • Splitting the body at boundaries
  • Parsing headers, quoted & unquoted
  • Value-less MIME type parameters

element interactions

  • <a>
  • <area>
  • <form> and friends

Obsolete `bindeach` in favor of `bindsome` and `bindnone`; add `bindcount`

In order to prevent developers from having to pepper their models with countless AnyItems / NoItems attributes and their code with statements to populate them, there should be a replacement solution for bindeach that, in the spirit of the existing code, gives the 'hidden' attribute special treatment:

  • bindsome, which would add the hidden attribute if the expressed value was either not a collection or was empty, and
  • bindnone, which would add the hidden attribute if the expressed value was a non-empty collection

Of course, both would cause the hidden attribute to be removed in their opposite scenarios.

In addition, there should be an isomorphic bindcount expression which functions like bindtext but uses the number of items in the expressed collection, as there will be differences in how various languages express that and once again, developers shouldn't need to waste their time populating simple integer fields any time they want to display a number.

  • bindcount
  • bindsome
  • bindnone

Titles

Currently it's using the title attribute from HTMLAnchorElement and HTMLAreaElement instances. Need to think about how this should be done with all elements including forms and their submission elements.

new URL() not supported in IE

Probably just going to hack together some regex/string splitting kind of thing in its place. At least it falls back to normal form submission ;)

Document metadata: title, application-name, application-version

  • application-name
  • application-version

Also figure out how changes in version could be effected during model negotiation

  • Using the meta tags at document load time
  • Updating the meta values from background requests
  • Applying the meta values to history entries to force reload on popstate where the entry was from a previous version

Add support for link[rel='import view']

In order to allow developers to pre-cache views, a specific type of HTML import should be supported.

Developers would want the referenced resources to be highly cacheable, and should use the server-side framework to generate the links and their hrefs.

Better documentation

Conventional overview

  • Structuring view trees
  • Content negotiation at the server
  • Declarative members for declarative bindings
  • Application versioning

Advanced

  • Dynamic view tree switching for permissions and reducing view 'weight'
  • Using bindskip for performance
  • When using HTML MVC might not be the appropriate choice

Using with other libraries

  • Using with jQuery
  • Using with Angular
  • Using with React

Adding 'modern' features as progressive enhancements

  • Filter as you type
  • Showing/hiding form elements
  • Tab panels
  • Complex layouts, dashboards

Well-defined response handling behavior

General handling for both GET and POST requests:

  • 2xx

    Scan the response for updated metadata and models and perform the document update/add the new history entry; issue a full GET request for text/html if missing required model information

  • 3xx:

    Let the browser handle the redirect and re-apply these specifications to the resulting response

  • All others:

    • If the response is of type text/html, replace the current document (probably using document.write()) and add the new history entry
    • If the response is of type multipart/json, scan the response for updated metadata and models and perform the document update/add the new history entry; issue a full GET request for text/html if missing required model information
    • Else, issue a full GET request for text/html

Specific questions to be answered

  • pushState or replaceState: is there ever a place for replaceState, especially for POST forms? Should it be an attribute-based option?

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.