Skip to content

hmmhmmhm/svelte-native

 
 

Repository files navigation

WIP proof of concept for wiring svelte 3 up to nativescript. based on the wonderful nativescript-vue.

todo in svelte-native

todo

  • Port dom from nativescript-vue and add svelte required items
  • Get basic todo app working
  • Expose navigation
  • Modals
  • wire up sveltes in,out and animate to Nativescripts native animations
  • work out an alternative for <ios> and <android> tags ( just import isIOS and isAndroid from platform and use an if statement)
  • alternative for sveltes css intensive transitions (svelte-native/transition)
  • publish on npm
  • Port grocery app
  • At least 1 emoji in readme
  • Tests 😳
  • Docs

usage

Until this is package is up on npm, you can install it via:

$ npm run build
$ cd dist && npm link

you can now use npm link svelte-native in your projects to install this package

App.html

<page xmlns="tns">
    <actionBar title="Svelte Native"></actionBar>
    <stackLayout>
        <label text={msg}></label>
        <button text="Change" on:tap="{toggle}"></button>
    </stackLayout>
</page>

<script>
  export let msg = 'Hello World!'
  let ab;
  const toggle = () => {
      msg = "Hi from svelte"
  }
</script>

Main.ts

import App from './components/App.html';

import { svelteNative } from 'svelte-native'

svelteNative(App, {msg: "Hi from launcher"});

see https://github.com/halfnelson/svelte-native-test-app for an example project

About

Svelte controlling native components via Nativescript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 33.6%
  • TypeScript 33.0%
  • HTML 28.6%
  • CSS 4.7%
  • Other 0.1%