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
  • Starcounter app shell
  • Obtaining and invoking the app shell
  • Altering the app shell
  1. Guides
  2. Blendable Web Apps

App Shell

PreviousHTML ViewsNextWeb Components

Last updated 7 years ago

Introduction

A view exposed from your app should follow the principle. It needs to import the dependencies and be able to render itself. It must not assume how and where it is inserted in the main document and must not expect the presence of any APIs other than <starcounter-include> and .

The view is inserted in the main document by another view or, if it is at the root of the view-model, by the Starcounter app shell.

"App shell" is a term coined by Google that is explained well at their web page .

Starcounter app shell

The Starcounter app shell is a minimalist, configurable HTML document that imports the prerequisites for all blendable web apps:

  • a polyfill for the browsers that do not have a native implementation of the Web Components specs

  • Palindrom JS library for communication with the server

  • the <starcounter-include> custom element

  • Bootstrap, a CSS framework

On page load, the app shell establishes the Palindrom session with the server, obtains the JSON view-model tree, inserts the root view using <starcounter-include> and connects the root view to the view-model.

Obtaining and invoking the app shell

The default content of the app shell is tied to the StarcounterClientFiles version that is bundled with your Starcounter installation. The current version can be previewed in the . You can upgrade or downgrade the app shell by installing another version of StarcounterClientFiles from the App Warehouse.

The app shell is invoked automatically for any Json with a Html property that is returned from your app. The only provision is that your app needs to register the following middleware:

Application.Current.Use(new HtmlFromJsonProvider());
Application.Current.Use(new PartialToStandaloneHtmlProvider());

Altering the app shell

It is strongly advised to use the default, unmodified app shell. The default app shell is the lowest common denominator for all apps. If you change it, you might introduce side effects that make your app incompatible with other vendor's apps.

The page explains the APIs presented above. In short, the HtmlFromJsonProvider middleware fetches the view associated with a view-model, and PartialToStandaloneHtmlProvider wraps the view in the app shell.

If you need to modify the app shell, follow the instructions on the page.

inversion of control
DOM
The App Shell Model
StarcounterClientFiles repository on GitHub
middleware
middleware