Code Monkey home page Code Monkey logo

webos-svelte-template's Introduction

Svelte + Vite apps for WebOS televisions

This template should help get you started developing WebOS TV apps.

This application will show the current time by having it slide in from the right, stay visible for a second or three, then fade out and close the application.

TODO: Things to write more about here:

  • versioning
  • appinfo.json
  • IPK
  • ares utilities and installing them
  • inline code (for compatibility reasons)
  • about "ui30"
    • intended useage for this example is to have it bound under a "long press button", that said, it's just a matter of removing 'window.close' in App.svelte and it will stay alive.
  • Screenshot of the app in dev and a clip of it on a live tv
  • how to deploy to tv
  • how to launch app on tv

Creating a new project

npx degit romland/webos-svelte my-webos-app
cd my-webos-app
npm install

Development

Vite will handle live recompiling, so just start in dev-mode and modify the project to your hearts content.

npm run dev

Recommended IDE Setup

VSCode + Svelte.

TypeScript

The (very little) code in App.svelte is currently plain JavaScript, but nothing is preventing you from using TypeScript should you prefer that.

Need routing or more of a complete framework?

Check out SvelteKit, which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.

Technical considerations

Why global.d.ts instead of compilerOptions.types inside jsconfig.json or tsconfig.json?

Setting compilerOptions.types shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding svelte and vite/client type information.

Why is HMR not preserving my local component state?

HMR state preservation comes with a number of gotchas! It has been disabled by default in both svelte-hmr and @sveltejs/vite-plugin-svelte due to its often surprising behavior. You can read the details here.

If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.

// store.js
// An extremely simple external store
import { writable } from 'svelte/store'
export default writable(0)

TODO

  • Slightly out of scope for this project, but I really want a proxy to all luna interfaces (as if rooted) from a remote host when developing. I have started work on it, but never finished.

webos-svelte-template's People

Contributors

romland avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.