Skip to content

Commit

Permalink
Merge branch 'main' into fix/pagemeta
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKonka committed Mar 15, 2024
2 parents 63c4952 + a744277 commit b19f279
Show file tree
Hide file tree
Showing 72 changed files with 8,508 additions and 11,332 deletions.
6 changes: 6 additions & 0 deletions examples/build-weapp-plugin/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const config = {
framework: 'react',
defineConstants: {
},
compiler: {
type: 'webpack5',
prebundle: {
enable: false
}
},
mini: {
postcss: {
autoprefixer: {
Expand Down
31 changes: 15 additions & 16 deletions examples/build-weapp-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,25 @@
],
"dependencies": {
"@babel/runtime": "^7.7.7",
"@tarojs/components": "3.5.6",
"@tarojs/plugin-framework-react": "3.5.6",
"@tarojs/react": "3.5.6",
"@tarojs/runtime": "3.5.6",
"@tarojs/taro": "3.5.6",
"react": "^17.0.0",
"react-dom": "^17.0.0"
"@tarojs/components": "3.6.24",
"@tarojs/plugin-framework-react": "3.6.24",
"@tarojs/react": "3.6.24",
"@tarojs/runtime": "3.6.24",
"@tarojs/taro": "3.6.24",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@tarojs/cli": "3.5.6",
"@tarojs/mini-runner": "3.5.6",
"@tarojs/webpack-runner": "3.5.6",
"@types/react": "^17.0.2",
"@tarojs/cli": "3.6.24",
"@tarojs/webpack5-runner": "3.6.24",
"@types/react": "^18.0.0",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
"babel-preset-taro": "3.5.6",
"eslint": "^6.8.0",
"eslint-config-taro": "3.5.6",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"babel-preset-taro": "3.6.24",
"eslint": "^8.12.0",
"eslint-config-taro": "3.6.24",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-react-hooks": "^4.2.0",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion examples/build-weapp-plugin/src/plugin/pages/list/list.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { Component } from 'react'
import Taro from '@tarojs/taro'
import { View, Button } from '@tarojs/components'
import { View, Button, Image } from '@tarojs/components'
import ListItem from '../../components/listItem/listItem'
import Dog from './dog.jpg'
import './list.scss'

declare const requireMiniProgram: () => { whoami: string }
Expand Down Expand Up @@ -52,6 +53,8 @@ export default class Index extends Component<any, any> {

<Button onClick={this.getElement}>测试元素获取</Button>

<Image src={Dog} />

<mp-comp></mp-comp>
</View>
)
Expand Down
8,633 changes: 3,592 additions & 5,041 deletions examples/build-weapp-plugin/yarn.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/taro-list/config/dev.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { UserConfigExport } from "@tarojs/cli";

export default {
logger: {
quiet: false,
Expand Down
1 change: 1 addition & 0 deletions examples/taro-list/config/prod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { UserConfigExport } from "@tarojs/cli";

export default {
mini: {},
h5: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Events } from './emmiter'
import { Events } from './event-emitter'

interface ExeListItem {
eventName: string
Expand Down Expand Up @@ -41,7 +41,7 @@ const pageChannel: PageEvt = new PageEvts()

class RouteEvts extends Events {
emit (events, data) {
pageChannel.off(events, null, null)
pageChannel.off(events)
pageChannel.exeList.push({
eventName: events,
data
Expand All @@ -51,15 +51,12 @@ class RouteEvts extends Events {
addEvents (events) {
if (!events || typeof events !== 'object') return
Object.keys(events).forEach(key => {
this.off(key, null, null)
this.off(key)
this.on(key, events[key], this)
})
}
}

const routeChannel: RouteEvt = new RouteEvts()

export default {
routeChannel,
pageChannel
}
export const EventChannel = { pageChannel, routeChannel }
1 change: 1 addition & 0 deletions packages/shared/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './components'
export * from './constants'
export * from './event-channel'
export * from './event-emitter'
export * from './is'
export * from './native-apis'
Expand Down
14 changes: 12 additions & 2 deletions packages/taro-cli/src/presets/platforms/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { fs } from '@tarojs/helper'
import { getPlatformType } from '@tarojs/shared'
import * as path from 'path'

import type { IPluginContext } from '@tarojs/service'

Expand Down Expand Up @@ -35,7 +37,7 @@ export default (ctx: IPluginContext) => {
...config,
isBuildPlugin: true,
isWatch,
outputRoot: `${config.outputRoot}`,
outputRoot: `${config.outputRoot}/plugin`,
platform
},
options: Object.assign({}, options, {
Expand Down Expand Up @@ -63,7 +65,15 @@ export default (ctx: IPluginContext) => {
})
}

buildPlugin(plugin)
await buildPlugin(plugin)

try {
const docSrcPath = path.join(process.cwd(), 'src/plugin/doc')
const docDestPath = path.join(process.cwd(), 'miniprogram/doc')
fs.copy(docSrcPath, docDestPath)
} catch (err) {
console.error('[@tarojs/cli] build plugin doc failed: ', err)
}
}
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export class MovableView {
* 超过可移动区域后,是否还可以移动
*/
@Prop() outOfBounds: boolean = false
/**
* 是否带有惯性
/**
* 是否带有惯性
*/
@Prop() inertia: boolean = false
/**
Expand Down Expand Up @@ -404,7 +404,10 @@ export class MovableView {
if (this.disabled || !this.element || this.scaling || !this.touching || touches.length > 1) {
return
}
e.preventDefault()

if (this.direction !== "horizontal") {
e.preventDefault()
}

const touch = touches[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body {
}

:root {
--taro-tabbar-height: $weuiTabBarHeight;
--taro-tabbar-height: #{$weuiTabBarHeight};
}

#app {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.weui-tabbar {
display: flex;
align-items: center;
position: absolute; // relative;
z-index: 500;
bottom: 0;
Expand Down
Loading

0 comments on commit b19f279

Please sign in to comment.