Skip to content

SPA Mode for Smart TV Apps #9587

@grushetsky

Description

@grushetsky

Feature Request

The Problem

Next.js can't be used for apps running on Smart TV (e.g., on Samsung Tizen platform) or for other client-side rendered apps with dynamic data requirements.

It would be great if Next.js could be used for client-side only apps and still support dynamic routing and automatic code-splitting.

The Solution

SPA Mode

Next.js introduces a mode for building app as a single-page application (SPA). getInitialProps works just like before, but is executed on the client only.

The new option for SPA mode is added to next.config.js:

module.exports = {,
  spa: true
};

Using SPA and SSG

The open question is how to handle both SPA mode and SSG. It looks like it's still possible to do it on a per-page basis (suggested in this RFC). Although there's no clear benefit of using a hybrid app for Smart TV use case as TV apps are hosted locally on the device.

Considered Alternatives

Static export is not an option because the app has dynamic data requirements.

SSR doesn't make sense because the app is hosted locally on the TV device. It's not a technical option either because Node.js isn't available on the TV.

So, the alternative that is left is running the app without Next.js.

Additional context

This RFC mentions the support of "client-side only applications" as one of the goals.

Nuxt.js supports a dedicated mode for building SPA.

Smart TV Apps 101

Smart TV apps are web apps that are executed by TV's browser engine:

  1. The developer creates an application bundle: styles, scripts, images, index.html, certificates, TV config file, etc.
  2. The bundle is submitted for review to TV's app store.
  3. Upon successful review, the app is added to the app store and is available for download.
  4. The user downloads the app.
  5. The app is hosted by the TV and is run by the user.

Some Smart TV platforms like webOS TV support hosted web apps, others like Tizen prohibit such kind of apps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions