Starcounter
HomeDownloadDocsCommunity
2.3.2
2.3.2
  • Starcounter Documentation
  • Getting Started
  • Starcounter
    • Collapsing the Stack
      • Complexity and Scalability Tradeoff
      • The Future of Micro-Services
      • 10 Benefits of Collapsing the Stack
    • Integrated Database and Web Server
  • Hello World - Tutorial
    • Create a Database Class
    • Create a Real Time UI
    • First Interactive UI
    • Computed Properties
    • Expense Tracker
    • Cancel and Delete
    • The Next Step
  • Guides
    • Database
      • Database Classes
      • Data manipulation
      • Object Identity and Object References
      • Querying with SQL
      • Data Types
      • Relations
      • Inheritance
      • Sharing data
      • Database Configuration
      • Comparing Database Objects
      • Referential Integrity and Constraints
    • SQL
      • Identifiers
      • Path Expressions
      • Data operators
      • Joins
      • Aggregates
      • Comparisons and Logical Operators
      • Sorting
      • Fetch
      • Offset Key
      • Indexes
      • Literals
      • Query Plan Hints
      • Reserved words
      • Query for Database Classes
      • SQL Isolation Between Applications
    • Transactions
      • Short-Running Transactions
      • Long running transactions
      • Using Transactions
      • Running Background Jobs
      • Commit Hooks
      • Post-commit hooks
    • Typed JSON
      • JSON-by-example
      • Code-Behind
      • Data Bindings
      • Callback Methods
      • Responding with JSON
      • Accepting JSON in Requests
      • Primitive Arrays and Single Value Types
      • Typed JSON Internals
    • Blendable Web Apps
      • Starcounter MVVM
      • Palindrom
      • Client-Side Stack
      • Sessions
      • HTML Views
      • App Shell
      • Web Components
      • View Attaching
      • View Composing
      • HTML Compositions
      • HTML Views Blending Guidelines
      • Avoiding CSS conflicts
      • Debugging
    • Network
      • HTTP
      • Internal Self Calls
      • Middleware
      • Anonymous or Substitute Handlers
      • URL Aliases and Redirects
      • Network Gateway
      • Static File Server
      • WebSocket
      • Avoiding URI conflicts
      • TCP Sockets
      • UDP Sockets
    • Publishing Apps
    • Working with Starcounter
      • Release Channels
      • Installation
      • Starting and Stopping Apps
      • Administrator Web UI
      • Star CLI
      • StarAdmin CLI
      • StarDump CLI
      • Working in Visual Studio
      • Error Log
      • Using HTTPS on NGINX
      • Using HTTPS on IIS
      • Run Starcounter in Production
      • Weaver
      • Investigating App Crashes
      • Configuration Structure
      • Database Refactoring
      • Using Unload/Reload to Modify Database Schema
      • Kernel Questions and Answers
      • Log Files
  • Cookbook
    • Attach an HTTP Request to an Existing Long-Running Transaction
    • Cookie-Based Authentication
    • Timestamp on Object Creation
    • Creating Strongly Typed JSON Collections
    • Migrating From 2.2 to 2.3+
    • Multiple Pages
    • Icons
    • Proposed Project Structure
    • Acceptance Testing with Selenium
    • Requesting a User to Authenticate
    • How to delete unused tables and columns
Powered by GitBook
On this page
  • Introduction
  • Client-Side Libraries
  • Data Sync
  • Template Engine
  • Template Loading
  • The Stack, Visualized
  • Versions
  1. Guides
  2. Blendable Web Apps

Client-Side Stack

PreviousPalindromNextSessions

Last updated 7 years ago

Introduction

Apart from data sync with Palindrom, we propose the complete stack for maximum benefit of building thin client SPAs. The other important parts are: a template engine (with two-way data binding) and a template loading infrastructure.

This stack lets you stay on the bleeding edge of development, using the new APIs such as Web Components that turn the web browser into a powerful, interactive presentation layer for apps.

All the client side libraries mentioned on this page come preinstalled with Starcounter. Starcounter auto-configures this stack for you, so don't bother reading this page unless your are interested in the internals.

The stack attempts to add as few new components as possible. The existing established patterns and web standards are used wherever possible.

Client-Side Libraries

Data Sync

Palindrom web apps use for server-client data synchronization. Palindrom makes use of the JSON and web standards. It uses the JSON, XMLHttpRequest and WebSocket APIs that are built into every modern web browser.

The implementation of JSON-Patch is provided by json-patch-duplex.js, which comes from the library and provides tools for applying and generating patches.

The implementation of operational transformation in Palindrom is provided by the following libraries: , , .

To make it easy to use, Palindrom including all the dependencies is wrapped into a helper Custom Element . Adding this Custom Element into the DOM automatically loads and configures all the dependencies.

Template Engine

Since Palindrom provides a JavaScript object that reflects the server-side view-model, it needs a template engine to present the UI in web browser DOM. JavaScript libraries, such as D3 or React, can consume this object.

To render HTML templates in the DOM we recommend the Custom Element that is part of the library. It supports binding annotations using curly braces ({{}}), conditional fragments (using ) and loops (using ).

Template Loading

To build modular apps out of many partial views, use the imported-template Custom Element. It loads the templates from separate HTML files and stamp them to the DOM, it plays well with Polymer's data-bindings and regular DOM APIs.

The Stack, Visualized

The following chart shows the bird-eye's view on the client side libraries used.

Versions

See the file ClientFiles\bower-list.txt in your Starcounter installation directory (usually C:\Program Files\Starcounter) for the list of client side libraries bundled with your Starcounter instance, including their version numbers.

Our solution is based on the Web Components APIs from the latest specs for bleeding edge HTML. It's approved by all major browser vendors and is . However, not everything is there yet, some browsers will still require the webcomponents.js polyfill to be loaded to support for these APIs.

To make it easier to use with Starcounter, importet-template is wrapped in the Custom Element, which also sets up the data binding between Palindrom and imported-template.

Palindrom
JSON-Patch
fast-json-patch
json-patch-queue
json-patch-ot-agent
json-patch-ot
palindrom-polymer-client
dom-bind
Polymer
dom-if
dom-repeat
widely adopted
starcounter-include