Skip to content

Commit

Permalink
Merge branch '58/harmony-hybrid-3.6.29' into f-fix-exit-kxj
Browse files Browse the repository at this point in the history
  • Loading branch information
kongxiaojun authored Jul 10, 2024
2 parents 7e6d42e + 1c05d86 commit fecd648
Show file tree
Hide file tree
Showing 105 changed files with 470 additions and 720 deletions.
2 changes: 1 addition & 1 deletion crates/native_binding/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/binding",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"description": "Node binding for taro",
"main": "binding.js",
"typings": "binding.d.ts",
Expand Down
7 changes: 6 additions & 1 deletion examples/mini-program-example/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ const config = {
}
},
framework: 'react',
compiler: 'webpack5',
compiler: {
type: 'webpack5',
prebundle: {
enable: false
}
},
cache: {
enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
},
Expand Down
5 changes: 4 additions & 1 deletion examples/mini-program-example/src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export default defineAppConfig({
'pages/api/thirdParty/index',
'pages/api/worker/index',
'pages/api/wxml/index',
'pages/performance/index/index'
'pages/performance/index/index',
'pages/harmony-hybrid/mix-router/home/index',
'pages/harmony-hybrid/mix-router/list/index',
'pages/harmony-hybrid/mix-router/detail/index'
],
tabBar: {
color: '#7A7E83',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export default class Index extends React.Component {
password: 'lwh123456',
},
func: (apiIndex, data) => {
TestConsole.consoleTest('connectWifi')
Taro.connectWifi({
...data,
success: (res) => {
Expand Down
12 changes: 6 additions & 6 deletions examples/mini-program-example/src/pages/api/wxml/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class IntersectionObserverTest extends React.Component {
this.observer = undefined
}
this.observer = this.createIntersectionObserver(data)
TestConsole.consoleResult.call(this, this.observer, apiIndex)
TestConsole.consoleResult.call(this, "createIntersectionObserver:ok", apiIndex)
},
},
{
Expand All @@ -282,8 +282,8 @@ class IntersectionObserverTest extends React.Component {
this.observer.disconnect()
}
this.observer = this.createIntersectionObserver()
this.observer.relativeTo('.scroll-view', data).observe('.ball', (res) => {
TestConsole.consoleOnCallback.call(this, res, 'IntersectionObserver.observe', apiIndex)
this.observer.relativeTo('#IntersectionObserver', data).observe('.ball', (res) => {
TestConsole.consoleOnCallback.call(this, res, 'IntersectionObserver.relativeTo', apiIndex)
this.setState({
appear: res.intersectionRatio > 0,
})
Expand All @@ -296,13 +296,13 @@ class IntersectionObserverTest extends React.Component {
left: 0,
},
func: (apiIndex, data) => {
TestConsole.consoleTest('IntersectionObserver.relativeTo')
TestConsole.consoleTest('IntersectionObserver.relativeToViewport')
if (this.observer) {
this.observer.disconnect()
}
this.observer = this.createIntersectionObserver()
this.observer.relativeToViewport(data).observe('.ball', (res) => {
TestConsole.consoleOnCallback.call(this, res, 'IntersectionObserver.observe', apiIndex)
TestConsole.consoleOnCallback.call(this, res, 'IntersectionObserver.relativeToViewport', apiIndex)
this.setState({
appear: res.intersectionRatio > 0,
})
Expand Down Expand Up @@ -338,7 +338,7 @@ class IntersectionObserverTest extends React.Component {
return (
<View>
<View style={{ fontSize: '30px', textAlign: 'center' }}>IntersectionObserver测试</View>
<ScrollView className='scroll-view' scrollY>
<ScrollView id='IntersectionObserver' className='scroll-view' scrollY>
<View className='scroll-area' style={{ background: appear ? '#0f0' : '' }}>
<Text className='notice'>先创建IntersectionObserver再滚动</Text>
<View className='filling'></View>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
navigationBarTitleText: '混合路由:小程序首页',
enablePullDownRefresh: false,
backgroundTextStyle: 'dark',
onReachBottomDistance: 50,
pageOrientation: 'auto',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import "@/styles/variables.scss";

.container {
width: 100%;
height: 100%;
background-color: #E6FFCC;
}

.title {
font-size: 40px;
margin-top: 20px;
margin-bottom: 20px;
width: 100%;
text-align: center;
display: block;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react'
import { View, Button, Text } from '@tarojs/components'
import './index.scss'
import Taro from "@tarojs/taro";
export default class Index extends React.Component {
state = {
// syncSingleResult: '',
// requestSingleResult: '',
// requestConcurrentResult: '',
// requestHignConcurrentResult: '',
// syncResult: '',
// requestByJsResult: ''
}

render() {
// const { syncSingleResult } = this.state
return (
<View className='container'>
<Text className='title'>
混合路由测试场景:小程序详情页
</Text>
<Button
onClick={()=>{
Taro.navigateBack()
}}>
小程序端:返回
</Button>
</View>
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
navigationBarTitleText: '混合路由:小程序首页',
enablePullDownRefresh: false,
backgroundTextStyle: 'dark',
onReachBottomDistance: 50,
pageOrientation: 'auto',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import "@/styles/variables.scss";

.container {
width: 100%;
height: 100%;
background-color: #FFCCCC;
}

.title {
font-size: 40px;
margin-top: 20px;
margin-bottom: 20px;
width: 100%;
text-align: center;
display: block;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react'
import { View, Button, Text } from '@tarojs/components'
import './index.scss'
import Taro from "@tarojs/taro";
import nativeApi from "@/util/nativeApi";
export default class Index extends React.Component {
state = {
// syncSingleResult: '',
// requestSingleResult: '',
// requestConcurrentResult: '',
// requestHignConcurrentResult: '',
// syncResult: '',
// requestByJsResult: ''
}

render() {
// const { syncSingleResult } = this.state
return (
<View className='container'>
<Text className='title'>
混合路由测试场景:小程序首页
</Text>
<Button
onClick={()=>{
Taro.navigateTo({
url: 'pages/harmony-hybrid/mix-router/list/index'
})
}}>
跳转:小程序列表页
</Button>
<Button
onClick={()=>{
nativeApi.navigateToNative({
url: 'pages/NativeList'
})
}}>
跳转:原生列表页
</Button>
</View>
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default {
navigationBarTitleText: '混合路由:小程序列表页',
enablePullDownRefresh: false,
backgroundTextStyle: 'dark',
onReachBottomDistance: 50,
pageOrientation: 'auto',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import "@/styles/variables.scss";

.title {
font-size: 40px;
margin-top: 20px;
margin-bottom: 20px;
width: 100%;
text-align: center;
display: block;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react'
import { View, Button, Text } from '@tarojs/components'
import './index.scss'
import Taro from "@tarojs/taro";
export default class Index extends React.Component {
state = {
// syncSingleResult: '',
// requestSingleResult: '',
// requestConcurrentResult: '',
// requestHignConcurrentResult: '',
// syncResult: '',
// requestByJsResult: ''
}

render() {
// const { syncSingleResult } = this.state
return (
<View className='harmony-hybrid-page'>
<Text className='title'>
混合路由测试场景:小程序列表页
</Text>
<Button
onClick={()=>{
Taro.navigateTo({
url: 'pages/harmony-hybrid/mix-router/detail/index'
})
}}>
跳转:小程序详情页
</Button>
</View>
)
}
}
9 changes: 4 additions & 5 deletions examples/mini-program-example/src/pages/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ export default function Index() {
</Button>
<Button
onClick={()=>{
nativeApi.harmonyNavigateTo({
indexHtmlPath: '/spa/new/index.html',
taroPath: 'pages/performance/index/index'
Taro.navigateTo({
url: 'pages/harmony-hybrid/mix-router/home/index'
})
}}>
多实例(多SPA跳转):性能列表页
多实例及混合路由测试页
</Button>
<Button
onClick={()=>{
nativeApi.harmonyNavigateTo({
nativeApi.navigateToTaroHybrid({
indexHtmlPath: '/spa/new/index.html',
taroPath: 'pages/api/index/index'
})
Expand Down
13 changes: 7 additions & 6 deletions examples/mini-program-example/src/util/nativeApi.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// @ts-ignore
const decorator = window.MethodChannel && window.MethodChannel.jsBridgeMode({ isAsync: false, autoRelease: true }) || (target => target)
const sync = window.MethodChannel && window.MethodChannel.jsBridgeMode({ isAsync: false, autoRelease: true }) || (target => target)

// @proxyClassSign('')
class NativeApi {
// @ts-ignore
@decorator
harmonyNavigateTo(options: any) {
return options
}
@sync
navigateToTaroHybrid(_options: any) {}


@sync
navigateToNative(_options: any){}
}

const nativeApi = new NativeApi()
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-darwin-arm64",
"description": "Native binding for taro",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-darwin-x64",
"description": "Native binding for taro",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-linux-x64-gnu",
"description": "Native binding for taro",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/binding-linux-x64-musl",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tarojs/binding-win32-x64-msvc",
"description": "Native binding for taro",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"os": [
"win32"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taro",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"description": "开放式跨端跨框架开发解决方案",
"homepage": "https://github.com/NervJS/taro#readme",
"author": "O2Team",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-react-jsx-to-rn-stylesheet",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"description": "Transform stylesheet selector to style in JSX Elements.",
"license": "MIT",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-taroapi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-transform-taroapi",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-taro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-preset-taro",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"description": "Taro babel preset",
"author": "yuche <[email protected]>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/babel-preset-taro#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tarojs/create-app",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"description": "create taro app with one command",
"author": "VincentW <[email protected]>",
"homepage": "https://github.com/nervjs/taro/tree/master/packages/create-app#readme",
Expand Down
2 changes: 1 addition & 1 deletion packages/css-to-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taro-css-to-react-native",
"description": "Convert CSS text to a React Native stylesheet object",
"version": "3.6.29-harmony-hybrid-alpha.31",
"version": "3.6.29-harmony-hybrid-alpha.34",
"main": "dist/index.js",
"license": "MIT",
"files": [
Expand Down
Loading

0 comments on commit fecd648

Please sign in to comment.