Taro officially unveiled version 1.0 on September 16 at the Nugget Mini Program Conference.

As a multi-end unified development framework, Taro 1.0 brings many exciting features to help developers develop multi-end applications more easily and quickly.

The pace of progress did not stop, lasted more than a month, Taro 1.1 version officially arrived!

With more than 500 commits and 23 releases from 1.0 to 1.1, Taro has continued to iterate at a high rate in order to polish it and inject more features to benefit more developers.

Taro 1.1 is officially coming

Richer platform transformation support

Since the birth of micro channel small program, the advantages of small program for all to see, the major Internet manufacturers began to prepare their hands, one after another, the layout of small program field, the most powerful momentum is baidu intelligent small program and alipay small program. On the front end, there are opportunities, because the more platforms there are, the more opportunities there are. It’s also a challenge, because different platforms are always different, and maintaining a copy of code for each platform is obviously too expensive.

In order to reduce the development cost of multiple applications, Taro has added support for Baidu smart mini programs and Alipay mini programs in version 1.1, on the basis of fully supporting wechat mini programs.

Support Baidu intelligent small program

After upgrading to version 1.1, you can get the ability to convert existing projects into Baidu smart mini programs.

Use the following commands to compile, preview and package baidu intelligent small program side:

# npm script
$ npm run dev:swan
$ npm run build:swan
# Global installation only
$ taro build --type swan --watch
$ taro build --type swan
# NPX users can also use it
$ npx taro build --type swan --watch
$ npx taro build --type swan
Copy the code

To select baidu smart mini program mode, you need to download and open Baidu developer tool, and then select dist directory under the root directory of the project to preview after the project is compiled.

At present, the first Baidu smart mini program “JINGdong Haowu Street” developed by Taro has been officially launched. You can use baidu APP to scan the following TWO-DIMENSIONAL code for experience:

Support alipay small program

Alipay small program conversion and Baidu smart small program consistent.

You can use the following command for alipay small program side compilation preview and packaging:

# npm script
$ npm run dev:alipay
$ npm run build:alipay
# Global installation only
$ taro build --type alipay --watch
$ taro build --type alipay
# NPX users can also use it
$ npx taro build --type alipay --watch
$ npx taro build --type alipay
Copy the code

To select the Alipay applet mode, you need to download and open the Alipay applet developer tool, and then select the dist directory under the project root directory to preview after the project is compiled.

Added platform identification

After the addition of Baidu Smart Mini program and Alipay Mini Program support, Taro has provided support for five platforms, namely wechat/Baidu/Alipay /React Native/H5. In order to facilitate developers to write platform differentiation code, Taro provides platform logo for each platform. It can be obtained by process.env.taro_env, and the values are as follows

  • weapp, stands for wechat applet
  • h5On behalf of H5
  • rn, stands for React Native
  • swan, stands for Baidu intelligent mini program,New in version 1.1
  • alipay, stands for Alipay mini program,New in version 1.1

Open multiend UI library packaging capability

In version 1.0, the build command for Taro added the — UI parameter to package code organized according to certain rules into multi-end UI libraries that can be used in Taro. And, based on this function, Taro introduced the first multi-end UI library Taro UI that can be used across multiple ends.

In order to improve the Ecology of Taro and expand the Community of Taro, version 1.1 has opened up the packaging capability of multi-end UI libraries and provided detailed development guidelines.

Taro also provides the official Multiend UI Library example, which is a fully standardized UI library development example, including the necessary project modifications and test suites, based on which developers can quickly develop a multiend UI library project.

There is a lot more

In the 1.0 version, Taro provides support for wechat small program, H5 and React Native, while in the 1.1 version, on the basis of the original support, each platform is constantly improved to make it more rich and complete.

Wechat small program

  • Fcallthis.setStateJSON Diff algorithm Bug fix
  • Frepairthis.setStateIn the callbackthis.setStateThe Bug
  • AnewcomponentWillPreloadLife cycle for data preloading
  • ASupports assignment to JSX in the same scope
  • FFixed an issue with nested inclusion criteria in multi-layer Map loops
  • FFix for Chinese characters being compiled into Unicode code
  • FTernary expression parsing problem fixed
  • AImproves string template performance

H5

  • AH5 supports subcontracting configuration
  • FFixed H5 background page still executing life cycle issue
  • FFixed an issue where PUT, DELETE, etc cannot send the body when requesting the body as an object
  • AincreasesetTabBarStyle 与 setTabBarItem API
  • AincreasearrayBufferToBase64 与 base64ToArrayBuffer API
  • ACompile packaging supports extracting public NPM packages into lib libraries

React Native

  • ASupport the TypeScript
  • FFixed less compiler error after project initialization
  • AAdd the config. Window. NavigationStyle configuration
  • AaddshowNavigationBarLoading 与 hideNavigationBarLoading API
  • AincreasearrayBufferToBase64 与 base64ToArrayBuffer API
  • FFix style support warning
  • AIn Watch mode, code is compiled on demand
  • FFixed multiple JS file style references in the same folder
  • FApp. json’s expo configuration has been changed to overwrite
  • AsupportTaro.pxTransform
  • FError for duplicate references to iconPath and selectedPath for the same path
  • AAdd the EXPO configuration for Rn in config
  • ADeviceRatio can be customized

See CHANGELOG for a more complete record of functionality iterations

The future planning

Taro will continue to iterate efficiently to meet the growing demand for multi-end development

The current confirmed development plan can be seen in the Taro Release Development Plan.

Small program Taro code to open the beta

It’s worth noting that the exciting little program switch Taro code feature has been developed and entered the private beta phase. You can install the Canary version to experience it by using the following command

$ npm i -g @tarojs/cli@canary
Copy the code

Welcome to provide valuable comments on this function, please click πŸ‘ˆπŸ‘ˆπŸ‘ˆ

At the same time, in order to help Taro grow better and give back to all developers, you are welcome to provide excellent ideas or directly contribute code to Taro.