Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions packages/eslint-plugin-taro/CHANGELOG.md

This file was deleted.

144 changes: 0 additions & 144 deletions packages/eslint-plugin-taro/yarn.lock

This file was deleted.

2 changes: 1 addition & 1 deletion packages/shared/src/shortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const enum Shortcuts {
NodeType = 'nt',
NodeName = 'nn',

// Attrtibutes
// Attributes
Sid = 'sid',
Style = 'st',
Class = 'cl',
Expand Down
7 changes: 0 additions & 7 deletions packages/taro-components/CHANGELOG.md

This file was deleted.

10 changes: 5 additions & 5 deletions packages/taro-framework-react/src/runtime/connect-native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export function createNativePageConfig (Component, pageName: string, data: Recor
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)
// 触发onUnload生命周期
safeExecute($taroPath, ONUNLOAD)
resetCurrent()
Expand Down Expand Up @@ -345,20 +345,20 @@ export function createNativePageConfig (Component, pageName: string, data: Recor
export function createH5NativeComponentConfig (
Component,
react: typeof React,
reactdom: typeof ReactDOM,
reactDOM: typeof ReactDOM,
) {
reactMeta.R = react
h = react.createElement
ReactDOM = reactdom
ReactDOM = reactDOM
setReconciler(ReactDOM)

return Component
}

export function createNativeComponentConfig (Component, react: typeof React, reactdom, componentConfig) {
export function createNativeComponentConfig (Component, react: typeof React, reactDOM, componentConfig) {
reactMeta.R = react
h = react.createElement
ReactDOM = reactdom
ReactDOM = reactDOM
setReconciler(ReactDOM)
const { isNewBlended } = componentConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export function createNativePageConfig (
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)
// 触发onUnload生命周期
safeExecute($taroPath, ONUNLOAD)

Expand Down Expand Up @@ -446,12 +446,12 @@ export function createNativeComponentConfig (
Component,
compName: string,
react: typeof React,
reactdom,
reactDOM,
componentConfig: any = {}
) {
reactMeta.R = react
h = react.createElement
ReactDOM = reactdom
ReactDOM = reactDOM
setReconciler(ReactDOM)
const { isUseReact18 = true } = componentConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function createPageConfig (component: any, pageName?: string, pageConfig?
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)

// 触发onUnload生命周期
safeExecute($taroPath, ON_UNLOAD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export function createNativePageConfig (
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)
// 触发onUnload生命周期
safeExecute($taroPath, ONUNLOAD)

Expand Down Expand Up @@ -418,12 +418,12 @@ export function createNativePageConfig (
export function createNativeComponentConfig (
Component,
react: typeof React,
reactdom,
reactDOM,
componentConfig
) {
reactMeta.R = react
h = react.createElement
ReactDOM = reactdom
ReactDOM = reactDOM
setReconciler(ReactDOM)
const { isNewBlended, isUseReact18 } = componentConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function createPageConfig (component: any, pageName?: string, pageConfig?
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)

// 触发onUnload生命周期
safeExecute($taroPath, ON_UNLOAD)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function createPageConfig (component: any, pageName?: string, pageConfig?
[ONUNLOAD] () {
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
window.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
window.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)

// 触发onUnload生命周期
safeExecute($taroPath, ON_UNLOAD)
Expand Down
5 changes: 2 additions & 3 deletions packages/taro-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ H5 端路由系统。

## 核心 API

### createRouter(app, config, type, framework, reactdom)
### createRouter(app, config, type, framework, reactDOM)

暴露给 `@tarojs/taro-loader/h5` 调用,在应用入口文件中调用,创建一个兼容小程序路由规范的应用。

Expand All @@ -26,7 +26,6 @@ H5 端路由系统。

框架的 default import 对象。

### `reactdom`
### `reactDOM`

可选,`react-dom` 的 default import 对象。

4 changes: 2 additions & 2 deletions packages/taro-runtime/src/__tests__/location.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ describe('location', () => {
location.trigger('2', pageId)
expect(location.href).toBe('https://taro.com/?a=1')

// CONTEXT_ACTIONS.DESTORY
// CONTEXT_ACTIONS.DESTROY
location.trigger('3', pageId)
expect(cache.has(pageId)).toBe(false)
}
Expand Down Expand Up @@ -468,7 +468,7 @@ describe('location', () => {
expect(history.length).toBe(2)
expect(location.href).toBe('https://taro.com/2')

// CONTEXT_ACTIONS.DESTORY
// CONTEXT_ACTIONS.DESTROY
history.trigger('3', pageId)
expect(cache.has(pageId)).toBe(false)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-runtime/src/bom/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TaroHistory extends Events {
}
}, null)

this.on(CONTEXT_ACTIONS.DESTORY, (pageId: string) => {
this.on(CONTEXT_ACTIONS.DESTROY, (pageId: string) => {
cache.delete(pageId)
}, null)

Expand Down
2 changes: 1 addition & 1 deletion packages/taro-runtime/src/bom/location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class TaroLocation extends Events {
)

this.on(
CONTEXT_ACTIONS.DESTORY,
CONTEXT_ACTIONS.DESTROY,
(pageId: string) => {
cache.delete(pageId)
},
Expand Down
6 changes: 3 additions & 3 deletions packages/taro-runtime/src/bom/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ class TaroWindow extends Events {
_history.trigger(CONTEXT_ACTIONS.RESTORE, pageId)
}, null)

this.on(CONTEXT_ACTIONS.DESTORY, (pageId: string) => {
this.on(CONTEXT_ACTIONS.DESTROY, (pageId: string) => {
// 页面onunload,清除当前页面的上下文信息
_location.trigger(CONTEXT_ACTIONS.DESTORY, pageId)
_history.trigger(CONTEXT_ACTIONS.DESTORY, pageId)
_location.trigger(CONTEXT_ACTIONS.DESTROY, pageId)
_history.trigger(CONTEXT_ACTIONS.DESTROY, pageId)
}, null)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/taro-runtime/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ export enum CONTEXT_ACTIONS {
INIT = '0',
RESTORE = '1',
RECOVER = '2',
DESTORY = '3'
DESTROY = '3'
}
2 changes: 1 addition & 1 deletion packages/taro-runtime/src/dsl/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function createPageConfig (component: any, pageName?: string, data?: Reco
const $taroPath = this.$taroPath
// 销毁当前页面的上下文信息
if (process.env.TARO_PLATFORM !== 'web') {
taroWindowProvider.trigger(CONTEXT_ACTIONS.DESTORY, $taroPath)
taroWindowProvider.trigger(CONTEXT_ACTIONS.DESTROY, $taroPath)
}
// 触发onUnload生命周期
safeExecute($taroPath, ONUNLOAD)
Expand Down
4 changes: 2 additions & 2 deletions packages/taroize/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
setting,
updateLogFileContent,
} from './utils'
import { createWxmlVistor, parseWXML, WXS } from './wxml'
import { createWxmlVisitor, parseWXML, WXS } from './wxml'

import type { NodePath } from '@babel/traverse'

Expand Down Expand Up @@ -210,7 +210,7 @@ export function parseTemplate (path: NodePath<t.JSXElement>, dirPath: string, wx
const templateName = value.value
const className = buildTemplateName(value.value)

path.traverse(createWxmlVistor(loopIds, refIds, dirPath, [], imports))
path.traverse(createWxmlVisitor(loopIds, refIds, dirPath, [], imports))

// refIds中可能包含wxs模块,应从refIds中去除并单独以模块的形式导入
const usedWxses = new Set<WXS>()
Expand Down
Loading
Loading