Convert Figma logo to code with AI

tinajs logotina

:dancer: 一款轻巧的渐进式微信小程序框架

1,328
133
1,328
24

Top Related Projects

39,886

A cross-platform framework using Vue.js

35,461

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

🦎 一套代码运行多端,一端所见即多端所见

3,581

Mpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架

20,416

基于 Vue.js 的小程序开发框架,从底层支持 Vue.js 语法和构建工具体系。

4,776

一个致力于微信小程序和 Web 端同构的解决方案

Quick Overview

Tina.js is a lightweight and progressive JavaScript framework for building WeChat Mini Programs. It aims to provide a more intuitive and efficient development experience by introducing reactive data binding, modular architecture, and a familiar component-based structure similar to Vue.js.

Pros

  • Familiar syntax and structure for developers with Vue.js experience
  • Reactive data binding for efficient updates and rendering
  • Modular architecture allowing for better code organization and reusability
  • Lightweight and optimized for WeChat Mini Program performance

Cons

  • Limited to WeChat Mini Program development, not suitable for other platforms
  • Smaller community and ecosystem compared to more established frameworks
  • Learning curve for developers not familiar with Vue.js or similar component-based frameworks
  • Potential limitations due to WeChat Mini Program restrictions

Code Examples

  1. Creating a simple component:
import { Component } from '@tinajs/tina'

Component.define({
  data: {
    message: 'Hello, Tina.js!'
  },
  methods: {
    updateMessage() {
      this.setData({ message: 'Updated message' })
    }
  }
})
  1. Using computed properties:
import { Component } from '@tinajs/tina'

Component.define({
  data: {
    firstName: 'John',
    lastName: 'Doe'
  },
  computed: {
    fullName() {
      return `${this.data.firstName} ${this.data.lastName}`
    }
  }
})
  1. Handling events:
import { Component } from '@tinajs/tina'

Component.define({
  methods: {
    handleTap(event) {
      console.log('Tapped!', event)
    }
  }
})

Getting Started

  1. Install Tina.js in your WeChat Mini Program project:
npm install --save @tinajs/tina
  1. Create a new component:
// pages/index/index.js
import { Page } from '@tinajs/tina'

Page.define({
  data: {
    title: 'Welcome to Tina.js'
  },
  onLoad() {
    console.log('Page loaded')
  }
})
  1. Use the component in your WXML file:
<!-- pages/index/index.wxml -->
<view>
  <text>{{ title }}</text>
</view>
  1. Run your WeChat Mini Program project as usual.

Competitor Comparisons

39,886

A cross-platform framework using Vue.js

Pros of uni-app

  • Broader platform support, including iOS, Android, Web, and various mini-program platforms
  • Larger community and more extensive ecosystem with plugins and components
  • More comprehensive documentation and learning resources

Cons of uni-app

  • Steeper learning curve due to its more complex architecture
  • Potentially larger bundle size for simple applications
  • May have performance overhead for certain platform-specific optimizations

Code Comparison

uni-app:

<template>
  <view>
    <text>{{ message }}</text>
  </view>
</template>

<script>
export default {
  data() {
    return {
      message: 'Hello uni-app!'
    }
  }
}
</script>

tina:

Page.define({
  data: {
    message: 'Hello tina!'
  },
  template: `
    <view>
      <text>{{ message }}</text>
    </view>
  `,
})

Both frameworks aim to simplify cross-platform development, but uni-app offers a more Vue-like syntax and structure, while tina follows a more traditional miniprogram approach. uni-app's broader platform support and larger ecosystem make it suitable for more complex, multi-platform projects. However, tina's simplicity and focus on WeChat miniprogram development may be advantageous for smaller, platform-specific applications.

35,461

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/

Pros of Taro

  • Supports multiple platforms (WeChat Mini Program, H5, React Native, etc.)
  • Larger community and more active development
  • More comprehensive documentation and examples

Cons of Taro

  • Steeper learning curve due to its multi-platform nature
  • Potentially larger bundle size for simple projects
  • May introduce unnecessary complexity for single-platform apps

Code Comparison

Tina:

Page.define({
  data: {
    message: 'Hello World'
  },
  onLoad() {
    console.log('Page loaded')
  }
})

Taro:

import Taro, { Component } from '@tarojs/taro'

class Index extends Component {
  state = {
    message: 'Hello World'
  }
  componentDidMount() {
    console.log('Page loaded')
  }
}

Summary

Taro offers a more versatile solution for cross-platform development, with broader community support and extensive documentation. However, this comes at the cost of increased complexity and potential overhead. Tina, on the other hand, provides a simpler, more lightweight approach focused specifically on WeChat Mini Programs. The choice between the two depends on project requirements, target platforms, and developer preferences.

🦎 一套代码运行多端,一端所见即多端所见

Pros of Chameleon

  • Supports multiple platforms (Web, WeChat Mini Program, Alipay Mini Program, Baidu Smart Program, etc.)
  • Provides a more comprehensive development framework with built-in UI components
  • Offers better documentation and community support

Cons of Chameleon

  • Steeper learning curve due to its more complex architecture
  • May have performance overhead due to cross-platform compatibility layers
  • Less flexible for projects that only target a single platform

Code Comparison

Tina (Component definition):

Component.define({
  data: {
    message: 'Hello, World!'
  },
  methods: {
    tap() {
      console.log('Tapped!')
    }
  }
})

Chameleon (Component definition):

class HelloWorld extends cml.Component {
  data = {
    message: 'Hello, World!'
  }
  methods = {
    tap() {
      console.log('Tapped!')
    }
  }
}

Both frameworks use a similar component-based structure, but Chameleon adopts a more modern class-based syntax. Tina's approach is closer to Vue.js, while Chameleon's syntax is more reminiscent of React components.

Chameleon's multi-platform support makes it suitable for larger projects targeting various platforms, while Tina's simplicity and focus on WeChat Mini Programs make it a good choice for smaller, platform-specific applications.

3,581

Mpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架

Pros of mpx

  • More active development and larger community support
  • Enhanced performance optimization features
  • Comprehensive documentation and examples

Cons of mpx

  • Steeper learning curve due to more complex architecture
  • Larger bundle size, which may impact load times

Code Comparison

mpx:

import { createPage } from '@mpxjs/core'

createPage({
  data: { message: 'Hello World' },
  onLoad() {
    console.log('Page loaded')
  }
})

tina:

import { Page } from '@tinajs/tina'

Page.define({
  data: { message: 'Hello World' },
  onLoad() {
    console.log('Page loaded')
  }
})

Both frameworks aim to simplify WeChat Mini Program development, but they differ in their approach and feature set. mpx offers a more robust ecosystem with advanced features, while tina focuses on simplicity and ease of use.

mpx provides better tooling support and performance optimizations, making it suitable for larger, more complex projects. However, this comes at the cost of a steeper learning curve and potentially larger bundle sizes.

tina, on the other hand, maintains a lighter footprint and simpler API, making it easier for beginners to get started. It may be more suitable for smaller projects or developers who prefer a minimalistic approach.

The code comparison shows that both frameworks have similar syntax for creating pages, with minor differences in import statements and method names.

20,416

基于 Vue.js 的小程序开发框架,从底层支持 Vue.js 语法和构建工具体系。

Pros of mpvue

  • Uses Vue.js syntax, making it familiar for Vue developers
  • Supports multiple platforms, including WeChat Mini Program and H5
  • Has a larger community and more extensive documentation

Cons of mpvue

  • Heavier framework with a larger learning curve
  • May have performance issues with complex applications
  • Less focused on WeChat Mini Program specific features

Code Comparison

mpvue:

<template>
  <div>{{ message }}</div>
</template>
<script>
export default {
  data() {
    return { message: 'Hello, mpvue!' }
  }
}
</script>

tina:

Page.define({
  data: {
    message: 'Hello, tina!'
  },
  template: `<view>{{ message }}</view>`
})

Summary

mpvue is a more comprehensive framework based on Vue.js, offering multi-platform support and a familiar syntax for Vue developers. It has a larger community but may be overkill for simpler projects. tina, on the other hand, is lightweight and specifically designed for WeChat Mini Programs, making it easier to learn and potentially more performant for smaller applications. The choice between the two depends on the project's complexity, the developer's familiarity with Vue.js, and the need for cross-platform support.

4,776

一个致力于微信小程序和 Web 端同构的解决方案

Pros of kbone

  • Supports cross-platform development for web, WeChat Mini Programs, and other mini program platforms
  • Offers a more comprehensive solution for building complex applications
  • Backed by Tencent, potentially providing better long-term support and updates

Cons of kbone

  • Steeper learning curve due to its more complex architecture
  • May be overkill for simpler projects or those focused solely on WeChat Mini Programs
  • Requires additional configuration and setup compared to Tina

Code Comparison

Tina:

import { Page } from '@tinajs/tina'

Page.define({
  data: {
    message: 'Hello, World!'
  },
  onLoad() {
    console.log('Page loaded')
  }
})

kbone:

import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'

ReactDOM.render(<App />, document.getElementById('app'))

Summary

Tina is a lightweight framework specifically designed for WeChat Mini Programs, offering simplicity and ease of use. kbone, on the other hand, provides a more robust solution for cross-platform development, including web and various mini program platforms. While kbone offers greater flexibility and broader application, it comes with increased complexity and setup requirements. The choice between the two depends on project requirements, target platforms, and development team expertise.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Tina.js

一款轻巧的渐进式微信小程序框架

npm license PRs Welcome Chat

特性

  • :honeybee: 轻盈小巧

    核心框架打包后仅 。

  • :raising_hand: 极易上手

    保留 MINA (微信小程序官方框架) 的大部分 API 设计;无论你有无小程序开发经验,都可以轻松过渡上手。

  • :chart_with_upwards_trend: 渐进增强

    我们已经为你准备好了 状态管理器 (比如 Redux)、Immutable.js、路由增强 等扩展,当然你也可以 自己编写一个新的插件。

NPM 与单文件组件

结合我们为你准备的 mina-webpack,还能够为你的小程序项目带来:

  • :oden: Mina 单文件组件 / 页面
  • :package: NPM(没错!除了一般的包,你还可以分享或下载独立的 Mina 组件)
  • :crystal_ball: 以及 Webpack 附带的其他能力,如 Babel、PostCSS、代码压缩等功能。

一个简单的例子

浏览更多示例

浏览更多使用 Tina.js 的示例 :beginner:

文档

如果你已经熟悉传统的小程序开发,那么上手 tina 将会非常简单。

接下来,请前往 :book: tina.js.org 查阅更详尽的指南。

Showcase

小程序码项目
wxcodeHacker News 热点 :fire:
https://github.com/tinajs/tina-hackernews
wxcode快资讯
@lizheming
wxcode即刻App
@ruguoapp
wxcode选个电影
@leadream
wxcode小鹿选房
fanggeek.com
wxcode魔性壁纸 😀
neobaran.com
wxcode和教育语智通 教师版
wxcode库音 COOLVOX
coolvox.com
wxcodeCHA蛋
chaotag.com

你也已经在使用 Tina.js 了吗?请在这里告诉我们 :muscle:。

License

FOSSA Status

Apache-2.0 © yelo, 2017 - present

NPM DownloadsLast 30 Days