Showing preview only (992K chars total). Download the full file or copy to clipboard to get everything.
Repository: alibaba/rax
Branch: master
Commit: 13d80a491f18
Files: 491
Total size: 877.1 KB
Directory structure:
gitextract_m22i72ws/
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github/
│ ├── CONTRIBUTING.md
│ ├── GIT_COMMIT_SPECIFIC.md
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ ├── feature-request.md
│ │ └── question.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── setup-chrome/
│ │ └── action.yml
│ └── workflows/
│ ├── auto-publisher.yml
│ ├── bench.yml
│ └── ci.yml
├── .gitignore
├── .npmrc
├── LICENSE
├── README.md
├── SECURITY.md
├── babel.config.js
├── examples/
│ ├── README.md
│ ├── app-lifecycle/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── event-handler/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── CustomComp/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── get-element/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── abc.json
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── page-lifecycle-with-router/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ ├── About/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── use-rax-compiled-component-in-runtime-miniapp/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── abc.json
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── with-miniapp-native-custom-component/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Test/
│ │ │ ├── index.ali.jsx
│ │ │ └── index.wechat.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ ├── pages/
│ │ │ └── Home/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ └── public/
│ │ ├── AliNativeComp/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── WechatNativeComp/
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ ├── with-miniapp-native-page/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ ├── pages/
│ │ │ ├── Home/
│ │ │ │ ├── index.css
│ │ │ │ └── index.jsx
│ │ │ └── NativeHome/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── public/
│ │ └── components/
│ │ ├── comp1/
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── comp2/
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ └── with-miniapp-plugin-component/
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── README.md
│ ├── ali-miniapp-plugin/
│ │ ├── api/
│ │ │ └── data.js
│ │ ├── components/
│ │ │ └── test/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ ├── index.js
│ │ ├── pages/
│ │ │ └── index/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── plugin.json
│ ├── build.json
│ ├── mini.project.json
│ ├── package.json
│ ├── project.config.json
│ ├── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Test/
│ │ │ ├── index.ali.jsx
│ │ │ ├── index.jsx
│ │ │ └── index.wechat.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ └── wechat-miniprogram-plugin/
│ ├── api/
│ │ └── data.js
│ ├── components/
│ │ ├── hello-component.js
│ │ ├── hello-component.json
│ │ ├── hello-component.wxml
│ │ └── hello-component.wxss
│ ├── index.js
│ ├── pages/
│ │ ├── hello-page.js
│ │ ├── hello-page.json
│ │ ├── hello-page.wxml
│ │ └── hello-page.wxss
│ └── plugin.json
├── jest.config.js
├── lerna.json
├── package.json
├── packages/
│ ├── driver-dom/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── attributes.js
│ │ │ ├── css-custom-properties.js
│ │ │ ├── css-unit-operations.js
│ │ │ ├── event-listener.js
│ │ │ ├── hydrate.js
│ │ │ ├── node-operations.js
│ │ │ └── svg.js
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ └── warning.js
│ ├── driver-server/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── driver-universal/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── css-custom-properties.js
│ │ │ └── dom-rpx-transformer.js
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── miniapp.js
│ │ ├── web.js
│ │ └── weex.js
│ ├── driver-webgl/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── components/
│ │ │ ├── cameras/
│ │ │ │ └── PerspectiveCamera.js
│ │ │ ├── controls/
│ │ │ │ ├── OrbitControls.js
│ │ │ │ └── TrackballControls.js
│ │ │ ├── core/
│ │ │ │ ├── BufferGeometry.js
│ │ │ │ ├── Geometry.js
│ │ │ │ ├── Object3D.js
│ │ │ │ └── Raycaster.js
│ │ │ ├── geometries/
│ │ │ │ ├── BoxGeometry.js
│ │ │ │ ├── CylinderGeometry.js
│ │ │ │ └── SphereGeometry.js
│ │ │ ├── index.js
│ │ │ ├── lights/
│ │ │ │ ├── AmbientLight.js
│ │ │ │ └── DirectionalLight.js
│ │ │ ├── materials/
│ │ │ │ ├── LineBasicMaterial.js
│ │ │ │ ├── LineDashedMaterial.js
│ │ │ │ ├── MeshBasicMaterial.js
│ │ │ │ ├── MeshLambertMaterial.js
│ │ │ │ ├── MeshPhongMaterial.js
│ │ │ │ └── PointsMaterial.js
│ │ │ ├── objects/
│ │ │ │ ├── Line.js
│ │ │ │ ├── Mesh.js
│ │ │ │ └── Points.js
│ │ │ └── scenes/
│ │ │ └── Scene.js
│ │ ├── driver.js
│ │ ├── index.js
│ │ └── plugin/
│ │ └── controls/
│ │ ├── OrbitControls.js
│ │ └── TrackballControls.js
│ ├── driver-weex/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── index.d.ts
│ │ └── index.js
│ ├── mobx-rax/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── Provider.js
│ │ ├── index.js
│ │ ├── inject.js
│ │ ├── observer.js
│ │ ├── propTypes.js
│ │ └── utils/
│ │ ├── EventEmitter.js
│ │ └── utils.js
│ ├── rax/
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── asyncUpdate.js
│ │ │ ├── createContext.js
│ │ │ ├── createElement.js
│ │ │ ├── forwardRef.js
│ │ │ ├── fragment.js
│ │ │ ├── hooks.js
│ │ │ ├── memo.js
│ │ │ └── render.js
│ │ ├── assign.js
│ │ ├── compat/
│ │ │ └── index.js
│ │ ├── constant.js
│ │ ├── createContext.js
│ │ ├── createElement.js
│ │ ├── createRef.js
│ │ ├── debug/
│ │ │ ├── dump.js
│ │ │ └── getComponentTree.js
│ │ ├── devtools/
│ │ │ ├── index.js
│ │ │ └── reconciler.js
│ │ ├── error.js
│ │ ├── forwardRef.js
│ │ ├── fragment.js
│ │ ├── hooks.js
│ │ ├── index.js
│ │ ├── invokeFunctionsWithContext.js
│ │ ├── memo.js
│ │ ├── render.js
│ │ ├── toArray.js
│ │ ├── types.js
│ │ ├── validateChildKeys.js
│ │ ├── vdom/
│ │ │ ├── __tests__/
│ │ │ │ ├── component.js
│ │ │ │ ├── composite.js
│ │ │ │ ├── context.js
│ │ │ │ ├── empty.js
│ │ │ │ ├── fragment.js
│ │ │ │ ├── key.js
│ │ │ │ ├── native.js
│ │ │ │ ├── purecomponent.js
│ │ │ │ ├── reactive.js
│ │ │ │ ├── ref.js
│ │ │ │ ├── shallowEqual.js
│ │ │ │ └── text.js
│ │ │ ├── base.js
│ │ │ ├── component.js
│ │ │ ├── composite.js
│ │ │ ├── element.js
│ │ │ ├── empty.js
│ │ │ ├── flattenChildren.js
│ │ │ ├── fragment.js
│ │ │ ├── getElementKeyName.js
│ │ │ ├── getNearestParent.js
│ │ │ ├── getPrevSiblingNativeNode.js
│ │ │ ├── host.js
│ │ │ ├── inject.js
│ │ │ ├── injectRenderOptions.js
│ │ │ ├── instance.js
│ │ │ ├── instantiateComponent.js
│ │ │ ├── native.js
│ │ │ ├── performInSandbox.js
│ │ │ ├── reactive.js
│ │ │ ├── ref.js
│ │ │ ├── root.js
│ │ │ ├── scheduler.js
│ │ │ ├── shallowEqual.js
│ │ │ ├── shouldUpdateComponent.js
│ │ │ ├── text.js
│ │ │ └── updater.js
│ │ └── version.js
│ ├── rax-app/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── App.js
│ │ └── index.js
│ ├── rax-children/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── childern.js
│ │ └── index.js
│ ├── rax-clone-element/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── cloneElement.js
│ │ └── index.js
│ ├── rax-create-class/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── createClass.js
│ │ └── index.js
│ ├── rax-create-factory/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── createFactory.js
│ │ └── index.js
│ ├── rax-create-portal/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── createPortal.js
│ │ └── index.js
│ ├── rax-document/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-dom/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-find-dom-node/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── findDOMNode.js
│ │ │ └── findDOMNode.weex.js
│ │ └── index.js
│ ├── rax-get-element-by-id/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-hydrate/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-is-valid-element/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── isValidElement.js
│ │ └── index.js
│ ├── rax-proptypes/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── proptypes.js
│ │ └── index.js
│ ├── rax-redux/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── components/
│ │ │ ├── Context.js
│ │ │ ├── Provider.js
│ │ │ └── connectAdvanced.js
│ │ ├── connect/
│ │ │ ├── connect.js
│ │ │ ├── mapDispatchToProps.js
│ │ │ ├── mapStateToProps.js
│ │ │ ├── mergeProps.js
│ │ │ ├── selectorFactory.js
│ │ │ ├── verifySubselectors.js
│ │ │ └── wrapMapToProps.js
│ │ ├── hooks/
│ │ │ ├── useDispatch.js
│ │ │ ├── useReduxContext.js
│ │ │ ├── useSelector.js
│ │ │ └── useStore.js
│ │ ├── index.js
│ │ └── utils/
│ │ ├── Subscription.js
│ │ ├── batch.js
│ │ ├── hoistNonReactStatics.js
│ │ ├── isPlainObject.js
│ │ ├── isValidElementType.js
│ │ ├── shallowEqual.js
│ │ ├── verifyPlainObject.js
│ │ ├── warning.js
│ │ └── wrapActionCreators.js
│ ├── rax-server/
│ │ ├── README.md
│ │ ├── index.js
│ │ └── package.json
│ ├── rax-server-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── CSSProperty.js
│ │ ├── __tests__/
│ │ │ ├── attributes.js
│ │ │ ├── basic.js
│ │ │ ├── context.js
│ │ │ ├── elements.js
│ │ │ ├── form.js
│ │ │ ├── fragment.js
│ │ │ ├── hooks.js
│ │ │ ├── lifecycle.js
│ │ │ ├── memo.js
│ │ │ ├── refs.js
│ │ │ ├── renderToString.js
│ │ │ ├── styles.js
│ │ │ └── url.js
│ │ ├── attribute.js
│ │ └── index.js
│ ├── rax-set-native-props/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── flexbox.js
│ │ └── index.js
│ ├── rax-test-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── __snapshots__/
│ │ │ │ └── snapshot.js.snap
│ │ │ ├── escapeText.js
│ │ │ ├── renderer.js
│ │ │ ├── snapshot.js
│ │ │ └── styleToCSS.js
│ │ ├── escapeText.js
│ │ ├── index.js
│ │ ├── renderer.js
│ │ ├── serializer.js
│ │ └── styleToCSS.js
│ ├── rax-unmount-component-at-node/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── unmountComponentAtNode.js
│ │ └── index.js
│ └── style-unit/
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ └── src/
│ ├── __tests__/
│ │ ├── style-unit.miniApp.js
│ │ ├── style-unit.web.js
│ │ └── style-unit.weex.js
│ └── index.js
└── scripts/
├── add-owner.js
├── bench/
│ ├── .gitignore
│ ├── README.md
│ ├── chromePreferences.json
│ ├── css/
│ │ ├── bootstrap.css
│ │ ├── currentStyle.css
│ │ └── main.css
│ ├── frameworks/
│ │ ├── preact/
│ │ │ ├── .babelrc
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ ├── Main.jsx
│ │ │ │ ├── Row.jsx
│ │ │ │ └── Store.es6.js
│ │ │ └── webpack.config.js
│ │ ├── rax/
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── main.jsx
│ │ │ └── webpack.config.js
│ │ ├── rax-local/
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── main.jsx
│ │ │ └── webpack.config.js
│ │ ├── vanillajs/
│ │ │ ├── .babelrc
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── Main.js
│ │ │ └── webpack.config.js
│ │ └── vue/
│ │ ├── .babelrc
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── App.vue
│ │ │ ├── main.es6.js
│ │ │ └── store.es6.js
│ │ └── webpack.config.js
│ ├── package.json
│ └── src/
│ ├── benchmarks.js
│ ├── build.js
│ ├── common.js
│ ├── config.js
│ ├── fomart.js
│ ├── index.js
│ ├── print.js
│ ├── runner.js
│ ├── server.js
│ └── webdriverAccess.js
├── check-and-publish.js
├── compile-packages.js
├── compile.js
├── config/
│ └── getBabelConfig.js
├── dist-core.js
├── jest/
│ ├── setupEnvironment.js
│ ├── setupTests.js
│ ├── shouldIgnoreConsoleError.js
│ ├── styleMock.js
│ └── toWarnDev.js
├── mapCoverage.js
└── validate-commit-msg.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
[*.gradle]
indent_size = 4
================================================
FILE: .eslintignore
================================================
node_modules
lib
es
dist
build
coverage
expected
website
gh-pages
vendors
================================================
FILE: .eslintrc.js
================================================
module.exports = {
'extends': [
'rax'
],
'root': true,
};
================================================
FILE: .github/CONTRIBUTING.md
================================================
# Contributing Guide
Hi! I’m really excited that you are interested in contributing to Rax. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Git Commit Specific](./GIT_COMMIT_SPECIFIC.md)
## Development Workflow
After cloning rax, run `npm install` to fetch its dependencies.
Run `npm run setup` link and bootstrap project before development.
Then, you can run several commands:
* `npm run lint` checks the code style.
* `npm test` runs the complete test suite.
* `npm test -- --watch` runs an interactive test watcher.
* `npm test <pattern>` runs tests with matching filenames.
* `npm run build` creates `lib` and `dist` folder with all the packages.
## Issue Reporting Guidelines
- The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately.
- For simple beginner questions, you can get quick answers from
- For more complicated questions, you can use Google or StackOverflow. Make sure to provide enough information when asking your questions - this makes it easier for others to help you!
- Try to search for your issue, it may have already been answered or even fixed in the development branch.
- Check if the issue is reproducible with the latest stable version of Rax. If you are using a pre-release, please indicate the specific version you are using.
- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
- For bugs that involves build setups, you can create a reproduction repository with steps in the README.
- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
## Pull Request Guidelines
- Only code that's ready for release should be committed to the master branch. All development should be done in dedicated branches.
- Checkout a **new** topic branch from master branch, and merge back against master branch.
- Work in the `src` folder and **DO NOT** checkin `dist` in the commits.
- Make sure `npm test` passes.
- If adding new feature:
- Add accompanying test case.
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
- If fixing a bug:
- If you are resolving a special issue, add `(fix #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
- Provide detailed description of the bug in the PR. Live demo preferred.
- Add appropriate test coverage if applicable.
## Git Commit Specific
- Your commits message must follow our [git commit specific](./GIT_COMMIT_SPECIFIC.md).
- We will check your commit message, if it does not conform to the specification, the commit will be automatically refused, make sure you have read the specification above.
- You could use `git cz` with a CLI interface to replace `git commit` command, it will help you to build a proper commit-message, see [commitizen](https://github.com/commitizen/cz-cli).
- It's OK to have multiple small commits as you work on your branch - we will let GitHub automatically squash it before merging.
================================================
FILE: .github/GIT_COMMIT_SPECIFIC.md
================================================
# GIT COMMIT MESSAGE CHEAT SHEET
**Proposed format of the commit message**
```
<type>(<scope>): <subject>
<body>
```
All lines are wrapped at 100 characters !
**Allowed `<type>`**
- feat (A new feature)
- fix (A bug fix)
- docs (Documentation only changes)
- style (Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc))
- perf (A code change that improves performance)
- refactor (A code change that neither fixes a bug nor adds a feature)
- test (Adding missing tests or correcting existing tests)
- build (Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm))
- ci (Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs))
- chore (Other changes that don't modify src or test files)
- revert (Reverts a previous commit)
**Allowed `<scope>`**
Scope could be anything specifying place of the commit change.
For example $location, $browser, compiler, scope, ng:href, etc...
**Breaking changes**
All breaking changes have to be mentioned in message body, on separated line:
_Breaks removed $browser.setUrl() method (use $browser.url(newUrl))_
_Breaks ng: repeat option is no longer supported on selects (use ng:options)_
**Message body**
- uses the imperative, present tense: “change” not “changed” nor “changes”
- includes motivation for the change and contrasts with previous behavior
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.yml
================================================
name: "Bug Report"
description: "If something isn't working as expected."
title: "[BUG] <title>"
labels: ["Bug"]
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a bug report! ❤️ Please fill out this form to describe your issue.
- type: checkboxes
id: input1
attributes:
label: "⌨️"
options:
- label: Would you like to work on a fix?
- type: dropdown
attributes:
label: Where is the bug from?
options:
- Rax Core
- Rax App
- Rax Components
- Rax Hooks
- Uni API
- Fusion Mobile
- Others
- I don't know
validations:
required: true
- type: textarea
attributes:
label: Minimal code and steps to reproduce the bug
description: |
To help fixing the bug sooner, you should provide the minimal code and steps necessary to reproduce the bug.
Even better, you can share us a CodeSandbox link. [Create a new codesandbox](https://codesandbox.io/s/rax-quick-start-smqdc?file=/build.json&resolutionWidth=375&resolutionHeight=812).
If it's not possible to reproduce the bug with simple code, a GitHub repository link is also ok.
placeholder: |
```js
const your => (code) => here;
```
1. In this environment...
2. With this config...
3. Run '...'
4. See error...
validations:
required: true
- type: textarea
attributes:
label: Current and expected behavior
description: A clear and concise description of what it happens and what you would expect.
validations:
required: true
- type: textarea
attributes:
label: Environment
placeholder: |
- OS: [e.g. macOS 10.15.4, Windows 10, iOS]
- Rax version: [e.g. 1.2.2]
- Rax App version: [e.g. 3.8.0]
- Node: [e.g. Node 15]
- Browser: [e.g. chrome, safari]
validations:
required: true
- type: textarea
attributes:
label: build.json
description: |
If there is a build config file(e.g. build.json) in your project, paste its content here
placeholder: |
```json
{
"your": { "config": "here" }
}
```
- type: textarea
attributes:
label: Possible solution
description: "If you have any suggestion on a fix for the bug."
- type: textarea
attributes:
label: Additional context
description: "Add any other context about the problem here. Or a screenshot if applicable."
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request.md
================================================
---
name: Feature Request
about: Suggest an idea for Rax.
title: "[Feature]"
labels: feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/question.md
================================================
---
name: Question
about: Ask questions about using with Rax.
title: "[Question]"
labels: question
assignees: ''
---
Please describe the problem you meet.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
*Before* submitting a pull request, please make sure the following is done...
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests!
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes (`npm test`).
5. Make sure your code lints (`npm run lint`) - we've done our best to make sure these rules match our internal linting guidelines.
================================================
FILE: .github/actions/setup-chrome/action.yml
================================================
# https://github.com/SeleniumHQ/selenium/blob/trunk/.github/actions/setup-chrome/action.yml
name: 'Setup Chrome and chromedriver'
runs:
using: "composite"
steps:
- run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update -qqy
sudo apt-get -qqy install google-chrome-stable
CHROME_VERSION=$(google-chrome-stable --version)
CHROME_FULL_VERSION=${CHROME_VERSION%%.*}
CHROME_MAJOR_VERSION=${CHROME_FULL_VERSION//[!0-9]}
sudo rm /etc/apt/sources.list.d/google-chrome.list
export CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION%%.*}`
curl -L -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /usr/local/bin
export CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION%%.*}`
curl -L -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /usr/local/bin
chromedriver -version
shell: bash
================================================
FILE: .github/workflows/auto-publisher.yml
================================================
name: Auto Publisher
on:
push:
branches:
- master
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run setup
- run: npm run check-and-publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
REGISTRY: https://registry.npmjs.org
================================================
FILE: .github/workflows/bench.yml
================================================
name: Bench
on:
push:
branches:
- master
pull_request:
branches:
- '^bench'
jobs:
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Setup Chrome and chromedriver
uses: ./.github/actions/setup-chrome
- name: Start XVFB
run: Xvfb :99 &
- run: npm install
- run: npm run setup
- run: npm run bench
env:
DISPLAY: :99
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Set branch name
run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/}
- name: Echo branch name
run: echo ${BRANCH_NAME}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: npm run setup
- run: npm run lint
- run: npm run test
env:
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
CI: true
================================================
FILE: .gitignore
================================================
*~
*.swp
.DS_Store
npm-debug.log
lerna-debug.log
npm-debug.log*
lib/
es/
dist/
build/
coverage/
node_modules/
examples/test
.eslintcache
*.lock
================================================
FILE: .npmrc
================================================
package-lock=false
================================================
FILE: LICENSE
================================================
BSD License
Copyright (c) 2015-present, Alibaba Group Holding Limited. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
<p align="center">
<a href="https://alibaba.github.io/rax">
<img alt="Rax" src="https://user-images.githubusercontent.com/677114/59907138-e99f7180-943c-11e9-8769-07021d9fe1ca.png" width="66">
</a>
</p>
<p align="center">
Rax is a progressive framework for building universal applications.
<p align="center">
<a href="https://github.com/alibaba/rax/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/rax.svg"></a>
<a href="https://www.npmjs.com/package/rax"><img src="https://img.shields.io/npm/v/rax.svg"></a>
<a href="https://www.npmjs.com/package/rax"><img src="https://img.shields.io/npm/dm/rax.svg"></a>
<a href="https://travis-ci.org/alibaba/rax"><img src="https://travis-ci.org/alibaba/rax.svg?branch=master"></a>
<a href="https://unpkg.com/rax/dist/rax.min.js"><img src="https://img.badgesize.io/https://unpkg.com/rax/dist/rax.min.js?compression=gzip&?maxAge=3600" alt="gzip size"></a>
</p>
---
💌 **Write Once, Run Anywhere:** write one codebase, run with `Web`, [`Weex`](https://weex.apache.org/), [`Node.js`](https://nodejs.org/), `Alibaba MiniApp`, and `WeChat MiniProgram`. Rax can be used with additional containers that implement it's [driver specification](https://github.com/alibaba/rax/wiki/Driver-Specification).
⏱ **Fast:** better performance and a tiny size(📦~6KB) when compared to [React](http://reactjs.org/) using the same API.
📤 **Easy:** quick start with zero configuration, all features like `Progressive Web App (PWA)`, `Server-Side Rendering (SSR)`, and `Function as a service (FaaS)` can be used out of the box.
### Quick Start 🥢🍚
#### Start from command line
Create a new Rax project using `create-rax`:
```sh
$ npm init rax <YourProjectName>
```
_`npm init <initializer>` is available in npm 6+_
Start local server to launch project:
```sh
$ cd <YourProjectName>
$ npm install
$ npm run start
```
#### Start from [VS Code](https://code.visualstudio.com/)
You need to install the [AppWorks Pack](https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks) and invoke the `Create Application` command from the VS Code command palette (`Ctrl + Shift + P` or `Cmd + Shift + P` on Mac):

### Developer Tools 🛠
You can inspect and modify the state of your Rax components at runtime using the
[Rax Developer Tools](https://github.com/raxjs/rax-devtools) browser extension,
however the extension will not work in `production` mode.
1. Install the Chrome [Rax Developer Tools](https://chrome.google.com/webstore/detail/rax-developer-tools/anpeoinhjjligmgoiepbnigjhmijblff) extension
2. Reload and go to the 'Rax' tab in the browser's development tools
#### VS Code Extension
You can use [AppWorks Pack](https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks) to get better development experience.
### Awesome Things 📝
You can find some awesome things in [awesome-rax](https://github.com/raxjs/awesome-rax).
### Contributing 🧼
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our [guidelines for contributing](./.github/CONTRIBUTING.md).
#### Code Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/alibaba/rax/graphs/contributors"><img src="https://opencollective.com/rax/contributors.svg?width=890&button=false" /></a>
### Community support
For general help using Rax, please refer to [the official site](https://rax.js.org/). For additional help, you can use one of these channels to ask a question:
- [GitHub](https://github.com/alibaba/rax) (Bug reports, contributions)
- [Twitter](https://twitter.com/RaxNews) (Get the news fast)
- [Medium](https://medium.com/@raxjs) (Get blogs and articles)
- [知乎专栏](https://zhuanlan.zhihu.com/raxjs) (Get blogs and articles in Simplified Chinese)
================================================
FILE: SECURITY.md
================================================
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| >= 1.0.0 | :white_check_mark: |
| < 1.0.0 | :x: |
## Reporting a Vulnerability
If you have any problems, report it to rax-public@alibaba-inc.com, thank you.
================================================
FILE: babel.config.js
================================================
module.exports = function(api) {
// Cache the returned value forever and don't call this function again.
if (api) api.cache(true);
return {
'presets': [
'@babel/preset-flow',
['@babel/preset-env', {
'loose': true,
'targets': {
'esmodules': true
}
}],
['@babel/preset-react', {
'pragma': 'createElement'
}]
],
'plugins': [
'@babel/plugin-proposal-export-default-from',
[
'@babel/plugin-proposal-class-properties',
{
loose: true
}
],
'babel-plugin-transform-jsx-stylesheet',
[
'@babel/plugin-proposal-decorators',
{
decoratorsBeforeExport: true
}
],
'@babel/plugin-syntax-dynamic-import',
],
'ignore': [
'src/generator/templates',
'__mockc__',
'dist'
],
};
};
================================================
FILE: examples/README.md
================================================
# Rax 示例
本文件夹提供了多个 Rax 示例项目供用户参考。
## 快速开始
```shell
npm install
# dev mode
npm run start
# build mode
npm run build
```
## 示例说明
> 示例项目中小程序端均采用运行时方案
* with-miniapp-native-custom-component: 使用小程序原生自定义组件(本地组件 + npm 组件)
* with-miniapp-plugin-component: 使用小程序插件组件 + 分端构建
* with-miniapp-native-page: 使用原生页面
* use-rax-compiled-component-in-runtime-miniapp: Rax 小程序运行时项目使用 Rax 编译时组件
* app-lifecycle: 使用 app 生命周期
* page-lifecycle-with-router: 使用 page 生命周期 + 路由跳转
* event-handler: 事件绑定(编译时小程序)
* get-element: document/element getElementXXX 相关 API
================================================
FILE: examples/app-lifecycle/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/app-lifecycle/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/app-lifecycle/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/app-lifecycle/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp",
"wechat-miniprogram"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/app-lifecycle/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"driver-universal": "^3.0.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"rax-document": "^0.1.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/app-lifecycle/src/app.js
================================================
import { runApp, useAppLaunch, useAppShow, useAppHide, useAppShare, useAppError } from 'rax-app';
import appConfig from './app.json';
useAppLaunch((options) => {
console.log('app launch', options);
});
useAppShow((options) => {
console.log('app show', options);
});
useAppHide(() => {
console.log('app hide');
});
useAppShare(() => {
return {
title: '分享标题',
desc: '分享详细说明',
path: 'pages/Home/index'
};
});
useAppError(() => {
console.log('app error');
});
runApp(appConfig);
================================================
FILE: examples/app-lifecycle/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/app-lifecycle/src/components/Logo/index.css
================================================
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
================================================
FILE: examples/app-lifecycle/src/components/Logo/index.jsx
================================================
import { createElement } from 'rax';
import Image from 'rax-image';
import './index.css';
export default (props) => {
const { uri } = props;
const source = { uri };
return (
<Image
className="logo"
source={source}
/>
);
};
================================================
FILE: examples/app-lifecycle/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/app-lifecycle/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/app-lifecycle/src/pages/Home/index.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import './index.css';
import Logo from '../../components/Logo';
export default function Home() {
return (
<View className="home">
<Logo uri="//gw.alicdn.com/tfs/TB1MRC_cvb2gK0jSZK9XXaEgFXa-1701-1535.png" />
<Text className="title">Welcome to Your Rax App</Text>
<Text className="info">More information about Rax</Text>
<Text className="info">Visit https://rax.js.org</Text>
</View>
);
}
================================================
FILE: examples/event-handler/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/event-handler/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/event-handler/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/event-handler/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp",
"wechat-miniprogram"
],
"miniapp": {
"buildType": "compile"
},
"wechat-miniprogram": {
"buildType": "compile"
}
}
]
]
}
================================================
FILE: examples/event-handler/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"driver-universal": "^3.0.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"rax-document": "^0.1.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/event-handler/src/app.js
================================================
import { runApp } from 'rax-app';
import appConfig from './app.json';
runApp(appConfig);
================================================
FILE: examples/event-handler/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/event-handler/src/components/CustomComp/index.css
================================================
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
================================================
FILE: examples/event-handler/src/components/CustomComp/index.jsx
================================================
import { createElement } from 'rax';
import Image from 'rax-image';
import './index.css';
export default (props) => {
const { uri } = props;
const source = { uri };
return (
<Image
className="logo"
source={source}
/>
);
};
================================================
FILE: examples/event-handler/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/event-handler/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/event-handler/src/pages/Home/index.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import Image from 'rax-image';
import './index.css';
import CustomComp from '../../components/CustomComp';
export default function Home() {
function noop() {}
return (
<View className="home">
<View className="test" onClick={noop}>onClick -> onTap (alibaba miniapp) && bindtap (wechat miniprogram) in rax-view</View>
<Text className="test" onClick={noop}>onClick -> bindtap (wechat miniprogram) in rax-text</Text>
<Image onClick={noop} onChange={noop}>onClick/onChange are not transformed (alibaba miniapp) && onClick -> bindonClick/onChange -> bindonChange (wechat miniprogram)</Image>
<button className="test" style={{color: 'red'}} onClick={noop} onChange={noop}>onClick -> onTap (alibaba miniapp) && onClick -> bindtap (wechat miniprogram) && onChange -> bindchange (wechat miniprogram) </button>
<CustomComp onClick={noop} onChange={noop}>not transformed</CustomComp>
</View>
);
}
================================================
FILE: examples/get-element/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/get-element/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/get-element/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/get-element/abc.json
================================================
{
"type": "rax",
"builder": "@ali/builder-rax-v1",
"info": {
"raxVersion": "1.x"
}
}
================================================
FILE: examples/get-element/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp",
"wechat-miniprogram"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/get-element/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"driver-universal": "^3.0.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"rax-document": "^0.1.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/get-element/src/app.js
================================================
import { runApp, useAppLaunch, useAppShow, useAppHide, useAppShare, useAppError } from 'rax-app';
import appConfig from './app.json';
useAppLaunch((options) => {
console.log('app launch', options);
});
useAppShow((options) => {
console.log('app show', options);
});
useAppHide(() => {
console.log('app hide');
});
useAppShare(() => {
return {
title: '分享标题',
desc: '分享详细说明',
path: 'pages/Home/index'
};
});
useAppError(() => {
console.log('app error');
});
runApp(appConfig);
================================================
FILE: examples/get-element/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/get-element/src/components/Logo/index.css
================================================
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
================================================
FILE: examples/get-element/src/components/Logo/index.jsx
================================================
import { createElement } from 'rax';
import Image from 'rax-image';
import './index.css';
export default (props) => {
const { uri } = props;
const source = { uri };
return (
<Image
className="logo"
source={source}
/>
);
};
================================================
FILE: examples/get-element/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/get-element/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/get-element/src/pages/Home/index.jsx
================================================
import { createElement, useEffect } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import './index.css';
import Logo from '../../components/Logo';
export default function Home() {
useEffect(() => {
const father1 = document.getElementById('father');
const father2 = document.querySelector('#father');
const father3 = document.querySelectorAll('#father');
console.log('Home -> father1', father1);
console.log('Home -> father2', father2);
console.log('Home -> father3', father3);
const home1 = document.getElementsByClassName('home');
const home2 = document.querySelector('.home');
const home3 = document.querySelectorAll('.home');
console.log('Home -> home1', home1);
console.log('Home -> home2', home2);
console.log('Home -> home3', home3);
const div1 = document.getElementsByTagName('div');
const div2 = document.querySelector('div');
const div3 = document.querySelectorAll('div');
console.log('Home -> div1', div1);
console.log('Home -> div2', div2);
console.log('Home -> div3', div3);
const child = document.getElementById('child1');
const subDiv1 = child.getElementsByTagName('div');
const subDiv2 = child.querySelector('div');
const subDiv3 = child.querySelectorAll('div');
console.log('Home -> subDiv1', subDiv1);
console.log('Home -> subDiv2', subDiv2);
console.log('Home -> subDiv3', subDiv3);
const red1 = child.getElementsByClassName('red');
const red2 = child.querySelector('.red');
const red3 = child.querySelectorAll('.red');
console.log('Home -> red1', red1);
console.log('Home -> red2', red2);
console.log('Home -> red3', red3);
});
return (
<View id="father" className="home">
<div id="child1" className="son">
<div className="red"></div>
<div className="green"></div>
<div className="red"></div>
</div>
<div id="child2" className="son"></div>
<div id="child3" className="son"></div>
<div id="child4" className="son"></div>
<div id="child5" className="son"></div>
</View>
);
}
================================================
FILE: examples/page-lifecycle-with-router/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/page-lifecycle-with-router/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/page-lifecycle-with-router/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/page-lifecycle-with-router/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp",
"wechat-miniprogram"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/page-lifecycle-with-router/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"driver-universal": "^3.0.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"rax-document": "^0.1.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/page-lifecycle-with-router/src/app.js
================================================
import { runApp } from 'rax-app';
import appConfig from './app.json';
runApp(appConfig);
================================================
FILE: examples/page-lifecycle-with-router/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
},
{
"path": "/about",
"source": "pages/About/index"
}
],
"window": {
"title": "Rax App",
"pullRefresh": true
},
"tabBar": {
"textColor": "#999",
"selectedColor": "#666",
"backgroundColor": "#f8f8f8",
"items": [
{
"name": "home",
"path": "/",
"icon": "https://gw.alicdn.com/tfs/TB1ypSMTcfpK1RjSZFOXXa6nFXa-144-144.png",
"activeIcon": "https://gw.alicdn.com/tfs/TB1NBiCTgHqK1RjSZFPXXcwapXa-144-144.png"
},
{
"name": "about",
"path": "/about",
"icon": "https://gw.alicdn.com/tfs/TB1ypSMTcfpK1RjSZFOXXa6nFXa-144-144.png",
"activeIcon": "https://gw.alicdn.com/tfs/TB1NBiCTgHqK1RjSZFPXXcwapXa-144-144.png"
}
]
}
}
================================================
FILE: examples/page-lifecycle-with-router/src/components/Logo/index.css
================================================
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
================================================
FILE: examples/page-lifecycle-with-router/src/components/Logo/index.jsx
================================================
import { createElement } from 'rax';
import Image from 'rax-image';
import './index.css';
export default (props) => {
const { uri } = props;
const source = { uri };
return (
<Image
className="logo"
source={source}
/>
);
};
================================================
FILE: examples/page-lifecycle-with-router/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/page-lifecycle-with-router/src/pages/About/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/page-lifecycle-with-router/src/pages/About/index.jsx
================================================
import { createElement } from 'rax';
import { registerNativeEventListeners, addNativeEventListener, removeNativeEventListener, usePageShow, usePageHide } from 'rax-app';
import View from 'rax-view';
import Text from 'rax-text';
import './index.css';
import Logo from '../../components/Logo';
function handler(lifeCycle) {
return () => {
console.log('about page ' + lifeCycle);
if (lifeCycle === 'onShareAppMessage') {
return {
title: '分享标题',
desc: '分享详细说明',
path: 'pages/Home/index'
};
}
};
}
const lifeCycles = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onShareAppMessage', 'onTitleClick', 'onOptionMenuClick', 'onPopMenuClick', 'onPullDownRefresh', 'onPullIntercept', 'onTabItemTap', 'onPageScroll', 'onReachBottom'];
lifeCycles.forEach(lc => addNativeEventListener(lc, handler(lc)));
function About(props) {
// To start listening for location changes...
let unlisten = props.history.listen(( action, location ) => {
console.log('in about page action', action);
console.log('in about page location', location);
});
usePageShow(() => {
console.log('about page show -- from usePageShow');
});
usePageHide(() => {
console.log('about page hide -- from usePageHide');
});
return (
<View className="home">
<Logo uri="//gw.alicdn.com/tfs/TB1MRC_cvb2gK0jSZK9XXaEgFXa-1701-1535.png" />
<Text className="title">这里是 About 页面</Text>
<Text className="info" onClick={() => {
props.history.push('/about');
}}>history.push Home 页面</Text>
<Text className="info" onClick={() => {
props.history.replace('/about');
}}>history.replace Home 页面</Text>
<Text className="info" onClick={() => {
props.history.goBack();
}}>history.back Home 页面</Text>
</View>
);
}
registerNativeEventListeners(About, ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onShareAppMessage', 'onTitleClick', 'onOptionMenuClick', 'onPopMenuClick', 'onPullDownRefresh', 'onPullIntercept', 'onTabItemTap', 'onPageScroll', 'onReachBottom']);
export default About;
================================================
FILE: examples/page-lifecycle-with-router/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/page-lifecycle-with-router/src/pages/Home/index.jsx
================================================
import { createElement } from 'rax';
import { registerNativeEventListeners, addNativeEventListener, removeNativeEventListener, usePageShow, usePageHide } from 'rax-app';
import View from 'rax-view';
import Text from 'rax-text';
import './index.css';
import Logo from '../../components/Logo';
function handler(lifeCycle) {
return () => {
console.log('home page ' + lifeCycle);
if (lifeCycle === 'onShareAppMessage') {
return {
title: '分享标题',
desc: '分享详细说明',
path: 'pages/Home/index'
};
}
};
}
const lifeCycles = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onShareAppMessage', 'onTitleClick', 'onOptionMenuClick', 'onPopMenuClick', 'onPullDownRefresh', 'onPullIntercept', 'onTabItemTap', 'onPageScroll', 'onReachBottom'];
lifeCycles.forEach(lc => addNativeEventListener(lc, handler(lc)));
function Home(props) {
// To start listening for location changes...
let unlisten = props.history.listen(( action, location ) => {
console.log('in home page action', action);
console.log('in home page location', location);
});
usePageShow(() => {
console.log('home page show -- from usePageShow');
});
usePageHide(() => {
console.log('home page hide -- from usePageHide');
});
return (
<View className="home">
<Logo uri="//gw.alicdn.com/tfs/TB1MRC_cvb2gK0jSZK9XXaEgFXa-1701-1535.png" />
<Text className="title">这里是 Home 页面</Text>
<Text className="info" onClick={() => {
props.history.push('/about');
}}>history.push About 页面</Text>
<Text className="info" onClick={() => {
props.history.replace('/about');
}}>history.replace About 页面</Text>
</View>
);
}
registerNativeEventListeners(Home, ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onShareAppMessage', 'onTitleClick', 'onOptionMenuClick', 'onPopMenuClick', 'onPullDownRefresh', 'onPullIntercept', 'onTabItemTap', 'onPageScroll', 'onReachBottom']);
export default Home;
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/abc.json
================================================
{
"type": "rax",
"builder": "@ali/builder-rax-v1",
"info": {
"raxVersion": "1.x"
}
}
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"driver-universal": "^3.0.0",
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"rax-document": "^0.1.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-modal": "^1.5.4",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/src/app.js
================================================
import { runApp } from 'rax-app';
import appConfig from './app.json';
runApp(appConfig);
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/src/pages/Home/index.jsx
================================================
import { createElement, useState } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import Modal from 'rax-modal';
import './index.css';
const Home = () => {
const [visible, setVisible] = useState(false);
return (
<View>
<View onClick={() => {
setVisible(true);
}}>open</View>
<Modal
visible={visible}
onHide={() => {
setVisible(false);
}}
>
<Text>Hello, world</Text>
</Modal>
</View>
);
};
export default Home;
================================================
FILE: examples/with-miniapp-native-custom-component/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/with-miniapp-native-custom-component/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/with-miniapp-native-custom-component/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/with-miniapp-native-custom-component/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp",
"wechat-miniprogram"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/with-miniapp-native-custom-component/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"driver-universal": "^3.0.0",
"mini-ali-ui": "^1.1.4",
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"rax-document": "^0.1.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/app.js
================================================
import { runApp } from 'rax-app';
import appConfig from './app.json';
runApp(appConfig);
================================================
FILE: examples/with-miniapp-native-custom-component/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/components/Test/index.ali.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import Test from '../../public/AliNativeComp/index';
import Title from 'mini-ali-ui/es/title/index';
export default function Home() {
return (
<View className="home">
<Title
hasLine={true}
type="arrow"
onActionTap={() => {
console.log('标题被击中了');
}}
>我是 mini-ali-ui 的 title 组件</Title>
<Test onClick={() => {
console.log('我被击中了');
}}>
<View slot="header">我是 header</View>
<View slot="footer">我是 footer</View>
</Test>
</View>
);
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/components/Test/index.wechat.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import Test from '../../public/WechatNativeComp/index';
export default function Home() {
return (
<View className="home">
<Test onClick={() => {
console.log('我被击中了');
}}>
<View slot="header">我是 header</View>
<View slot="footer">我是 footer</View>
</Test>
</View>
);
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/with-miniapp-native-custom-component/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/pages/Home/index.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import './index.css';
import Test from '../../components/Test';
export default function Home() {
return (
<View className="home">
<Test />
</View>
);
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.acss
================================================
.test {
color: #F3BF37;
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.axml
================================================
<view class="test" onTap="onClick">
<slot name="header" />
<view>我是小程序原生自定义组件</view>
<slot name="footer" />
</view>
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.js
================================================
Component({
methods: {
onClick() {
this.props.onClick && this.props.onClick();
}
}
});
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.json
================================================
{
"component": true
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.js
================================================
Component({
options: {
multipleSlots: true
},
methods: {
onClick() {
this.triggerEvent('click');
}
}
});
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.json
================================================
{
"component": true
}
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.wxml
================================================
<view class="test" bindtap="onClick">
<slot name="header" />
<view>我是小程序原生自定义组件</view>
<slot name="footer" />
</view>
================================================
FILE: examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.wxss
================================================
.test {
color: #F3BF37;
}
================================================
FILE: examples/with-miniapp-native-page/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/with-miniapp-native-page/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/with-miniapp-native-page/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/with-miniapp-native-page/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/with-miniapp-native-page/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"driver-universal": "^3.0.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"rax-document": "^0.1.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/with-miniapp-native-page/src/app.js
================================================
import { runApp } from 'rax-app';
import appConfig from './app.json';
runApp(appConfig);
================================================
FILE: examples/with-miniapp-native-page/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
},
{
"path": "/native",
"source": "pages/NativeHome/index"
}
],
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/with-miniapp-native-page/src/components/Logo/index.css
================================================
.logo {
width: 200rpx;
height: 180rpx;
margin-bottom: 20rpx;
}
================================================
FILE: examples/with-miniapp-native-page/src/components/Logo/index.jsx
================================================
import { createElement } from 'rax';
import Image from 'rax-image';
import './index.css';
export default (props) => {
const { uri } = props;
const source = { uri };
return (
<Image
className="logo"
source={source}
/>
);
};
================================================
FILE: examples/with-miniapp-native-page/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/with-miniapp-native-page/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/with-miniapp-native-page/src/pages/Home/index.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import './index.css';
import Logo from '../../components/Logo';
export default function Home() {
return (
<View className="home">
<Logo uri="//gw.alicdn.com/tfs/TB1MRC_cvb2gK0jSZK9XXaEgFXa-1701-1535.png" />
<Text className="title">Welcome to Your Rax App</Text>
<Text className="info">More information about Rax</Text>
<Text className="info">Visit https://rax.js.org</Text>
</View>
);
}
================================================
FILE: examples/with-miniapp-native-page/src/pages/NativeHome/index.acss
================================================
================================================
FILE: examples/with-miniapp-native-page/src/pages/NativeHome/index.axml
================================================
<view>
<view>这里是原生页面</view>
<comp1></comp1>
<comp2></comp2>
</view>
================================================
FILE: examples/with-miniapp-native-page/src/pages/NativeHome/index.js
================================================
Page({});
================================================
FILE: examples/with-miniapp-native-page/src/pages/NativeHome/index.json
================================================
{
"usingComponents": {
"comp1": "../../public/components/comp1/index",
"comp2": "../../public/components/comp2/index"
}
}
================================================
FILE: examples/with-miniapp-native-page/src/public/components/comp1/index.axml
================================================
<view>我是 comp1</view>
================================================
FILE: examples/with-miniapp-native-page/src/public/components/comp1/index.js
================================================
Component({});
================================================
FILE: examples/with-miniapp-native-page/src/public/components/comp1/index.json
================================================
{
"component": true
}
================================================
FILE: examples/with-miniapp-native-page/src/public/components/comp2/index.axml
================================================
<view>我是 comp2</view>
================================================
FILE: examples/with-miniapp-native-page/src/public/components/comp2/index.js
================================================
Component({});
================================================
FILE: examples/with-miniapp-native-page/src/public/components/comp2/index.json
================================================
{
"component": true
}
================================================
FILE: examples/with-miniapp-plugin-component/.eslintrc.js
================================================
module.exports = {
extends: ['rax']
};
================================================
FILE: examples/with-miniapp-plugin-component/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
*~
*.swp
*.log
.DS_Store
.idea/
.temp/
build/
dist/
lib/
coverage/
node_modules/
template.yml
================================================
FILE: examples/with-miniapp-plugin-component/README.md
================================================
# rax-materials-basic-app
## Getting Started
### `npm run start`
Runs the app in development mode.
Open [http://localhost:9999](http://localhost:9999) to view it in the browser.
The page will reload if you make edits.
### `npm run build`
Builds the app for production to the `build` folder.
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/api/data.js
================================================
var data = 'init data';
function getData() {
return data;
}
function setData(value) {
data = value;
}
module.exports = {
getData: getData,
setData: setData
};
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.acss
================================================
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.axml
================================================
<view onTap="onClick">
<view>{{pluginName}}</view>
</view>
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.js
================================================
Component({
props: {
pluginName: 'plugin'
},
methods: {
onClick() {
const { pluginName } = this.props;
this.props.onTest && this.props.onTest(pluginName);
}
}
});
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.json
================================================
{
"component": true
}
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/index.js
================================================
var data = require('./api/data');
module.exports = {
getData: data.getData,
setData: data.setData
};
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.acss
================================================
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.axml
================================================
<view>Hello from plugin page</view>
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.js
================================================
Page({});
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.json
================================================
{}
================================================
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/plugin.json
================================================
{
"publicComponents": {
"test": "components/test/index"
},
"publicPages": {
"hello-page": "pages/index/index"
},
"pages": [
"pages/index/index"
],
"main": "index"
}
================================================
FILE: examples/with-miniapp-plugin-component/build.json
================================================
{
"inlineStyle": false,
"plugins": [
[
"build-plugin-rax-app",
{
"targets": [
"miniapp",
"wechat-miniprogram"
],
"miniapp": {
"buildType": "runtime"
},
"wechat-miniprogram": {
"buildType": "runtime"
}
}
]
]
}
================================================
FILE: examples/with-miniapp-plugin-component/mini.project.json
================================================
{
"miniprogramRoot": "build/miniapp",
"pluginRoot": "ali-miniapp-plugin",
"compileType": "plugin",
"component2": false
}
================================================
FILE: examples/with-miniapp-plugin-component/package.json
================================================
{
"name": "@rax-materials/scaffolds-app-js",
"author": "rax",
"description": "Rax 无线跨端应用工程,使用 JavaScript。",
"version": "0.1.0",
"scripts": {
"build": "build-scripts build",
"start": "build-scripts start",
"lint": "eslint --ext .js --ext .jsx ./"
},
"dependencies": {
"rax": "^1.1.0",
"rax-app": "^2.0.0",
"driver-universal": "^3.0.0",
"rax-image": "^2.0.0",
"rax-link": "^1.0.1",
"rax-text": "^1.0.0",
"rax-view": "^1.0.0",
"rax-document": "^0.1.0",
"universal-env": "^3.0.0"
},
"devDependencies": {
"@alib/build-scripts": "^0.1.0",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^5.0.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "^7.18.0"
},
"private": true,
"originTemplate": "@rax-materials/scaffolds-app-js"
}
================================================
FILE: examples/with-miniapp-plugin-component/project.config.json
================================================
{
"miniprogramRoot": "build/wechat-miniprogram/",
"pluginRoot": "wechat-miniprogram-plugin/",
"compileType": "plugin",
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false
},
"appid": "wxc0575284fd6f4091",
"projectname": "with-miniapp-plugin-component",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {}
}
================================================
FILE: examples/with-miniapp-plugin-component/src/app.js
================================================
import { runApp } from 'rax-app';
import appConfig from './app.json';
runApp(appConfig);
================================================
FILE: examples/with-miniapp-plugin-component/src/app.json
================================================
{
"routes": [
{
"path": "/",
"source": "pages/Home/index"
}
],
"plugins": {
"myPlugin": {
"version": "dev",
"provider": "{{currentPluginId}}"
}
},
"window": {
"title": "Rax App"
}
}
================================================
FILE: examples/with-miniapp-plugin-component/src/components/Test/index.ali.jsx
================================================
import { createElement, useState } from 'rax';
import View from 'rax-view';
// eslint-disable-next-line
import Test from 'plugin://myPlugin/test';
export default function Home() {
function test(pluginName) {
console.log(`${pluginName}被触发`);
}
return (
<View className="home">
{
[1, 2, 3, 4, 5, 6].map(item => {
return (
<View key={item}>
<Test
onTest={test}
pluginName={`插件 No.${item}`}
/>
</View>
);
})
}
</View>
);
}
================================================
FILE: examples/with-miniapp-plugin-component/src/components/Test/index.jsx
================================================
import { createElement } from 'rax';
import { isWeb, isMiniApp } from 'universal-env';
import View from 'rax-view';
import Text from 'rax-text';
export default function Home() {
return (
<View className="home">
<Text className="title">这是 web 组件</Text>
</View>
);
}
================================================
FILE: examples/with-miniapp-plugin-component/src/components/Test/index.wechat.jsx
================================================
import { createElement, useState } from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
// eslint-disable-next-line
import Plugin from 'plugin://myPlugin/hello-component';
export default function Home() {
function test(pluginName) {
console.log(`${pluginName}被触发`);
}
const list = [1, 2, 3];
return (
<View className="home">
{
[1, 2, 3, 4, 5, 6].map(item => {
return (
<View key={item}>
<Plugin list={list} onTest={() => {
test(item);
}} />
</View>
);
})
}
</View>
);
}
================================================
FILE: examples/with-miniapp-plugin-component/src/document/index.jsx
================================================
import { createElement } from 'rax';
import { Root, Style, Script} from 'rax-document';
function Document() {
return (
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover" />
<title>rax-materials-basic-app</title>
<Style />
</head>
<body>
{/* root container */}
<Root />
<Script />
</body>
</html>
);
}
export default Document;
================================================
FILE: examples/with-miniapp-plugin-component/src/pages/Home/index.css
================================================
.home {
align-items: center;
margin-top: 200rpx;
}
.title {
font-size: 45rpx;
font-weight: bold;
margin: 20rpx 0;
}
.info {
font-size: 36rpx;
margin: 8rpx 0;
color: #555;
}
================================================
FILE: examples/with-miniapp-plugin-component/src/pages/Home/index.jsx
================================================
import { createElement } from 'rax';
import View from 'rax-view';
import './index.css';
import Test from '../../components/Test';
export default function Home() {
return (
<View className="home">
<Test />
</View>
);
}
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/api/data.js
================================================
var data = 'init data';
function getData() {
return data;
}
function setData(value) {
data = value;
}
module.exports = {
getData: getData,
setData: setData
};
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.js
================================================
// plugin/components/hello-component.js
Component({
properties: {
list: {
type: Array,
value: [],
observer: function(newVal, oldVal, changedPath) {
this.setData({ list: newVal });
}
}
},
data: {
list: []
},
methods: {
onClick() {
this.triggerEvent('Test');
}
}
});
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.json
================================================
{
"component": true,
"usingComponents": {}
}
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.wxml
================================================
<!--plugin/components/hello-component.wxml-->
<view class="container" bindtap="onClick">
<text class="item" wx:key="item" wx:for="{{ list }}">{{ item }}</text>
</view>
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.wxss
================================================
/* plugin/components/hello-component.wxss */
.container {
margin: 1em;
}
.item {
display: block;
}
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/index.js
================================================
module.exports = {
sayHello: function() {
console.log('Hello plugin!');
},
answer: 42
};
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.js
================================================
// pages/hello-page.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
});
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.json
================================================
{
"usingComponents": {}
}
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.wxml
================================================
<!--pages/hello-page.wxml-->
<text>pages/hello-page.wxml</text>
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.wxss
================================================
/* pages/hello-page.wxss */
================================================
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/plugin.json
================================================
{
"publicComponents": {
"hello-component": "components/hello-component"
},
"pages": {
"hello-page": "pages/hello-page"
},
"main": "index.js"
}
================================================
FILE: jest.config.js
================================================
// jest.config.js
// Note: If you are using babel version 7 you have to install babel-jest with
// yarn add --dev babel-jest @babel/core
module.exports = {
'collectCoverage': true,
'verbose': true,
'setupFiles': [
'./scripts/jest/setupEnvironment.js',
'jest-localstorage-mock'
],
'setupFilesAfterEnv': ['./scripts/jest/setupTests.js'],
'moduleNameMapper': {
// https://jestjs.io/docs/en/webpack#handling-static-assets
// For CSS Modules
'\\.css$': '<rootDir>/scripts/jest/styleMock.js',
},
'testPathIgnorePatterns': [
'/node_modules/',
'/fixtures/',
'/__modules__/',
'/__files__/',
'/lib/',
'/dist/',
'/es/',
]
};
================================================
FILE: lerna.json
================================================
{
"version": "1.7.0",
"npmClient": "ayarn",
"useWorkspaces": true,
"command": {
"bootstrap": {
"npmClientArgs": ["--no-lockfile"]
}
},
"packages": [
"packages/*",
"scripts/bench"
]
}
================================================
FILE: package.json
================================================
{
"private": true,
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/plugin-proposal-class-properties": "^7.2.0",
"@babel/plugin-proposal-decorators": "^7.2.0",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/preset-env": "^7.2.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^20.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.3.4",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"axios": "^0.21.1",
"babel-eslint": "^10.0.3",
"babel-jest": "^26.6.3",
"babel-loader": "^8.0.4",
"babel-merge": "^3.0.0",
"babel-plugin-transform-jsx-stylesheet": "0.6.5",
"chalk": "^2.4.1",
"chokidar": "^2.0.4",
"codecov": "^3.1.0",
"conventional-commit-types": "^2.2.0",
"cz-conventional-changelog": "^2.1.0",
"eslint": "^6.8.0",
"eslint-config-rax": "^0.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-module": "^0.1.0",
"eslint-plugin-react": "7.24.0",
"findup": "^0.1.5",
"ghooks": "^2.0.4",
"glob": "^7.1.3",
"gzip-size": "^5.0.0",
"istanbul-api": "^2.0.6",
"istanbul-lib-coverage": "^2.0.1",
"jest": "^26.6.3",
"jest-diff": "^26.6.2",
"jest-environment-node": "^26.6.2",
"jest-localstorage-mock": "^2.3.0",
"lerna": "^3.16.4",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"rollup": "^2.33.3",
"rollup-plugin-terser": "^7.0.2",
"semver": "^7.1.0",
"semver-regex": "^2.0.0",
"typescript": "^4.0.0",
"uppercamelcase": "^3.0.0",
"webpack": "^4.27.1"
},
"scripts": {
"setup": "rm -rf node_modules && yarn install && npm run clean && npm run build",
"build:compile": "npm run clean:compile && npm run build:compile:packages",
"build:compile:packages": "node ./scripts/compile-packages.js",
"build:dist": "npm run clean:dist && node ./scripts/dist-core.js",
"build": "npm run build:compile && npm run build:dist",
"watch": "node ./scripts/compile-packages.js --watch",
"test": "npm run test:core",
"test:core": "jest --logHeapUsage --detectOpenHandles",
"lint": "eslint --cache --ext .js,.jsx ./",
"lint:fix": "eslint --cache --ext .js,.jsx --fix ./",
"coverage": "npm run test -- --coverage",
"coverage:upload": "npm run clean:coverage && npm run coverage && node ./scripts/mapCoverage.js && codecov",
"clean:dist": "rm -rf ./packages/*/dist",
"clean:compile": "rm -rf ./packages/*/lib && rm -rf ./packages/*/es",
"clean:coverage": "rm -rf ./coverage",
"clean:modules": "rm -rf ./packages/*/node_modules",
"clean": "jest --clearCache && lerna clean --yes && npm run clean:modules && npm run clean:compile && npm run clean:dist && npm run clean:coverage",
"clear": "git clean -xfd",
"bench": "cd scripts/bench && npm install && npm start",
"check-and-publish": "node ./scripts/check-and-publish"
},
"config": {
"ghooks": {
"commit-msg": "./scripts/validate-commit-msg.js",
"pre-commit": "npm run lint"
},
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"workspaces": [
"packages/*",
"scripts/*"
]
}
================================================
FILE: packages/driver-dom/CHANGELOG.md
================================================
## Changelog
### v2.2.2
- Fix hydrate style with webkit prefix in iOS 10
### v2.2.1
- Bump version
### v2.2.0
- Use `style-unit` convert `rpx`
================================================
FILE: packages/driver-dom/README.md
================================================
# driver-dom
> DOM driver for Rax.
## Install
```bash
$ npm install --save driver-dom
```
## Use
```jsx
import {createElement, render} from 'rax';
import DriverDOM from 'driver-dom';
function Example() {
return (
<div>
<img width="560" height="560" src="https://img.alicdn.com/tps/TB1z.55OFXXXXcLXXXXXXXXXXXX-560-560.jpg" />
</div>
);
}
render(<Example />, null, {
driver: DriverDOM
});
```
## API
**static setTagNamePrefix(prefix: String)**
Set tag prefix for custom elements.
```js
import DriverDOM from 'driver-dom';
DriverDOM.setTagNamePrefix('a-');
```
================================================
FILE: packages/driver-dom/package.json
================================================
{
"name": "driver-dom",
"version": "2.2.2",
"description": "DOM driver for Rax",
"license": "BSD-3-Clause",
"main": "lib/index.js",
"module": "es/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/alibaba/rax.git"
},
"bugs": {
"url": "https://github.com/alibaba/rax/issues"
},
"homepage": "https://github.com/alibaba/rax#readme",
"dependencies": {
"style-unit": "^3.0.0"
},
"devDependencies": {
"rax": "^1.0.0"
}
}
================================================
FILE: packages/driver-dom/src/__tests__/attributes.js
================================================
import { createElement, render } from 'rax';
import * as DriverDOM from '../';
describe('attributes', () => {
let container;
beforeEach(() => {
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
});
describe('string properties', () => {
it('render string prop with simple numbers', () => {
render((
<div width={30} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.getAttribute('width')).toBe('30');
});
it('render string prop with true value', () => {
render((
<a href={true} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.getAttribute('href')).toBe('true');
});
it('render string prop with object value', () => {
render((
<input type="checkbox" data={{foo: 'bar'}} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.getAttribute('data')).toBe('[object Object]');
});
});
describe('boolean properties', () => {
it('render boolean prop with true value', () => {
render((
<div hidden={true} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.getAttribute('hidden')).toBe('');
});
it('render boolean prop with false value', () => {
render((
<div hidden={false} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.getAttribute('hidden')).toBe(null);
});
it('render boolean prop with self value', () => {
render((
<div hidden={'hidden'} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.getAttribute('hidden')).toBe('');
});
});
describe('properties must set with property', () => {
it('render boolean prop with true', () => {
render((
<input type="checkbox" checked={true} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.checked).toBe(true);
});
it('render boolean prop with false', () => {
render((
<input type="checkbox" checked={false} />
), container, {
driver: DriverDOM
});
let node = container.children[0];
expect(node.checked).toBe(false);
});
});
});
================================================
FILE: packages/driver-dom/src/__tests__/css-custom-properties.js
================================================
import { createElement, render } from 'rax';
import * as DriverDOM from '../';
describe('Support CSS custom properties', () => {
let container;
let logs;
const setProperty = CSSStyleDeclaration.prototype.setProperty;
beforeAll(() => {
CSSStyleDeclaration.prototype.setProperty = (prop, value) => {
logs.push([prop, value]);
};
});
afterAll(() => {
CSSStyleDeclaration.prototype.setProperty = setProperty;
});
beforeEach(() => {
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
logs = [];
});
it('CSS custom properties works.', () => {
render((
<div style={{
'--backgroundColor': 'red',
backgroundColor: 'var(--backgroundColor)',
width: '200px'
}}>
Test CSS custom properties.
</div>
), container, {
driver: DriverDOM
});
expect(logs).toEqual([['--backgroundColor', 'red']]);
});
});
================================================
FILE: packages/driver-dom/src/__tests__/css-unit-operations.js
================================================
import { createElement, render } from 'rax';
import * as DriverDOM from '../';
describe('CSSPropertyOperations', () => {
let container;
beforeEach(() => {
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
});
it('should automatically append `px` to relevant styles', () => {
const styles = {
left: 0,
margin: 16,
opacity: 0.5,
padding: '4px',
};
render(<div style={styles} />, container, { driver: DriverDOM });
const targetNode = container.children[0];
expect(targetNode.style._values).toMatchObject({ 'left': '0px', 'opacity': '0.5', 'margin': '16px', 'padding': '4px' });
});
it('should not append `px` to styles that might need a number', () => {
const styles = {
flex: 1,
flexGrow: 0,
lineHeight: 1.1,
opacity: 0.5,
};
render(<div style={styles} />, container, { driver: DriverDOM });
const targetNode = container.children[0];
expect(targetNode.style._values).toMatchObject({ 'flex': '1', 'opacity': '0.5', 'flex-grow': '0', 'line-height': 1.1 });
});
it('should translate `rpx` to the `vw` relative to the width of the 750 screen', () => {
const styles = {
width: '375rpx',
height: '150rpx',
margin: '75rpx 100vh'
};
render(<div style={styles} />, container, { driver: DriverDOM });
const targetNode = container.children[0];
expect(targetNode.style._values).toMatchObject({ 'width': '50vw', 'height': '20vw', 'margin': '10vw 100vh' });
});
it('should not change the style values order after hydration', () => {
container.innerHTML = '<div style="font-size: 14px; display: flex; flex-direction: row;"></div>';
const styles = {
fontSize: '14px',
display: 'flex',
flexDirection: 'row'
};
render(<div style={styles} />, container, { driver: DriverDOM, hydrate: true });
const targetNode = container.children[0];
expect(JSON.stringify(targetNode.style._values)).toEqual(JSON.stringify({
'font-size': '14px',
'display': 'flex',
'flex-direction': 'row'
}));
});
it('should not translate `rpx` to the `vw` with url()', () => {
const styles = {
width: '375rpx',
height: '150rpx',
backgroundImage: 'url("abc2rpx")'
};
render(<div style={styles} />, container, { driver: DriverDOM });
const targetNode = container.children[0];
expect(targetNode.style._values).toMatchObject({ 'width': '50vw', 'height': '20vw', 'background-image': 'url(abc2rpx)' });
});
});
================================================
FILE: packages/driver-dom/src/__tests__/event-listener.js
================================================
import { createElement, render } from 'rax';
import * as DriverDOM from '../';
describe('EventListener', () => {
let container;
beforeEach(() => {
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
});
it('should dispatch events', () => {
const mock = jest.fn();
render(<div onClick={mock} />, container, { driver: DriverDOM });
const targetNode = container.children[0];
targetNode.dispatchEvent(
new MouseEvent('click', {
bubbles: true,
}),
);
expect(mock).toBeCalled();
});
});
================================================
FILE: packages/driver-dom/src/__tests__/hydrate.js
================================================
import { createElement, render, useEffect } from 'rax';
describe('Hydrate', () => {
let DriverDOM;
let container;
beforeEach(() => {
jest.resetModules();
DriverDOM = require('../');
jest.useFakeTimers();
container = document.createElement('div');
container.innerHTML = '<div class="container"><div>About Rax</div><div>Docs</div></div>';
(document.body || document.documentElement).appendChild(container);
});
it('should keep comment node when rendering multi adjacent text nodes', () => {
container = document.createElement('div');
container.innerHTML = '<div>About:<!--|-->Rax</div>';
(document.body || document.documentElement).appendChild(container);
const Component = (props) => {
return (
<div>About:{props.name}</div>
);
};
render(<Component name="Rax" />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
expect(container.childNodes[0].childNodes[0].data).toBe('About:');
expect(container.childNodes[0].childNodes[1].nodeType).toBe(8); // comment
expect(container.childNodes[0].childNodes[2].data).toBe('Rax');
});
it('should not be affected by render in useEffect', () => {
const childContainer = document.createElement('div');
(document.body || document.documentElement).appendChild(childContainer);
const Child = () => {
useEffect(() => {
render(<span>child content</span>, childContainer);
});
return null;
};
const Component = () => {
return (
<div class="container">
<div>About Rax</div>
<Child />
</div>
);
};
jest.useFakeTimers();
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
expect(container.childNodes[0].childNodes[1].nodeType).toBe(8); // comment;
});
it('should throw error for nested render when hydrating', () => {
const childContainer = document.createElement('div');
(document.body || document.documentElement).appendChild(childContainer);
const Child = () => {
render(<span>child content</span>, childContainer);
return null;
};
const Component = () => {
return (
<div class="container">
<div>About Rax</div>
<Child />
</div>
);
};
expect(() => {
jest.useFakeTimers();
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
}).toThrowError('Nested render is not allowed when hydrating. If necessary, trigger render in useEffect.', {
withoutStack: true,
});
});
it('should warn for replaced hydratable element', () => {
const Component = () => {
return (
<div className="container">
<img src="./logo.png" />
<div>About Rax</div>
<div>Docs</div>
</div>
);
};
expect(() => {
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
}).toWarnDev('Warning: Expected server HTML to contain a matching <img> in <div.container>, but got <div>', {
withoutStack: true,
});
expect(container.childNodes[0].childNodes[0].tagName).toBe('IMG');
});
it('should not warn for replaced comment', () => {
container = document.createElement('div');
container.innerHTML = '<div><!-- --><div>About Rax</div><div>Docs</div></div>';
(document.body || document.documentElement).appendChild(container);
const Component = () => {
return (
<div class="container">
<img src="./logo.png" />
<div>About Rax</div>
<div>Docs</div>
</div>
);
};
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
expect(container.childNodes[0].childNodes[0].tagName).toBe('IMG');
});
it('should warn for deleted hydratable element', () => {
const Component = () => {
return (
<div class="container">
<div>About Rax</div>
</div>
);
};
expect(() => {
jest.useFakeTimers();
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
}).toWarnDev('Warning: Did not expect server HTML to contain a <div> in <div.container>', {
withoutStack: true,
});
expect(container.childNodes[0].childNodes[1]).toBe(undefined);
});
it('should warn for inserted Hydrated element', () => {
const Component = () => {
return (
<div className="container">
<div>About Rax</div>
<div>Docs</div>
<div className="example">Examples</div>
</div>
);
};
expect(() => {
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
}).toWarnDev('Warning: Expected server HTML to contain a matching <div> in <div.container>', {
withoutStack: true,
});
expect(container.childNodes[0].childNodes[2].tagName).toBe('DIV');
});
it('should not compare and delete hydration child with innerHTML', () => {
const Component = () => {
return (
<div className="container" dangerouslySetInnerHTML={{__html: '<div>About Rax</div><div>Docs</div>'}} />
);
};
render(<Component />, container, { driver: DriverDOM, hydrate: true });
jest.runAllTimers();
expect(container.childNodes[0].childNodes[0].tagName).toBe('DIV');
});
});
================================================
FILE: packages/driver-dom/src/__tests__/node-operations.js
================================================
import { createElement, Fragment, render, useState } from 'rax';
import * as DriverDOM from '../';
describe('NodeOperations', () => {
let container;
let updateHandler;
beforeEach(() => {
jest.useFakeTimers();
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
});
it('should append child', () => {
const Component = () => {
const [temp, setTemp] = useState(false);
updateHandler = setTemp;
return <Fragment>{temp ? <div /> : null}</Fragment>;
};
render(<Component />, container, { driver: DriverDOM });
updateHandler(true);
jest.runAllTimers();
expect(container.childNodes[0].tagName).toBe('DIV');
});
it('should update text', () => {
const Component = () => {
const [temp, setTemp] = useState('');
updateHandler = setTemp;
return <p>{temp}</p>;
};
render(<Component />, container, { driver: DriverDOM });
updateHandler('hello');
jest.runAllTimers();
expect(container.childNodes[0].childNodes[0].data).toBe('hello');
});
it('should removeAttribute className', () => {
const Component = () => {
const [temp, setTemp] = useState(true);
updateHandler = setTemp;
return <div {...(temp ? { className: 'hello' } : {})} />;
};
render(<Component />, container, { driver: DriverDOM });
updateHandler(false);
jest.runAllTimers();
expect(container.childNodes[0].className).toBe('');
});
});
================================================
FILE: packages/driver-dom/src/__tests__/svg.js
================================================
import { createElement, render } from 'rax';
import * as DriverDOM from '../';
describe('svg', () => {
let container;
beforeEach(() => {
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
});
it('should create SVG with SVG namespace URI', () => {
render((
<svg height="90" width="200">
<text x="10" y="20" style={{ fill: 'red' }}>
<tspan x="10" y="45">First line.</tspan>
<tspan x="10" y="70">Second line.</tspan>
</text>
Sorry, your browser does not support inline SVG.
</svg>
), container, {
driver: DriverDOM
});
let svgNode = container.children[0];
expect(svgNode.namespaceURI).toEqual('http://www.w3.org/2000/svg');
let textNode = svgNode.children[0];
expect(textNode.namespaceURI).toEqual('http://www.w3.org/2000/svg');
let tspanNode = textNode.children[0];
expect(tspanNode.namespaceURI).toEqual('http://www.w3.org/2000/svg');
});
it('should set transform as attribute', () => {
render((
<svg height="90" width="200">
<text transform="scale(1 0.5)" test={true}>
<tspan x="10" y="45">First line.</tspan>
</text>
Sorry, your browser does not support inline SVG.
</svg>
), container, {
driver: DriverDOM
});
let svgNode = container.children[0];
let textNode = svgNode.children[0];
expect(textNode.getAttribute('transform')).toEqual('scale(1 0.5)');
});
});
================================================
FILE: packages/driver-dom/src/index.d.ts
================================================
// Driver spec: https://github.com/alibaba/rax/blob/master/docs/en-US/driver-spec.md
declare namespace Driver {
function createBody(): void;
function createEmpty(component: any): void;
function createText(): void;
function updateText(node: any, text: any)
function createElement(type: any, props: any, component: any)
function appendChild(node: any, parent: any)
function removeChild(node: any, parent: any)
function replaceChild(newChild: any, oldChild: any, parent: any)
function insertAfter(node: any, after: any, parent: any)
function insertBefore(node: any, before: any, parent: any)
function addEventListener(node: any, eventName: any, eventHandler: any)
function removeEventListener(node: any, eventName: any, eventHandler: any)
function setAttribute(node: any, propKey: any, propValue: any)
function removeAttribute(node: any, propKey: any)
function setStyle(node: any, styleObject: any)
}
export default Driver;
================================================
FILE: packages/driver-dom/src/index.js
================================================
/**
* Driver for Web DOM
**/
import { convertUnit, setViewportWidth, setUnitPrecision, cached } from 'style-unit';
import {
warnForReplacedHydratebleElement,
warnForDeletedHydratableElement,
warnForInsertedHydratedElement
} from './warning';
// opacity -> opa
// fontWeight -> ntw
// lineHeight|lineClamp -> ne[ch]
// flex|flexGrow|flexPositive|flexShrink|flexNegative|boxFlex|boxFlexGroup|zIndex -> ex(?:s|g|n|p|$)
// order -> ^ord
// zoom -> zoo
// gridArea|gridRow|gridRowEnd|gridRowSpan|gridRowStart|gridColumn|gridColumnEnd|gridColumnSpan|gridColumnStart -> grid
// columnCount -> mnc
// tabSize -> bs
// orphans -> orp
// windows -> ows
// animationIterationCount -> onit
// borderImageOutset|borderImageSlice|borderImageWidth -> erim
const NON_DIMENSIONAL_REG = /opa|ntw|ne[ch]|ex(?:s|g|n|p|$)|^ord|zoo|grid|orp|ows|mnc|^columns$|bs|erim|onit/i;
const EVENT_PREFIX_REG = /^on[A-Z]/;
const DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
const HTML = '__html';
const INNER_HTML = 'innerHTML';
const CLASS_NAME = 'className';
const CLASS = 'class';
const STYLE = 'style';
const CHILDREN = 'children';
const TEXT_CONTENT_ATTR = 'textContent';
const CREATE_ELEMENT = 'createElement';
const CREATE_COMMENT = 'createComment';
const CREATE_TEXT_NODE = 'createTextNode';
const SET_ATTRIBUTE = 'setAttribute';
const REMOVE_ATTRIBUTE = 'removeAttribute';
const SVG_NS = 'http://www.w3.org/2000/svg';
const TEXT_NODE = 3;
const COMMENT_NODE = 8;
const TEXT_SPLIT_COMMENT = '|';
const EMPTY = '';
const HYDRATION_INDEX = '__i';
const HYDRATION_APPEND = '__a';
const WITH_INNERHTML = '__h';
const __DEV__ = process.env.NODE_ENV !== 'production';
let tagNamePrefix = EMPTY;
// Flag indicating if the diff is currently within an SVG
let isSVGMode = false;
let isHydrating = false;
/**
* Camelize CSS property.
* Vendor prefixes should begin with a capital letter.
* For example:
* background-color -> backgroundColor
* -webkit-transition -> webkitTransition
*/
const camelizeStyleName = cached(name => {
return name
.replace(/-([a-z])/gi, function(s, g) {
return g.toUpperCase();
});
});
const isDimensionalProp = cached(prop => !NON_DIMENSIONAL_REG.test(prop));
const isEventProp = cached(prop => EVENT_PREFIX_REG.test(prop));
export function setTagNamePrefix(prefix) {
tagNamePrefix = prefix;
}
export function createBody() {
return document.body;
}
export function createEmpty(component) {
const parent = component._parent;
let node;
if (isHydrating) {
const hydrationChild = findHydrationChild(parent);
if (hydrationChild) {
if (hydrationChild.nodeType === COMMENT_NODE) {
return hydrationChild;
} else {
node = document[CREATE_COMMENT](EMPTY);
replaceChild(node, hydrationChild, parent);
}
} else {
node = document[CREATE_COMMENT](EMPTY);
node[HYDRATION_APPEND] = true;
}
} else {
node = document[CREATE_COMMENT](EMPTY);
}
return node;
}
export function createText(text, component) {
const parent = component._parent;
let node;
if (isHydrating) {
const hydrationChild = findHydrationChild(parent);
if (hydrationChild) {
if (hydrationChild.nodeType === TEXT_NODE) {
if (text !== hydrationChild[TEXT_CONTENT_ATTR]) {
hydrationChild[TEXT_CONTENT_ATTR] = text;
}
return hydrationChild;
} else {
node = document[CREATE_TEXT_NODE](text);
replaceChild(node, hydrationChild, parent);
}
} else {
node = document[CREATE_TEXT_NODE](text);
node[HYDRATION_APPEND] = true;
}
} else {
node = document[CREATE_TEXT_NODE](text);
}
return node;
}
export function updateText(node, text) {
node[TEXT_CONTENT_ATTR] = text;
}
function findHydrationChild(parent) {
const childNodes = parent.childNodes;
if (parent[HYDRATION_INDEX] == null) {
parent[HYDRATION_INDEX] = 0;
}
const child = childNodes[parent[HYDRATION_INDEX]++];
// If child is an comment node for spliting text node, use the next node.
if (child && child.nodeType === COMMENT_NODE && child.data === TEXT_SPLIT_COMMENT) {
return childNodes[parent[HYDRATION_INDEX]++];
} else {
return child;
}
}
/**
* @param {string} type node type
* @param {object} props elemement properties
* @param {object} component component instance
* @param {boolean} __shouldConvertUnitlessToRpx should add unit when missing
*/
export function createElement(type, props, component, __shouldConvertUnitlessToRpx) {
const parent = component._parent;
isSVGMode = type === 'svg' || parent && parent.namespaceURI === SVG_NS;
let node;
let hydrationChild = null;
function createNode() {
if (isSVGMode) {
node = document.createElementNS(SVG_NS, type);
} else if (tagNamePrefix) {
let tagNamePrefix = typeof tagNamePrefix === 'function' ? tagNamePrefix(type) : tagNamePrefix;
node = document[CREATE_ELEMENT](tagNamePrefix + type);
} else {
node = document[CREATE_ELEMENT](type);
}
}
if (isHydrating) {
hydrationChild = findHydrationChild(parent);
if (hydrationChild) {
if (type === hydrationChild.nodeName.toLowerCase()) {
for (let attributes = hydrationChild.attributes, i = attributes.length; i--;) {
const attribute = attributes[i];
const attributeName = attribute.name;
const propValue = props[attributeName];
if (
// The class or className prop all not in props
attributeName === CLASS && props[CLASS_NAME] == null && propValue == null ||
// The style prop is empty object or not in props
attributeName === STYLE && (propValue == null || Object.keys(propValue).length === 0) ||
// Remove rendered node attribute that not existed
attributeName !== CLASS && attributeName !== STYLE && propValue == null
) {
hydrationChild[REMOVE_ATTRIBUTE](attributeName);
continue;
}
if (attributeName === STYLE) {
// Remove invalid style prop, and direct reset style to child avoid diff style
// Set style to empty will change the index of style, so here need to traverse style backwards
for (let l = hydrationChild.style.length; 0 < l; l--) {
// Prop name get from node style is hyphenated, eg: background-color
const stylePropName = hydrationChild.style[l - 1];
// Style with webkit prefix, will cause stylePropName be undefined in iOS 10.1 and 10.2.
// Eg. when set transition-timing-function to be empty, it will also delete -webkit-transition-timing-function.
if (stylePropName) {
const camelizedStyleName = camelizeStyleName(stylePropName);
if (propValue[camelizedStyleName] == null) {
hydrationChild.style[camelizedStyleName] = EMPTY;
}
}
}
}
}
node = hydrationChild;
} else {
createNode();
replaceChild(node, hydrationChild, parent);
if (__DEV__) {
warnForReplacedHydratebleElement(parent, node, hydrationChild);
}
}
} else {
createNode();
node[HYDRATION_APPEND] = true;
if (__DEV__) {
warnForInsertedHydratedElement(parent, node);
}
}
} else {
createNode();
}
for (let prop in props) {
const value = props[prop];
if (prop === CHILDREN) continue;
if (value != null) {
if (prop === STYLE) {
setStyle(node, value, __shouldConvertUnitlessToRpx);
} else if (isEventProp(prop)) {
addEventListener(node, prop.slice(2).toLowerCase(), value, component);
} else {
setAttribute(node, prop, value, isSVGMode);
}
}
}
return node;
}
export function appendChild(node, parent) {
if (!isHydrating || node[HYDRATION_APPEND]) {
return parent.appendChild(node);
}
}
export function removeChild(node, parent) {
parent = parent || node.parentNode;
// Maybe has been removed when remove child
if (parent) {
parent.removeChild(node);
}
}
export function replaceChild(newChild, oldChild, parent) {
parent = parent || oldChild.parentNode;
parent.replaceChild(newChild, oldChild);
}
export function insertAfter(node, after, parent) {
parent = parent || after.parentNode;
const nextSibling = after.nextSibling;
if (nextSibling) {
// Performance improve when node has been existed before nextSibling
if (nextSibling !== node) {
insertBefore(node, nextSibling, parent);
}
} else {
appendChild(node, parent);
}
}
export function insertBefore(node, before, parent) {
parent = parent || before.parentNode;
parent.insertBefore(node, before);
}
export function addEventListener(node, eventName, eventHandler) {
return node.addEventListener(eventName, eventHandler);
}
export function removeEventListener(node, eventName, eventHandler) {
return node.removeEventListener(eventName, eventHandler);
}
export function removeAttribute(node, propKey) {
if (propKey === DANGEROUSLY_SET_INNER_HTML) {
return node[INNER_HTML] = null;
}
if (propKey === CLASS_NAME) propKey = CLASS;
if (propKey in node) {
try {
// Some node property is readonly when in strict mode
node[propKey] = null;
} catch (e) { }
}
node[REMOVE_ATTRIBUTE](propKey);
}
export function setAttribute(node, propKey, propValue, isSvg) {
if (propKey === DANGEROUSLY_SET_INNER_HTML) {
// For reduce innerHTML operation to improve performance.
if (node[INNER_HTML] !== propValue[HTML]) {
node[INNER_HTML] = propValue[HTML];
}
node[WITH_INNERHTML] = true;
return;
}
if (propKey === CLASS_NAME) propKey = CLASS;
// Prop for svg can only be set by attribute
if (!isSvg && propKey in node) {
try {
// Some node property is readonly when in strict mode
node[propKey] = propValue;
} catch (e) {
node[SET_ATTRIBUTE](propKey, propValue);
}
} else {
node[SET_ATTRIBUTE](propKey, propValue);
}
}
/**
* @param {object} node target node
* @param {object} style target node style value
* @param {boolean} __shouldConvertUnitlessToRpx
*/
export function setStyle(node, style, __shouldConvertUnitlessToRpx) {
for (let prop in style) {
const value = style[prop];
let convertedValue;
if (typeof value === 'number' && isDimensionalProp(prop)) {
if (__shouldConvertUnitlessToRpx) {
convertedValue = value + 'rpx';
// Transfrom rpx to vw
convertedValue = convertUnit(convertedValue);
} else {
convertedValue = value + 'px';
}
} else {
convertedValue = convertUnit(value);
}
// Support CSS custom properties (variables) like { --main-color: "black" }
if (prop[0] === '-' && prop[1] === '-') {
// reference: https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/setProperty.
// style.setProperty do not support Camel-Case style properties.
node.style.setProperty(prop, convertedValue);
} else {
node.style[prop] = convertedValue;
}
}
}
export function beforeRender({ hydrate }) {
// Nested render may reset `isHydrating`, `recolectHydrationChild` will not work correctly after render.
if (isHydrating && !hydrate) {
if (__DEV__) {
throw new Error(
'Nested render is not allowed when hydrating. ' +
'If necessary, trigger render in useEffect.'
);
} else {
throw new Error('Nested render found.');
}
}
isHydrating = hydrate;
}
function recolectHydrationChild(hydrationParent) {
// Should not to compare node with dangerouslySetInnerHTML because vdomLength is alway 0
if (hydrationParent[WITH_INNERHTML]) {
return;
}
const nativeLength = hydrationParent.childNodes.length;
const vdomLength = hydrationParent[HYDRATION_INDEX] || 0;
if (nativeLength - vdomLength > 0) {
for (let i = nativeLength - 1; i >= vdomLength; i--) {
if (__DEV__) {
warnForDeletedHydratableElement(hydrationParent, hydrationParent.childNodes[i]);
}
hydrationParent.removeChild(hydrationParent.childNodes[i]);
}
}
for (let j = hydrationParent.childNodes.length - 1; j >= 0; j--) {
recolectHydrationChild(hydrationParent.childNodes[j]);
}
}
export function afterRender({ container }) {
if (isHydrating) {
// Remove native node when more then vdom node
recolectHydrationChild(container);
isHydrating = false;
}
}
/**
* Remove all children from node.
* @NOTE: Optimization at web.
*/
export function removeChildren(node) {
node.textContent = EMPTY;
}
export {
/**
* Set viewport width.
* @param viewport {Number} Viewport width, default to 750.
*/
setViewportWidth,
/**
* Set unit precision.
* @param n {Number} Unit precision, default to 4.
*/
setUnitPrecision
};
================================================
FILE: packages/driver-dom/src/warning.js
================================================
let didWarnInvalidHydration = false;
const __DEV__ = process.env.NODE_ENV !== 'production';
export function warnForReplacedHydratebleElement(
parentNode,
clientNode,
serverNode,
) {
if (__DEV__) {
if (didWarnInvalidHydration) {
return;
}
// should not warn for replace comment, bescause it may be a placeholder from server
if (serverNode.nodeType === 8) {
return;
}
didWarnInvalidHydration = true;
warning(
'Expected server HTML to contain a matching %s in %s, but got %s.',
getNodeName(clientNode),
getNodeName(parentNode),
getNodeName(serverNode)
);
}
}
export function warnForDeletedHydratableElement(
parentNode,
child,
) {
if (__DEV__) {
if (didWarnInvalidHydration) {
return;
}
didWarnInvalidHydration = true;
warning(
'Did not expect server HTML to contain a %s in %s.',
getNodeName(child),
getNodeName(parentNode),
);
}
}
export function warnForInsertedHydratedElement(
parentNode,
node
) {
if (__DEV__) {
if (didWarnInvalidHydration) {
return;
}
didWarnInvalidHydration = true;
warning(
'Expected server HTML to contain a matching %s in %s.',
getNodeName(node),
getNodeName(parentNode),
);
}
}
/**
* Concat tagName、 id and class info to help locate a node
* @param {*} node HTMLElement
* @returns {string} for example: <div#home.rax-view.home>
*/
function getNodeName(node) {
// text node don`t have tagName
if (!node.tagName) {
return node.nodeName;
}
const name = node.tagName.toLowerCase();
const id = node.id ? '#' + node.id : '';
const classStr = node.className || '';
const classList = classStr.split(' ').map((className) => {
return className ? '.' + className : '';
});
return `<${name}${id}${classList.join('')}>`;
}
export let warning = () => {};
if (process.env.NODE_ENV !== 'production') {
warning = (template, ...args) => {
if (typeof console !== 'undefined') {
let argsWithFormat = args.map(item => '' + item);
argsWithFormat.unshift('Warning: ' + template);
// Don't use spread (or .apply) directly because it breaks IE9
Function.prototype.apply.call(console.error, console, argsWithFormat);
}
// For works in DevTools when enable `Pause on caught exceptions`
// that can find the component where caused this warning
try {
let argIndex = 0;
const message = 'Warning: ' + template.replace(/%s/g, () => args[argIndex++]);
throw new Error(message);
} catch (e) {}
};
}
================================================
FILE: packages/driver-server/README.md
================================================
# driver-server
> Server driver for Rax.
## Install
```bash
$ npm install --save driver-server
```
## Use
```jsx
import {createElement, Component, render} from 'rax';
import ServerDriver from 'driver-server';
import {isNode} from 'universal-env';
class Example extends Component {
render() {
return (
<div>
<img width="560" height="560" src="https://img.alicdn.com/tps/TB1z.55OFXXXXcLXXXXXXXXXXXX-560-560.jpg" />
</div>
);
}
}
render(<Example />, null, {
driver: isNode ? ServerDriver : null
});
```
================================================
FILE: packages/driver-server/package.json
================================================
{
"name": "driver-server",
"version": "1.0.0",
"description": "Server driver for Rax",
"license": "BSD-3-Clause",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/alibaba/rax.git"
},
"bugs": {
"url": "https://github.com/alibaba/rax/issues"
},
"homepage": "https://github.com/alibaba/rax#readme"
}
================================================
FILE: packages/driver-server/src/index.js
================================================
/**
* Server driver
**/
const ID = 'id';
const STYLE = 'style';
const CHILDREN = 'children';
const DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
const ELEMENT_NODE = 1;
const TEXT_NODE = 3;
const COMMENT_NODE = 8;
const Driver = {
// Internal state
nodeMaps: {},
getElementById(id) {
return this.nodeMaps[id];
},
createBody() {
return {
nodeType: ELEMENT_NODE,
tagName: 'BODY',
attributes: {},
style: {},
eventListeners: {},
childNodes: [],
parentNode: null
};
},
createComment(content) {
return {
nodeType: COMMENT_NODE,
data: content,
parentNode: null
};
},
createEmpty() {
return this.createComment(' empty ');
},
createText(text) {
return {
nodeType: TEXT_NODE,
data: text,
parentNode: null
};
},
updateText(node, text) {
node.data = text;
},
createElement(type, props) {
let node = {
nodeType: ELEMENT_NODE,
tagName: type.toUpperCase(),
attributes: {},
style: props.style || {},
eventListeners: {},
childNodes: [],
parentNode: null
};
this.setNativeProps(node, props, true);
return node;
},
appendChild(node, parent) {
parent.childNodes.push(node);
node.parentNode = parent;
},
removeChild(node, parent) {
parent = parent || node.parentNode;
let id = node.attributes && node.attributes[ID];
if (id != null) {
this.nodeMaps[id] = null;
}
if (node.parentNode) {
let idx = node.parentNode.childNodes.indexOf(node);
node.parentNode.childNodes.splice(idx, 1);
node.parentNode = null;
}
},
replaceChild(newChild, oldChild, parent) {
parent = parent || oldChild.parentNode;
let previousSibling = this.previousSibling(oldChild);
let nextSibling = this.nextSibling(oldChild);
this.removeChild(oldChild, parent);
if (previousSibling) {
this.insertAfter(newChild, previousSibling, parent);
} else if (nextSibling) {
this.insertBefore(newChild, nextSibling, parent);
} else {
this.appendChild(newChild, parent);
}
},
insertAfter(node, after, parent) {
parent = parent || after.parentNode;
let nodeIdx = parent.childNodes.indexOf(node);
if (nodeIdx !== -1) {
parent.childNodes.splice(nodeIdx, 1);
}
let idx = parent.childNodes.indexOf(after);
if (idx === parent.childNodes.length - 1) {
parent.childNodes.push(node);
} else {
parent.childNodes.splice(idx + 1, 0, node);
}
node.parentNode = parent;
},
insertBefore(node, before, parent) {
parent = parent || before.parentNode;
let nodeIdx = parent.childNodes.indexOf(node);
if (nodeIdx !== -1) {
parent.childNodes.splice(nodeIdx, 1);
}
let idx = parent.childNodes.indexOf(before);
parent.childNodes.splice(idx, 0, node);
node.parentNode = parent;
},
nextSibling(node) {
let parentNode = node.parentNode;
if (parentNode) {
let idx = parentNode.childNodes.indexOf(node);
return parentNode.childNodes[idx + 1];
}
},
previousSibling(node) {
let parentNode = node.parentNode;
if (parentNode) {
let idx = parentNode.childNodes.indexOf(node);
return parentNode.childNodes[idx - 1];
}
},
addEventListener(node, eventName, eventHandler) {
node.eventListeners[eventName] = eventHandler;
},
removeEventListener(node, eventName, eventHandler) {
delete node.eventListeners[eventName];
},
removeAttribute(node, propKey, propValue) {
if (propKey === 'className') {
propKey = 'class';
}
if (propKey == ID) {
this.nodeMaps[propValue] = null;
}
if (node.tagName === 'INPUT' &&
( propKey == 'checked' && (node.attributes.type === 'checkbox' || node.attributes.type === 'radio')
|| propKey == 'value')) {
node.attributes[propKey] = null;
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
node.__html = null;
} else {
node.attributes[propKey] = null;
}
},
setAttribute(node, propKey, propValue) {
if (propKey === 'className') {
propKey = 'class';
}
if (propKey == ID) {
this.nodeMaps[propValue] = node;
}
if (node.tagName === 'INPUT' &&
( propKey == 'checked' && (node.attributes.type === 'checkbox' || node.attributes.type === 'radio')
|| propKey == 'value')) {
node.attributes[propKey] = propValue;
} else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
node.__html = propValue.__html;
} else if (propValue != null) {
node.attributes[propKey] = propValue;
}
},
setStyle(node, style) {
for (let key in style) {
node.style[key] = style[key];
}
},
setNativeProps(node, props, shouldIgnoreStyleProp) {
for (let prop in props) {
let value = props[prop];
if (prop === CHILDREN) {
continue;
}
if (value != null) {
if (prop === STYLE) {
if (shouldIgnoreStyleProp) {
continue;
}
this.setStyle(node, value);
} else if (EVENT_PREFIX_REGEXP.test(prop)) {
let eventName = prop.slice(2).toLowerCase();
this.addEventListener(node, eventName, value);
} else {
this.setAttribute(node, prop, value);
}
}
}
}
};
export default Driver;
================================================
FILE: packages/driver-universal/CHANGELOG.md
================================================
## Changelog
## v3.5.0
- Chore: use `import` instead of `require` in entry file
## v3.4.0
- Chore: remove kraken driver, using web instead.
## v3.3.1
- Chore: remove `Object.assign`
- Chore: add @babel/helpers for project size
- Fix: require weex module is `undefined`
## v3.3.0
- Chore: reduce size by exports fields
### v3.2.0
- Support bytedance/baidu/kuaishou miniapp
### v3.1.7
- Bump version
### v3.1.6
- Use `style-unit` convert `rpx`
================================================
FILE: packages/driver-universal/README.md
================================================
# driver-universal
> Driver for Universal App.
Support both DOM(Web) and Weex, with normalized 750rpx support of screen width.
## Install
```bash
$ npm install --save driver-universal
```
## Use
```jsx
import { createElement, render } from 'rax';
import View from 'rax-view';
import Image from 'rax-image';
import DriverUniversal from 'driver-universal';
function Example() {
return (
<View>
<Image width="560" height="560" src="https://img.alicdn.com/tps/TB1z.55OFXXXXcLXXXXXXXXXXXX-560-560.jpg" />
</View>
);
}
render(<Example />, null, {
driver: DriverUniversal
});
```
## Driver `unit` difference
| driver | length value without unit | 'rpx' unit |
| ------ | ------------------------------ | --------------- |
| driver-dom | Append 'px' unit| Translate to 'vw' |
| driver-weex | Append weex 'px' unit | Translate to weex 'px' |
| driver-universal | Append 'rpx' | Translate to 'vw' in web, and translate to 'px' in weex |
================================================
FILE: packages/driver-universal/package.json
================================================
{
"name": "driver-universal",
"version": "3.5.0",
"description": "Driver for Universal App.",
"license": "BSD-3-Clause",
"main": "lib/index.js",
"module": "es/index.js",
"exports": {
".": {
"web": "./es/web.js",
"weex": "./es/weex.js",
"miniapp": "./es/miniapp.js",
"wechat-miniprogram": "./es/miniapp.js",
"bytedance-microapp": "./es/miniapp.js",
"baidu-smartprogram": "./es/miniapp.js",
"kuaishou-miniprogram": "./es/miniapp.js",
"default": "./es/index.js"
},
"./*": "./*"
},
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/alibaba/rax.git"
},
"bugs": {
"url": "https://github.com/alibaba/rax/issues"
},
"homepage": "https://github.com/alibaba/rax#readme",
"devDependencies": {
"rax": "^1.0.0"
},
"dependencies": {
"driver-dom": "^2.0.5",
"driver-miniapp": "^0.1.0",
"driver-weex": "^2.0.0",
"universal-env": "^3.0.0"
}
}
================================================
FILE: packages/driver-universal/src/__tests__/css-custom-properties.js
================================================
import { createElement, render } from 'rax';
import DriverDOM from '../';
describe('Support CSS custom properties', () => {
let container;
let logs;
const setProperty = CSSStyleDeclaration.prototype.setProperty;
beforeAll(() => {
CSSStyleDeclaration.prototype.setProperty = (prop, value) => {
logs.push([prop, value]);
};
});
afterAll(() => {
CSSStyleDeclaration.prototype.setProperty = setProperty;
});
beforeEach(() => {
container = document.createElement('div');
(document.body || document.documentElement).appendChild(container);
logs = [];
});
it('CSS custom properties works.', () => {
render((
<div style={{
'--backgroundColor': 'red',
backgroundColor: 'var(--backgroundColor)',
}}>
Test CSS custom properties.
</div>
), container, {
driver: DriverDOM
});
expect(logs).toEqual([['--backgroundColor', 'red']]);
});
});
================================================
FILE: packages/driver-universal/src/__tests__/dom-rpx-transformer.js
================================================
import { createElement, render } from 'rax';
import Driver from '../web';
describe('Transform rpx', () => {
const CLIENT_WIDTH = 750;
it('CSS custom properties works.', () => {
global.DEVICE_WIDTH = CLIENT_WIDTH;
const container = document.createElement('div');
render((
<div style={{
margin: '75rpx 100vh'
}} />
), container, {
driver: Driver,
});
expect(container.childNodes[0].style.margin).toEqual('10vw 100vh');
});
it('should automatically append `rpx` to relevant styles', () => {
const container = document.createElement('div');
render((
<div style={{
margin: 75
}} />
), container, {
driver: Driver,
});
expect(container.childNodes[0].style.margin).toEqual('10vw');
});
});
================================================
FILE: packages/driver-universal/src/index.d.ts
================================================
// Driver spec: https://github.com/alibaba/rax/blob/master/docs/en-US/driver-spec.md
declare namespace Driver {
function createBody(): void;
function createEmpty(component: any): void;
function createText(): void;
function updateText(node: any, text: any)
function createElement(type: any, props: any, component: any)
function appendChild(node: any, parent: any)
function removeChild(node: any, parent: any)
function replaceChild(newChild: any, oldChild: any, parent: any)
function insertAfter(node: any, after: any, parent: any)
function insertBefore(node: any, before: any, parent: any)
function addEventListener(node: any, eventName: any, eventHandler: any)
function removeEventListener(node: any, eventName: any, eventHandler: any)
function setAttribute(node: any, propKey: any, propValue: any)
function removeAttribute(node: any, propKey: any)
function setStyle(node: any, styleObject: any)
}
export default Driver;
================================================
FILE: packages/driver-universal/src/index.js
================================================
import {
isWeex,
isWeb,
isMiniApp,
isWeChatMiniProgram,
isByteDanceMicroApp,
isBaiduSmartProgram,
isKuaiShouMiniProgram
} from 'universal-env';
import driverWeex from './weex';
import driverWeb from './web';
import driverMiniApp from './miniapp';
let currentDriver;
if (isWeex) {
currentDriver = driverWeex;
} else if (isWeb) {
currentDriver = driverWeb;
} else if (isMiniApp || isWeChatMiniProgram || isByteDanceMicroApp || isBaiduSmartProgram || isKuaiShouMiniProgram) {
currentDriver = driverMiniApp;
}
export default currentDriver;
================================================
FILE: packages/driver-universal/src/miniapp.js
================================================
import MiniAppDriver from 'driver-miniapp';
export default MiniAppDriver;
================================================
FILE: packages/driver-universal/src/web.js
================================================
import * as DriverDOM from 'driver-dom';
export default {
...DriverDOM,
createElement(type, props, component) {
return DriverDOM.createElement(type, props, component, true);
},
setStyle(node, style) {
return DriverDOM.setStyle(node, style, true);
}
};
================================================
FILE: packages/driver-universal/src/weex.js
================================================
import * as WeexDriver from 'driver-weex';
export default WeexDriver;
================================================
FILE: packages/driver-webgl/README.md
================================================
# driver-webgl
> WebGL driver for Rax.
Components and APIs are based on `three.js` design and implementation. Use markup language and declarative writing to simplify development.
## Install
s
```bash
$ npm install --save driver-webgl
```
## Usage
```jsx
import {createElement, Component, render} from 'rax';
import WebGLDriver from 'driver-webgl';
class HelloWorld extends Component {
constructor(props, context) {
super(props, context);
this.state = {
cubeRotation: [0, 0, 0]
};
this.width = window.innerWidth;
this.height = window.innerHeight;
this.cameraPosition = [0, 0, 5];
}
onFrame = () => {
this.setState({
cubeRotation: [
this.state.cubeRotation[0] + 0.01,
this.state.cubeRotation[1] + 0.01,
0
]
});
}
render() {
return (
<scene
width={this.width}
height={this.height}
onFrame={this.onFrame}
>
<perspective-camera
fov={75}
aspect={this.width / this.height}
near={0.1}
far={1000}
position={this.cameraPosition}
/>
<mesh
rotation={this.state.cubeRotation}
>
<box-geometry
width={1}
height={1}
depth={1}
/>
<mesh-basic-material
color={0x00ff00}
/>
</mesh>
</scene>
);
}
}
render(<HelloWorld />, document.body, {
driver: WebGLDriver
});
```
## Built-in Tags
### Scenes
* scene
### Cameras
* perspective-camera
### Controls
* orbit-controls
* trackball-controls
### Core
* geometry
* buffer-geometry
* object-3d
* raycaster
### Geometries
* box-geometry
* cylinder-geometry
* sphere-geometry
### Lights
* ambient-light
* directional-light
### Materials
* line-basic-material
* line-dashed-material
* mesh-basic-material
* mesh-lambert-material
* mesh-phong-material
* points-material
### Objects
* line
* mesh
* points
================================================
FILE: packages/driver-webgl/package.json
================================================
{
"name": "driver-webgl",
"version": "1.0.0-beta.0",
"description": "WebGL driver for Rax.",
"license": "BSD-3-Clause",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/alibaba/rax.git"
},
"keywords": [
"Rax",
"rax-component",
"react-component",
"webgl",
"three"
],
"bugs": {
"url": "https://github.com/alibaba/rax/issues"
},
"homepage": "https://github.com/alibaba/rax#readme",
"dependencies": {
"three": "^0.85.0"
}
}
================================================
FILE: packages/driver-webgl/src/components/cameras/PerspectiveCamera.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {fov, aspect, near, far} = props;
const PerspectiveCamera = new THREE.PerspectiveCamera(fov, aspect, near, far);
PerspectiveCamera.updateProperty = this.updateProperty;
return PerspectiveCamera;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/controls/OrbitControls.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {camera} = props;
const OrbitControls = new THREE.OrbitControls(camera);
OrbitControls.updateProperty = this.updateProperty;
return OrbitControls;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/controls/TrackballControls.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {camera} = props;
const TrackballControls = new THREE.TrackballControls(camera);
TrackballControls.updateProperty = this.updateProperty;
return TrackballControls;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/core/BufferGeometry.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const BufferGeometry = new THREE.BufferGeometry();
BufferGeometry.updateProperty = this.updateProperty;
Object.keys(props).forEach((key) => {
const item = props[key];
const {array, itemSize, normalized} = item;
const bufferAttribute = new THREE.BufferAttribute(array, itemSize, normalized);
BufferGeometry.addAttribute(key, bufferAttribute);
});
BufferGeometry.computeBoundingSphere();
return BufferGeometry;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/core/Geometry.js
================================================
import * as THREE from 'three';
export default {
init() {
const Geometry = new THREE.Geometry();
Geometry.updateProperty = this.updateProperty;
return Geometry;
},
updateProperty(key, value) {
if (key === 'vertices') {
this.vertices = value.map((vertex) => new THREE.Vector3(vertex[0], vertex[1], vertex[2]));
return;
}
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/core/Object3D.js
================================================
import * as THREE from 'three';
export default {
init() {
const Object3D = new THREE.Object3D();
Object3D.updateProperty = this.updateProperty;
return Object3D;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/core/Raycaster.js
================================================
import * as THREE from 'three';
let camera = null;
export default {
init(props) {
const {origin, direction, near, far} = props;
const Raycaster = new THREE.Raycaster(origin, direction, near, far);
Raycaster.updateProperty = this.updateProperty;
camera = props.camera;
return Raycaster;
},
updateProperty(key, value) {
if (key === 'camera') {
camera = value;
}
if (key === 'coords') {
this.setFromCamera(value, camera);
}
}
};
================================================
FILE: packages/driver-webgl/src/components/geometries/BoxGeometry.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {width, height, depth, widthSegments, heightSegments, depthSegments} = props;
const BoxGeometry = new THREE.BoxGeometry(
width,
height,
depth,
widthSegments,
heightSegments,
depthSegments
);
BoxGeometry.updateProperty = this.updateProperty;
return BoxGeometry;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/geometries/CylinderGeometry.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {
radiusTop,
radiusBottom,
height,
radialSegments,
heightSegments,
openEnded,
thetaStart,
thetaLength
} = props;
const CylinderGeometry = new THREE.CylinderGeometry(
radiusTop,
radiusBottom,
height,
radialSegments,
heightSegments,
openEnded,
thetaStart,
thetaLength
);
CylinderGeometry.updateProperty = this.updateProperty;
return CylinderGeometry;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/geometries/SphereGeometry.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength} = props;
const SphereGeometry = new THREE.SphereGeometry(
radius,
widthSegments,
heightSegments,
phiStart,
phiLength,
thetaStart,
thetaLength
);
SphereGeometry.updateProperty = this.updateProperty;
return SphereGeometry;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/index.js
================================================
import PerspectiveCamera from './cameras/PerspectiveCamera';
import OrbitControls from './controls/OrbitControls';
import TrackballControls from './controls/TrackballControls';
import BufferGeometry from './core/BufferGeometry';
import Geometry from './core/Geometry';
import Object3D from './core/Object3D';
import Raycaster from './core/Raycaster';
import BoxGeometry from './geometries/BoxGeometry';
import CylinderGeometry from './geometries/CylinderGeometry';
import SphereGeometry from './geometries/SphereGeometry';
import AmbientLight from './lights/AmbientLight';
import DirectionalLight from './lights/DirectionalLight';
import LineBasicMaterial from './materials/LineBasicMaterial';
import LineDashedMaterial from './materials/LineDashedMaterial';
import MeshBasicMaterial from './materials/MeshBasicMaterial';
import MeshLambertMaterial from './materials/MeshLambertMaterial';
import MeshPhongMaterial from './materials/MeshPhongMaterial';
import PointsMaterial from './materials/PointsMaterial';
import Line from './objects/Line';
import Mesh from './objects/Mesh';
import Points from './objects/Points';
import Scene from './scenes/Scene';
export default {
'perspective-camera': PerspectiveCamera,
'orbit-controls': OrbitControls,
'trackball-controls': TrackballControls,
'buffer-geometry': BufferGeometry,
'geometry': Geometry,
'object-3d': Object3D,
'raycaster': Raycaster,
'box-geometry': BoxGeometry,
'cylinder-geometry': CylinderGeometry,
'sphere-geometry': SphereGeometry,
'ambient-light': AmbientLight,
'directional-light': DirectionalLight,
'line-basic-material': LineBasicMaterial,
'line-dashed-material': LineDashedMaterial,
'mesh-basic-material': MeshBasicMaterial,
'mesh-lambert-material': MeshLambertMaterial,
'mesh-phong-material': MeshPhongMaterial,
'points-material': PointsMaterial,
'line': Line,
'mesh': Mesh,
'points': Points,
'scene': Scene
};
================================================
FILE: packages/driver-webgl/src/components/lights/AmbientLight.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {color, intensity} = props;
const AmbientLight = new THREE.AmbientLight(color, intensity);
AmbientLight.updateProperty = this.updateProperty;
return AmbientLight;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
},
};
================================================
FILE: packages/driver-webgl/src/components/lights/DirectionalLight.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {color, intensity} = props;
const DirectionalLight = new THREE.DirectionalLight(color, intensity);
DirectionalLight.updateProperty = this.updateProperty;
return DirectionalLight;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/materials/LineBasicMaterial.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const LineBasicMaterial = new THREE.LineBasicMaterial(props);
LineBasicMaterial.updateProperty = this.updateProperty;
return LineBasicMaterial;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/materials/LineDashedMaterial.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const LineDashedMateria = new THREE.LineDashedMateria(props);
LineDashedMateria.updateProperty = this.updateProperty;
return LineDashedMateria;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/materials/MeshBasicMaterial.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const MeshBasicMaterial = new THREE.MeshBasicMaterial(props);
MeshBasicMaterial.updateProperty = this.updateProperty;
return MeshBasicMaterial;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/materials/MeshLambertMaterial.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const MeshLambertMaterial = new THREE.MeshLambertMaterial(props);
MeshLambertMaterial.updateProperty = this.updateProperty;
return MeshLambertMaterial;
},
updateProperty(key, value) {
if (key === 'map') {
const map = new THREE.TextureLoader().load(value.src);
this.map = map;
return;
}
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/materials/MeshPhongMaterial.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const MeshPhongMaterial = new THREE.MeshPhongMaterial(props);
MeshPhongMaterial.updateProperty = this.updateProperty;
return MeshPhongMaterial;
},
updateProperty(key, value) {
if (key === 'map') {
const map = new THREE.TextureLoader().load(value.src);
this.map = map;
return;
}
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/materials/PointsMaterial.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const PointsMaterial = new THREE.PointsMaterial(props);
PointsMaterial.updateProperty = this.updateProperty;
return PointsMaterial;
},
updateProperty(key, value) {
if (key === 'map') {
const map = new THREE.TextureLoader().load(value.src);
this.map = map;
return;
}
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/objects/Line.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {geometry, material} = props;
const Line = new THREE.Line(geometry, material);
Line.updateProperty = this.updateProperty;
return Line;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/objects/Mesh.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {geometry, material} = props;
const Mesh = new THREE.Mesh(geometry, material);
Mesh.updateProperty = this.updateProperty;
return Mesh;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/objects/Points.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {geometry, material} = props;
const Point = new THREE.Points(geometry, material);
Point.updateProperty = this.updateProperty;
return Point;
},
updateProperty(key, value) {
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/components/scenes/Scene.js
================================================
import * as THREE from 'three';
export default {
init(props) {
const {
background = null,
fog = null,
overrideMaterial = null,
autoUpdate = true,
onFrame = () => {}
} = props;
const Scene = new THREE.Scene();
if (fog !== null) {
if (Object.hasOwnProperty.call(fog, 'density')) {
Scene.fog = new THREE.FogExp2(fog.color, fog.density);
} else {
Scene.fog = new THREE.Fog(fog.color, fog.near, fog.far);
}
}
Scene.background = background;
Scene.overrideMaterial = overrideMaterial;
Scene.autoUpdate = autoUpdate;
Scene.onFrame = onFrame;
Scene.updateProperty = this.updateProperty;
return Scene;
},
updateProperty(key, value) {
if (key === 'fog') {
if (Object.hasOwnProperty.call(value, 'density')) {
this.fog = new THREE.FogExp2(value.color, value.density);
} else {
this.fog = new THREE.Fog(value.color, value.near, value.far);
}
return;
}
if (Object.hasOwnProperty.call(this, key)) {
if (this[key] && this[key].set) {
return this[key].set.apply(this[key], Object.values(value));
}
this[key] = value;
return;
}
}
};
================================================
FILE: packages/driver-webgl/src/driver.js
================================================
import * as THREE from 'three';
import ThreeComponent from './components';
const CHILDREN = 'children';
const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
const ID = 'uuid';
const nodeMaps = {};
let renderer = null;
let scene = null;
let camera = null;
function createElement(type, props) {
return ThreeComponent[type].init(props);
}
const Driver = {
getElementById(id) {
return nodeMaps[id];
},
createBody() {
if (document.getElementsByTagName('canvas').length !== 0) {
return document.getElementsByName('canvas').shift();
}
renderer = new THREE.WebGLRenderer();
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
return renderer;
},
createEmpty() {
return createElement({
type: 'object-3d'
});
},
createElement(type, props) {
let node = createElement(type, props);
this.setNativeProps(node, props);
return node;
},
appendChild(node, parent) {
if (node.type === 'Scene') {
node.renderer = renderer;
scene = node;
return;
}
if (node.isCamera) {
camera = node;
return;
}
if (parent.type === 'Scene' && node.isObject3D) {
parent.add(node);
} else {
if (parent.isObject3D) {
if (node.isGeometry || node.isBufferGeometry) parent.geometry = node;
if (node.isMaterial) parent.material = node;
}
}
return renderer.render(scene, camera);
},
removeChild(node, parent) {
parent = parent || node.parent;
let id = node[ID];
if (id != null) {
nodeMaps[id] = null;
}
return parent.remove(node);
},
replaceChild(newChild, oldChild, parent) {
parent = parent || oldChild.parent;
this.removeChild(oldChild, parent);
this.appendChild(newChild, parent);
},
addEventListener(node, eventName, eventHandler) {
if (node.type === 'Scene') {
return document.body.addEventListener(eventName, eventHandler);
}
return node;
},
removeEventListener(node, eventName, eventHandler) {
if (node.type === 'Scene') {
return document.body.removeEventListener(eventName, eventHandler);
}
return node;
},
removeAttribute(node, propKey, propValue) {
// Noop
},
setAttribute(node, propKey, propValue) {
if (propKey == ID) {
nodeMaps[propValue] = node;
}
node.updateProperty(propKey, propValue);
return node;
},
afterRender() {
render();
},
setNativeProps(node, props) {
for (let prop in props) {
let value = props[prop];
if (prop === CHILDREN) {
continue;
}
if (value != null) {
if (EVENT_PREFIX_REGEXP.test(prop)) {
let eventName = prop.slice(2).toLowerCase();
this.addEventListener(node, eventName, value);
} else {
this.setAttribute(node, prop, value);
}
}
}
}
};
const render = () => {
window.requestAnimationFrame(render);
renderer.render(scene, camera);
scene.onFrame();
};
export default Driver;
================================================
FILE: packages/driver-webgl/src/index.js
================================================
import * as THREE from 'three';
import TrackballControls from './plugin/controls/TrackballControls';
import OrbitControls from './plugin/controls/OrbitControls';
import Driver from './driver';
export default Driver;
export {
THREE
};
================================================
FILE: packages/driver-webgl/src/plugin/controls/OrbitControls.js
================================================
import * as THREE from 'three';
/**
* @author qiao / https://github.com/qiao
* @author mrdoob / http://mrdoob.com
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author erich666 / http://erichaines.com
*/
// This set of controls performs orbiting, dollying (zooming), and panning.
// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
//
// Orbit - left mouse / touch: one finger move
// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
// Pan - right mouse, or arrow keys / touch: three finger swipe
THREE.OrbitControls = function( object, domElement ) {
this.object = object;
this.domElement = domElement !== undefined ? domElement : document;
// Set to false to disable this control
this.enabled = true;
// "target" sets the location of focus, where the object orbits around
this.target = new THREE.Vector3();
// How far you can dolly in and out ( PerspectiveCamera only )
this.minDistance = 0;
this.maxDistance = Infinity;
// How far you can zoom in and out ( OrthographicCamera only )
this.minZoom = 0;
this.maxZoom = Infinity;
// How far you can orbit vertically, upper and lower limits.
// Range is 0 to Math.PI radians.
this.minPolarAngle = 0; // radians
this.maxPolarAngle = Math.PI; // radians
// How far you can orbit horizontally, upper and lower limits.
// If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].
this.minAzimuthAngle = - Infinity; // radians
this.maxAzimuthAngle = Infinity; // radians
// Set to true to enable damping (inertia)
// If damping is enabled, you must call controls.update() in your animation loop
this.enableDamping = false;
this.dampingFactor = 0.25;
// This option actually enables dollying in and out; left as "zoom" for backwards compatibility.
// Set to false to disable zooming
this.enableZoom = true;
this.zoomSpeed = 1.0;
// Set to false to disable rotating
this.enableRotate = true;
this.rotateSpeed = 1.0;
// Set to false to disable panning
this.enablePan = true;
this.keyPanSpeed = 7.0; // pixels moved per arrow key push
// Set to true to automatically rotate around the target
// If auto-rotate is enabled, you must call controls.update() in your animation loop
this.autoRotate = false;
this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60
// Set to false to disable use of the keys
this.enableKeys = true;
// The four arrow keys
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };
// Mouse buttons
this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };
// for reset
this.target0 = this.target.clone();
this.position0 = this.object.position.clone();
this.zoom0 = this.object.zoom;
//
// public methods
//
this.getPolarAngle = function() {
return spherical.phi;
};
this.getAzimuthalAngle = function() {
return spherical.theta;
};
this.saveState = function() {
scope.target0.copy( scope.target );
scope.position0.copy( scope.object.position );
scope.zoom0 = scope.object.zoom;
};
this.reset = function() {
scope.target.copy( scope.target0 );
scope.object.position.copy( scope.position0 );
scope.object.zoom = scope.zoom0;
scope.object.updateProjectionMatrix();
scope.dispatchEvent( changeEvent );
scope.update();
state = STATE.NONE;
};
// this method is exposed, but perhaps it would be better if we can make it private...
this.update = function() {
var offset = new THREE.Vector3();
// so camera.up is the orbit axis
var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );
var quatInverse = quat.clone().inverse();
var lastPosition = new THREE.Vector3();
var lastQuaternion = new THREE.Quaternion();
return function update() {
var position = scope.object.position;
offset.copy( position ).sub( scope.target );
// rotate offset to "y-axis-is-up" space
offset.applyQuaternion( quat );
// angle from z-axis around y-axis
spherical.setFromVector3( offset );
if ( scope.autoRotate && state === STATE.NONE ) {
rotateLeft( getAutoRotationAngle() );
}
spherical.theta += sphericalDelta.theta;
spherical.phi += sphericalDelta.phi;
// restrict theta to be between desired limits
spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) );
// restrict phi to be between desired limits
spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) );
spherical.makeSafe();
spherical.radius *= scale;
// restrict radius to be between desired limits
spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );
// move target to panned location
scope.target.add( panOffset );
offset.setFromSpherical( spherical );
// rotate offset back to "camera-up-vector-is-up" space
offset.applyQuaternion( quatInverse );
position.copy( scope.target ).add( offset );
scope.object.lookAt( scope.target );
if ( scope.enableDamping === true ) {
sphericalDelta.theta *= 1 - scope.dampingFactor;
sphericalDelta.phi *= 1 - scope.dampingFactor;
} else {
sphericalDelta.set( 0, 0, 0 );
}
scale = 1;
panOffset.set( 0, 0, 0 );
// update condition is:
// min(camera displacement, camera rotation in radians)^2 > EPS
// using small-angle approximation cos(x/2) = 1 - x^2 / 8
if ( zoomChanged ||
lastPosition.distanceToSquared( scope.object.position ) > EPS ||
8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) {
scope.dispatchEvent( changeEvent );
lastPosition.copy( scope.object.position );
lastQuaternion.copy( scope.object.quaternion );
zoomChanged = false;
return true;
}
return false;
};
}();
this.dispose = function() {
scope.domElement.removeEventListener( 'contextmenu', onContextMenu, false );
scope.domElement.removeEventListener( 'mousedown', onMouseDown, false );
scope.domElement.removeEventListener( 'wheel', onMouseWheel, false );
scope.domElement.removeEventListener( 'touchstart', onTouchStart, false );
scope.domElement.removeEventListener( 'touchend', onTouchEnd, false );
scope.domElement.removeEventListener( 'touchmove', onTouchMove, false );
document.removeEventListener( 'mousemove', onMouseMove, false );
document.removeEventListener( 'mouseup', onMouseUp, false );
window.removeEventListener( 'keydown', onKeyDown, false );
// scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
};
//
// internals
//
var scope = this;
var changeEvent = { type: 'change' };
var startEvent = { type: 'start' };
var endEvent = { type: 'end' };
var STATE = { NONE: - 1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY: 4, TOUCH_PAN: 5 };
var state = STATE.NONE;
var EPS = 0.000001;
// current position in spherical coordinates
var spherical = new THREE.Spherical();
var sphericalDelta = new THREE.Spherical();
var scale = 1;
var panOffset = new THREE.Vector3();
var zoomChanged = false;
var rotateStart = new THREE.Vector2();
var rotateEnd = new THREE.Vector2();
var rotateDelta = new THREE.Vector2();
var panStart = new THREE.Vector2();
var panEnd = new THREE.Vector2();
var panDelta = new THREE.Vector2();
var dollyStart = new THREE.Vector2();
var dollyEnd = new THREE.Vector2();
var dollyDelta = new THREE.Vector2();
function getAutoRotationAngle() {
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
}
function getZoomScale() {
return Math.pow( 0.95, scope.zoomSpeed );
}
function rotateLeft( angle ) {
sphericalDelta.theta -= angle;
}
function rotateUp( angle ) {
sphericalDelta.phi -= angle;
}
var panLeft = function() {
var v = new THREE.Vector3();
return function panLeft( distance, objectMatrix ) {
v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix
v.multiplyScalar( - distance );
panOffset.add( v );
};
}();
var panUp = function() {
var v = new THREE.Vector3();
return function panUp( distance, objectMatrix ) {
v.setFromMatrixColumn( objectMatrix, 1 ); // get Y column of objectMatrix
v.multiplyScalar( distance );
panOffset.add( v );
};
}();
// deltaX and deltaY are in pixels; right and down are positive
var pan = function() {
var offset = new THREE.Vector3();
return function pan( deltaX, deltaY ) {
var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
if ( scope.object instanceof THREE.PerspectiveCamera ) {
// perspective
var position = scope.object.position;
offset.copy( position ).sub( scope.target );
var targetDistance = offset.length();
// half of the fov is center to top of screen
targetDistance *= Math.tan( scope.object.fov / 2 * Math.PI / 180.0 );
// we actually don't use screenWidth, since perspective camera is fixed to screen height
panLeft( 2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix );
panUp( 2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix );
} else if ( scope.object instanceof THREE.OrthographicCamera ) {
// orthographic
panLeft( deltaX * ( scope.object.right - scope.object.left ) / scope.object.zoom / element.clientWidth, scope.object.matrix );
panUp( deltaY * ( scope.object.top - scope.object.bottom ) / scope.object.zoom / element.clientHeight, scope.object.matrix );
} else {
// camera neither orthographic nor perspective
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );
scope.enablePan = false;
}
};
}();
function dollyIn( dollyScale ) {
if ( scope.object instanceof THREE.PerspectiveCamera ) {
scale /= dollyScale;
} else if ( scope.object instanceof THREE.OrthographicCamera ) {
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) );
scope.object.updateProjectionMatrix();
zoomChanged = true;
} else {
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
scope.enableZoom = false;
}
}
function dollyOut( dollyScale ) {
if ( scope.object instanceof THREE.PerspectiveCamera ) {
scale *= dollyScale;
} else if ( scope.object instanceof THREE.OrthographicCamera ) {
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) );
scope.object.updateProjectionMatrix();
zoomChanged = true;
} else {
console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
scope.enableZoom = false;
}
}
//
// event callbacks - update the object state
//
function handleMouseDownRotate( event ) {
// console.log( 'handleMouseDownRotate' );
rotateStart.set( event.clientX, event.clientY );
}
function handleMouseDownDolly( event ) {
// console.log( 'handleMouseDownDolly' );
dollyStart.set( event.clientX, event.clientY );
}
function handleMouseDownPan( event ) {
// console.log( 'handleMouseDownPan' );
panStart.set( event.clientX, event.clientY );
}
function handleMouseMoveRotate( event ) {
// console.log( 'handleMouseMoveRotate' );
rotateEnd.set( event.clientX, event.clientY );
rotateDelta.subVectors( rotateEnd, rotateStart );
var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
// rotating across whole screen goes 360 degrees around
rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );
// rotating up and down along whole screen attempts to go 360, but limited to 180
rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );
rotateStart.copy( rotateEnd );
scope.update();
}
function handleMouseMoveDolly( event ) {
// console.log( 'handleMouseMoveDolly' );
dollyEnd.set( event.clientX, event.clientY );
dollyDelta.subVectors( dollyEnd, dollyStart );
if ( dollyDelta.y > 0 ) {
dollyIn( getZoomScale() );
} else if ( dollyDelta.y < 0 ) {
dollyOut( getZoomScale() );
}
dollyStart.copy( dollyEnd );
scope.update();
}
function handleMouseMovePan( event ) {
// console.log( 'handleMouseMovePan' );
panEnd.set( event.clientX, event.clientY );
panDelta.subVectors( panEnd, panStart );
pan( panDelta.x, panDelta.y );
panStart.copy( panEnd );
scope.update();
}
function handleMouseUp( event ) {
// console.log( 'handleMouseUp' );
}
function handleMouseWheel( event ) {
// console.log( 'handleMouseWheel' );
if ( event.deltaY < 0 ) {
dollyOut( getZoomScale() );
} else if ( event.deltaY > 0 ) {
dollyIn( getZoomScale() );
}
scope.update();
}
function handleKeyDown( event ) {
// console.log( 'handleKeyDown' );
switch ( event.keyCode ) {
case scope.keys.UP:
pan( 0, scope.keyPanSpeed );
scope.update();
break;
case scope.keys.BOTTOM:
pan( 0, - scope.keyPanSpeed );
scope.update();
break;
case scope.keys.LEFT:
pan( scope.keyPanSpeed, 0 );
scope.update();
break;
case scope.keys.RIGHT:
pan( - scope.keyPanSpeed, 0 );
scope.update();
break;
}
}
function handleTouchStartRotate( event ) {
// console.log( 'handleTouchStartRotate' );
rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
}
function handleTouchStartDolly( event ) {
// console.log( 'handleTouchStartDolly' );
var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
var distance = Math.sqrt( dx * dx + dy * dy );
dollyStart.set( 0, distance );
}
function handleTouchStartPan( event ) {
// console.log( 'handleTouchStartPan' );
panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
}
function handleTouchMoveRotate( event ) {
// console.log( 'handleTouchMoveRotate' );
rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
rotateDelta.subVectors( rotateEnd, rotateStart );
var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
// rotating across whole screen goes 360 degrees around
rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );
// rotating up and down along whole screen attempts to go 360, but limited to 180
rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );
rotateStart.copy( rotateEnd );
scope.update();
}
function handleTouchMoveDolly( event ) {
// console.log( 'handleTouchMoveDolly' );
var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
var distance = Math.sqrt( dx * dx + dy * dy );
dollyEnd.set( 0, distance );
dollyDelta.subVectors( dollyEnd, dollyStart );
if ( dollyDelta.y > 0 ) {
dollyOut( getZoomScale() );
} else if ( dollyDelta.y < 0 ) {
dollyIn( getZoomScale() );
}
dollyStart.copy( dollyEnd );
scope.update();
}
function handleTouchMovePan( event ) {
// console.log( 'handleTouchMovePan' );
panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
panDelta.subVectors( panEnd, panStart );
pan( panDelta.x, panDelta.y );
panStart.copy( panEnd );
scope.update();
}
function handleTouchEnd( event ) {
// console.log( 'handleTouchEnd' );
}
//
// event handlers - FSM: listen for events and reset state
//
function onMouseDown( event ) {
if ( scope.enabled === false ) return;
event.preventDefault();
switch ( event.button ) {
case scope.mouseButtons.ORBIT:
if ( scope.enableRotate === false ) return;
handleMouseDownRotate( event );
state = STATE.ROTATE;
break;
case scope.mouseButtons.ZOOM:
if ( scope.enableZoom === false ) return;
handleMouseDownDolly( event );
state = STATE.DOLLY;
break;
case scope.mouseButtons.PAN:
if ( scope.enablePan === false ) return;
handleMouseDownPan( event );
state = STATE.PAN;
break;
}
if ( state !== STATE.NONE ) {
document.addEventListener( 'mousemove', onMouseMove, false );
document.addEventListener( 'mouseup', onMouseUp, false );
scope.dispatchEvent( startEvent );
}
}
function onMouseMove( event ) {
if ( scope.enabled === false ) return;
event.preventDefault();
switch ( state ) {
case STATE.ROTATE:
if ( scope.enableRotate === false ) return;
handleMouseMoveRotate( event );
break;
case STATE.DOLLY:
if ( scope.enableZoom === false ) return;
handleMouseMoveDolly( event );
break;
case STATE.PAN:
if ( scope.enablePan === false ) return;
handleMouseMovePan( event );
break;
}
}
function onMouseUp( event ) {
if ( scope.enabled === false ) return;
handleMouseUp( event );
document.removeEventListener( 'mousemove', onMouseMove, false );
document.removeEventListener( 'mouseup', onMouseUp, false );
scope.dispatchEvent( endEvent );
state = STATE.NONE;
}
function onMouseWheel( event ) {
if ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE && state !== STATE.ROTATE ) return;
event.preventDefault();
event.stopPropagation();
handleMouseWheel( event );
scope.dispatchEvent( startEvent ); // not sure why these are here...
scope.dispatchEvent( endEvent );
}
function onKeyDown( event ) {
if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;
handleKeyDown( event );
}
function onTouchStart( event ) {
if ( scope.enabled === false ) return;
switch ( event.touches.length ) {
case 1: // one-fingered touch: rotate
if ( scope.enableRotate === false ) return;
handleTouchStartRotate( event );
state = STATE.TOUCH_ROTATE;
break;
case 2: // two-fingered touch: dolly
if ( scope.enableZoom === false ) return;
handleTouchStartDolly( event );
state = STATE.TOUCH_DOLLY;
break;
case 3: // three-fingered touch: pan
if ( scope.enablePan === false ) return;
handleTouchStartPan( event );
state = STATE.TOUCH_PAN;
break;
default:
state = STATE.NONE;
}
if ( state !== STATE.NONE ) {
scope.dispatchEvent( startEvent );
}
}
function onTouchMove( event ) {
if ( scope.enabled === false ) return;
event.preventDefault();
event.stopPropagation();
switch ( event.touches.length ) {
case 1: // one-fingered touch: rotate
if ( scope.enableRotate === false ) return;
if ( state !== STATE.TOUCH_ROTATE ) return; // is this needed?...
handleTouchMoveRotate( event );
break;
case 2: // two-fingered touch: dolly
if ( scope.enableZoom === false ) return;
if ( state !== STATE.TOUCH_DOLLY ) return; // is this needed?...
handleTouchMoveDolly( event );
break;
case 3: // three-fingered touch: pan
if ( scope.enablePan === false ) return;
if ( state !== STATE.TOUCH_PAN ) return; // is this needed?...
handleTouchMovePan( event );
break;
default:
state = STATE.NONE;
}
}
function onTouchEnd( event ) {
if ( scope.enabled === false ) return;
handleTouchEnd( event );
scope.dispatchEvent( endEvent );
state = STATE.NONE;
}
function onContextMenu( event ) {
event.preventDefault();
}
//
scope.domElement.addEventListener( 'contextmenu', onContextMenu, false );
scope.domElement.addEventListener( 'mousedown', onMouseDown, false );
scope.domElement.addEventListener( 'wheel', onMouseWheel, false );
scope.domElement.addEventListener( 'touchstart', onTouchStart, false );
scope.domElement.addEventListener( 'touchend', onTouchEnd, false );
scope.domElement.addEventListener( 'touchmove', onTouchMove, false );
window.addEventListener( 'keydown', onKeyDown, false );
// force an update at start
this.update();
};
THREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );
THREE.OrbitControls.prototype.constructor = THREE.OrbitControls;
Object.defineProperties( THREE.OrbitControls.prototype, {
center: {
get: function() {
console.warn( 'THREE.OrbitControls: .center has been renamed to .target' );
return this.target;
}
},
// backward compatibility
noZoom: {
get: function() {
console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );
return ! this.enableZoom;
},
set: function( value ) {
console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );
this.enableZoom = ! value;
}
},
noRotate: {
get: function() {
console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );
return ! this.enableRotate;
},
set: function( value ) {
console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );
this.enableRotate = ! value;
}
},
noPan: {
get: function() {
console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );
return ! this.enablePan;
},
set: function( value ) {
console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );
this.enablePan = ! value;
}
},
noKeys: {
get: function() {
console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );
return ! this.enableKeys;
},
set: function( value ) {
console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );
this.enableKeys = ! value;
}
},
staticMoving: {
get: function() {
console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );
return ! this.enableDamping;
},
set: function( value ) {
console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );
this.enableDamping = ! value;
}
},
dynamicDampingFactor: {
get: function() {
console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );
return this.dampingFactor;
},
set: function( value ) {
console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );
this.dampingFactor = value;
}
}
} );
================================================
FILE: packages/driver-webgl/src/plugin/controls/TrackballControls.js
================================================
import * as THREE from 'three';
/**
* @author Eberhard Graether / http://egraether.com/
* @author Mark Lundin / http://mark-lundin.com
* @author Simone Manini / http://daron1337.github.io
* @author Luca Antiga / http://lantiga.github.io
*/
THREE.TrackballControls = function( object, domElement ) {
var _this = this;
var STATE = { NONE: - 1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 };
this.object = object;
this.domElement = domElement !== undefined ? domElement : document;
// API
this.enabled = true;
this.screen = { left: 0, top: 0, width: 0, height: 0 };
this.rotateSpeed = 1.0;
this.zoomSpeed = 1.2;
this.panSpeed = 0.3;
this.noRotate = false;
this.noZoom = false;
this.noPan = false;
this.staticMoving = false;
this.dynamicDampingFactor = 0.2;
this.minDistance = 0;
this.maxDistance = Infinity;
this.keys = [ 65 /* A */, 83 /* S */, 68 /* D */ ];
// internals
this.target = new THREE.Vector3();
var EPS = 0.000001;
var lastPosition = new THREE.Vector3();
var _state = STATE.NONE,
_prevState = STATE.NONE,
_eye = new THREE.Vector3(),
_movePrev = new THREE.Vector2(),
_moveCurr = new THREE.Vector2(),
_lastAxis = new THREE.Vector3(),
_lastAngle = 0,
_zoomStart = new THREE.Vector2(),
_zoomEnd = new THREE.Vector2(),
_touchZoomDistanceStart = 0,
_touchZoomDistanceEnd = 0,
_panStart = new THREE.Vector2(),
_panEnd = new THREE.Vector2();
// for reset
this.target0 = this.target.clone();
this.position0 = this.object.position.clone();
this.up0 = this.object.up.clone();
// events
var changeEvent = { type: 'change' };
var startEvent = { type: 'start' };
var endEvent = { type: 'end' };
// methods
this.handleResize = function() {
if ( this.domElement === document ) {
this.screen.left = 0;
this.screen.top = 0;
this.screen.width = window.innerWidth;
this.screen.height = window.innerHeight;
} else {
var box = this.domElement.getBoundingClientRect();
// adjustments come from similar code in the jquery offset() function
var d = this.domElement.ownerDocument.documentElement;
this.screen.left = box.left + window.pageXOffset - d.clientLeft;
this.screen.top = box.top + window.pageYOffset - d.clientTop;
this.screen.width = box.width;
this.screen.height = box.height;
}
};
this.handleEvent = function( event ) {
if ( typeof this[ event.type ] == 'function' ) {
this[ event.type ]( event );
}
};
var getMouseOnScreen = ( function() {
var vector = new THREE.Vector2();
return function getMouseOnScreen( pageX, pageY ) {
vector.set(
( pageX - _this.screen.left ) / _this.screen.width,
( pageY - _this.screen.top ) / _this.screen.height
);
return vector;
};
}() );
var getMouseOnCircle = ( function() {
var vector = new THREE.Vector2();
return function getMouseOnCircle( pageX, pageY ) {
vector.set(
( pageX - _this.screen.width * 0.5 - _this.screen.left ) / ( _this.screen.width * 0.5 ),
( _this.screen.height + 2 * ( _this.screen.top - pageY ) ) / _this.screen.width // screen.width intentional
);
return vector;
};
}() );
this.rotateCamera = ( function() {
var axis = new THREE.Vector3(),
quaternion = new THREE.Quaternion(),
eyeDirection = new THREE.Vector3(),
objectUpDirection = new THREE.Vector3(),
objectSidewaysDirection = new THREE.Vector3(),
moveDirection = new THREE.Vector3(),
angle;
return function rotateCamera() {
moveDirection.set( _moveCurr.x - _movePrev.x, _moveCurr.y - _movePrev.y, 0 );
angle = moveDirection.length();
if ( angle ) {
_eye.copy( _this.object.position ).sub( _this.target );
eyeDirection.copy( _eye ).normalize();
objectUpDirection.copy( _this.object.up ).normalize();
objectSidewaysDirection.crossVectors( objectUpDirection, eyeDirection ).normalize();
objectUpDirection.setLength( _moveCurr.y - _movePrev.y );
objectSidewaysDirection.setLength( _moveCurr.x - _movePrev.x );
moveDirection.copy( objectUpDirection.add( objectSidewaysDirection ) );
axis.crossVectors( moveDirection, _eye ).normalize();
angle *= _this.rotateSpeed;
quaternion.setFromAxisAngle( axis, angle );
_eye.applyQuaternion( quaternion );
_this.object.up.applyQuaternion( quaternion );
_lastAxis.copy( axis );
_lastAngle = angle;
} else if ( ! _this.staticMoving && _lastAngle ) {
_lastAngle *= Math.sqrt( 1.0 - _this.dynamicDampingFactor );
_eye.copy( _this.object.position ).sub( _this.target );
quaternion.setFromAxisAngle( _lastAxis, _lastAngle );
_eye.applyQuaternion( quaternion );
_this.object.up.applyQuaternion( quaternion );
}
_movePrev.copy( _moveCurr );
};
}() );
this.zoomCamera = function() {
var factor;
if ( _state === STATE.TOUCH_ZOOM_PAN ) {
factor = _touchZoomDistanceStart / _touchZoomDistanceEnd;
_touchZoomDistanceStart = _touchZoomDistanceEnd;
_eye.multiplyScalar( factor );
} else {
factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed;
if ( factor !== 1.0 && factor > 0.0 ) {
_eye.multiplyScalar( factor );
}
if ( _this.staticMoving ) {
_zoomStart.copy( _zoomEnd );
} else {
_zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor;
}
}
};
this.panCamera = ( function() {
var mouseChange = new THREE.Vector2(),
objectUp = new THREE.Vector3(),
pan = new THREE.Vector3();
return function panCamera() {
mouseChange.copy( _panEnd ).sub( _panStart );
if ( mouseChange.lengthSq() ) {
mouseChange.multiplyScalar( _eye.length() * _this.panSpeed );
pan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x );
pan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) );
_this.object.position.add( pan );
_this.target.add( pan );
if ( _this.staticMoving ) {
_panStart.copy( _panEnd );
} else {
_panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );
}
}
};
}() );
this.checkDistances = function() {
if ( ! _this.noZoom || ! _this.noPan ) {
if ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) {
_this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) );
_zoomStart.copy( _zoomEnd );
}
if ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) {
_this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) );
_zoomStart.copy( _zoomEnd );
}
}
};
this.update = function() {
_eye.subVectors( _this.object.position, _this.target );
if ( ! _this.noRotate ) {
_this.rotateCamera();
}
if ( ! _this.noZoom ) {
_this.zoomCamera();
}
if ( ! _this.noPan ) {
_this.panCamera();
}
_this.object.position.addVectors( _this.target, _eye );
_this.checkDistances();
_this.object.lookAt( _this.target );
if ( lastPosition.distanceToSquared( _this.object.position ) > EPS ) {
_this.dispatchEvent( changeEvent );
lastPosition.copy( _this.object.position );
}
};
this.reset = function() {
_state = STATE.NONE;
_prevState = STATE.NONE;
_this.target.copy( _this.target0 );
_this.object.position.copy( _this.position0 );
_this.object.up.copy( _this.up0 );
_eye.subVectors( _this.object.position, _this.target );
_this.object.lookAt( _this.target );
_this.dispatchEvent( changeEvent );
lastPosition.copy( _this.object.position );
};
// listeners
function keydown( event ) {
if ( _this.enabled === false ) return;
window.removeEventListener( 'keydown', keydown );
_prevState = _state;
if ( _state !== STATE.NONE ) {
return;
} else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && ! _this.noRotate ) {
_state = STATE.ROTATE;
} else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && ! _this.noZoom ) {
_state = STATE.ZOOM;
} else if ( event.keyCode === _this.keys[ STATE.PAN ] && ! _this.noPan ) {
_state = STATE.PAN;
}
}
function keyup( event ) {
if ( _this.enabled === false ) return;
_state = _prevState;
window.addEventListener( 'keydown', keydown, false );
}
function mousedown( event ) {
if ( _this.enabled === false ) return;
event.preventDefault();
event.stopPropagation();
if ( _state === STATE.NONE ) {
_state = event.button;
}
if ( _state === STATE.ROTATE && ! _this.noRotate ) {
_moveCurr.copy( getMouseOnCircle( event.pageX, event.pageY ) );
_movePrev.copy( _moveCurr );
} else if ( _state === STATE.ZOOM && ! _this.noZoom ) {
_zoomStart.copy( getMouseOnScreen( event.pageX, event.pageY ) );
_zoomEnd.copy( _zoomStart );
gitextract_m22i72ws/
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github/
│ ├── CONTRIBUTING.md
│ ├── GIT_COMMIT_SPECIFIC.md
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ ├── feature-request.md
│ │ └── question.md
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── actions/
│ │ └── setup-chrome/
│ │ └── action.yml
│ └── workflows/
│ ├── auto-publisher.yml
│ ├── bench.yml
│ └── ci.yml
├── .gitignore
├── .npmrc
├── LICENSE
├── README.md
├── SECURITY.md
├── babel.config.js
├── examples/
│ ├── README.md
│ ├── app-lifecycle/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── event-handler/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── CustomComp/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── get-element/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── abc.json
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── page-lifecycle-with-router/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ ├── About/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── use-rax-compiled-component-in-runtime-miniapp/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── abc.json
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ ├── with-miniapp-native-custom-component/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Test/
│ │ │ ├── index.ali.jsx
│ │ │ └── index.wechat.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ ├── pages/
│ │ │ └── Home/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ └── public/
│ │ ├── AliNativeComp/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── WechatNativeComp/
│ │ ├── index.js
│ │ ├── index.json
│ │ ├── index.wxml
│ │ └── index.wxss
│ ├── with-miniapp-native-page/
│ │ ├── .eslintrc.js
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── build.json
│ │ ├── package.json
│ │ └── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Logo/
│ │ │ ├── index.css
│ │ │ └── index.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ ├── pages/
│ │ │ ├── Home/
│ │ │ │ ├── index.css
│ │ │ │ └── index.jsx
│ │ │ └── NativeHome/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── public/
│ │ └── components/
│ │ ├── comp1/
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── comp2/
│ │ ├── index.axml
│ │ ├── index.js
│ │ └── index.json
│ └── with-miniapp-plugin-component/
│ ├── .eslintrc.js
│ ├── .gitignore
│ ├── README.md
│ ├── ali-miniapp-plugin/
│ │ ├── api/
│ │ │ └── data.js
│ │ ├── components/
│ │ │ └── test/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ ├── index.js
│ │ ├── pages/
│ │ │ └── index/
│ │ │ ├── index.acss
│ │ │ ├── index.axml
│ │ │ ├── index.js
│ │ │ └── index.json
│ │ └── plugin.json
│ ├── build.json
│ ├── mini.project.json
│ ├── package.json
│ ├── project.config.json
│ ├── src/
│ │ ├── app.js
│ │ ├── app.json
│ │ ├── components/
│ │ │ └── Test/
│ │ │ ├── index.ali.jsx
│ │ │ ├── index.jsx
│ │ │ └── index.wechat.jsx
│ │ ├── document/
│ │ │ └── index.jsx
│ │ └── pages/
│ │ └── Home/
│ │ ├── index.css
│ │ └── index.jsx
│ └── wechat-miniprogram-plugin/
│ ├── api/
│ │ └── data.js
│ ├── components/
│ │ ├── hello-component.js
│ │ ├── hello-component.json
│ │ ├── hello-component.wxml
│ │ └── hello-component.wxss
│ ├── index.js
│ ├── pages/
│ │ ├── hello-page.js
│ │ ├── hello-page.json
│ │ ├── hello-page.wxml
│ │ └── hello-page.wxss
│ └── plugin.json
├── jest.config.js
├── lerna.json
├── package.json
├── packages/
│ ├── driver-dom/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── attributes.js
│ │ │ ├── css-custom-properties.js
│ │ │ ├── css-unit-operations.js
│ │ │ ├── event-listener.js
│ │ │ ├── hydrate.js
│ │ │ ├── node-operations.js
│ │ │ └── svg.js
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ └── warning.js
│ ├── driver-server/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── driver-universal/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── css-custom-properties.js
│ │ │ └── dom-rpx-transformer.js
│ │ ├── index.d.ts
│ │ ├── index.js
│ │ ├── miniapp.js
│ │ ├── web.js
│ │ └── weex.js
│ ├── driver-webgl/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── components/
│ │ │ ├── cameras/
│ │ │ │ └── PerspectiveCamera.js
│ │ │ ├── controls/
│ │ │ │ ├── OrbitControls.js
│ │ │ │ └── TrackballControls.js
│ │ │ ├── core/
│ │ │ │ ├── BufferGeometry.js
│ │ │ │ ├── Geometry.js
│ │ │ │ ├── Object3D.js
│ │ │ │ └── Raycaster.js
│ │ │ ├── geometries/
│ │ │ │ ├── BoxGeometry.js
│ │ │ │ ├── CylinderGeometry.js
│ │ │ │ └── SphereGeometry.js
│ │ │ ├── index.js
│ │ │ ├── lights/
│ │ │ │ ├── AmbientLight.js
│ │ │ │ └── DirectionalLight.js
│ │ │ ├── materials/
│ │ │ │ ├── LineBasicMaterial.js
│ │ │ │ ├── LineDashedMaterial.js
│ │ │ │ ├── MeshBasicMaterial.js
│ │ │ │ ├── MeshLambertMaterial.js
│ │ │ │ ├── MeshPhongMaterial.js
│ │ │ │ └── PointsMaterial.js
│ │ │ ├── objects/
│ │ │ │ ├── Line.js
│ │ │ │ ├── Mesh.js
│ │ │ │ └── Points.js
│ │ │ └── scenes/
│ │ │ └── Scene.js
│ │ ├── driver.js
│ │ ├── index.js
│ │ └── plugin/
│ │ └── controls/
│ │ ├── OrbitControls.js
│ │ └── TrackballControls.js
│ ├── driver-weex/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── index.d.ts
│ │ └── index.js
│ ├── mobx-rax/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── Provider.js
│ │ ├── index.js
│ │ ├── inject.js
│ │ ├── observer.js
│ │ ├── propTypes.js
│ │ └── utils/
│ │ ├── EventEmitter.js
│ │ └── utils.js
│ ├── rax/
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── asyncUpdate.js
│ │ │ ├── createContext.js
│ │ │ ├── createElement.js
│ │ │ ├── forwardRef.js
│ │ │ ├── fragment.js
│ │ │ ├── hooks.js
│ │ │ ├── memo.js
│ │ │ └── render.js
│ │ ├── assign.js
│ │ ├── compat/
│ │ │ └── index.js
│ │ ├── constant.js
│ │ ├── createContext.js
│ │ ├── createElement.js
│ │ ├── createRef.js
│ │ ├── debug/
│ │ │ ├── dump.js
│ │ │ └── getComponentTree.js
│ │ ├── devtools/
│ │ │ ├── index.js
│ │ │ └── reconciler.js
│ │ ├── error.js
│ │ ├── forwardRef.js
│ │ ├── fragment.js
│ │ ├── hooks.js
│ │ ├── index.js
│ │ ├── invokeFunctionsWithContext.js
│ │ ├── memo.js
│ │ ├── render.js
│ │ ├── toArray.js
│ │ ├── types.js
│ │ ├── validateChildKeys.js
│ │ ├── vdom/
│ │ │ ├── __tests__/
│ │ │ │ ├── component.js
│ │ │ │ ├── composite.js
│ │ │ │ ├── context.js
│ │ │ │ ├── empty.js
│ │ │ │ ├── fragment.js
│ │ │ │ ├── key.js
│ │ │ │ ├── native.js
│ │ │ │ ├── purecomponent.js
│ │ │ │ ├── reactive.js
│ │ │ │ ├── ref.js
│ │ │ │ ├── shallowEqual.js
│ │ │ │ └── text.js
│ │ │ ├── base.js
│ │ │ ├── component.js
│ │ │ ├── composite.js
│ │ │ ├── element.js
│ │ │ ├── empty.js
│ │ │ ├── flattenChildren.js
│ │ │ ├── fragment.js
│ │ │ ├── getElementKeyName.js
│ │ │ ├── getNearestParent.js
│ │ │ ├── getPrevSiblingNativeNode.js
│ │ │ ├── host.js
│ │ │ ├── inject.js
│ │ │ ├── injectRenderOptions.js
│ │ │ ├── instance.js
│ │ │ ├── instantiateComponent.js
│ │ │ ├── native.js
│ │ │ ├── performInSandbox.js
│ │ │ ├── reactive.js
│ │ │ ├── ref.js
│ │ │ ├── root.js
│ │ │ ├── scheduler.js
│ │ │ ├── shallowEqual.js
│ │ │ ├── shouldUpdateComponent.js
│ │ │ ├── text.js
│ │ │ └── updater.js
│ │ └── version.js
│ ├── rax-app/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── App.js
│ │ └── index.js
│ ├── rax-children/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── childern.js
│ │ └── index.js
│ ├── rax-clone-element/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── cloneElement.js
│ │ └── index.js
│ ├── rax-create-class/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── createClass.js
│ │ └── index.js
│ ├── rax-create-factory/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── createFactory.js
│ │ └── index.js
│ ├── rax-create-portal/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── createPortal.js
│ │ └── index.js
│ ├── rax-document/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-dom/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-find-dom-node/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── findDOMNode.js
│ │ │ └── findDOMNode.weex.js
│ │ └── index.js
│ ├── rax-get-element-by-id/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-hydrate/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ └── index.js
│ ├── rax-is-valid-element/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── isValidElement.js
│ │ └── index.js
│ ├── rax-proptypes/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── proptypes.js
│ │ └── index.js
│ ├── rax-redux/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── components/
│ │ │ ├── Context.js
│ │ │ ├── Provider.js
│ │ │ └── connectAdvanced.js
│ │ ├── connect/
│ │ │ ├── connect.js
│ │ │ ├── mapDispatchToProps.js
│ │ │ ├── mapStateToProps.js
│ │ │ ├── mergeProps.js
│ │ │ ├── selectorFactory.js
│ │ │ ├── verifySubselectors.js
│ │ │ └── wrapMapToProps.js
│ │ ├── hooks/
│ │ │ ├── useDispatch.js
│ │ │ ├── useReduxContext.js
│ │ │ ├── useSelector.js
│ │ │ └── useStore.js
│ │ ├── index.js
│ │ └── utils/
│ │ ├── Subscription.js
│ │ ├── batch.js
│ │ ├── hoistNonReactStatics.js
│ │ ├── isPlainObject.js
│ │ ├── isValidElementType.js
│ │ ├── shallowEqual.js
│ │ ├── verifyPlainObject.js
│ │ ├── warning.js
│ │ └── wrapActionCreators.js
│ ├── rax-server/
│ │ ├── README.md
│ │ ├── index.js
│ │ └── package.json
│ ├── rax-server-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── CSSProperty.js
│ │ ├── __tests__/
│ │ │ ├── attributes.js
│ │ │ ├── basic.js
│ │ │ ├── context.js
│ │ │ ├── elements.js
│ │ │ ├── form.js
│ │ │ ├── fragment.js
│ │ │ ├── hooks.js
│ │ │ ├── lifecycle.js
│ │ │ ├── memo.js
│ │ │ ├── refs.js
│ │ │ ├── renderToString.js
│ │ │ ├── styles.js
│ │ │ └── url.js
│ │ ├── attribute.js
│ │ └── index.js
│ ├── rax-set-native-props/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── flexbox.js
│ │ └── index.js
│ ├── rax-test-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ ├── __snapshots__/
│ │ │ │ └── snapshot.js.snap
│ │ │ ├── escapeText.js
│ │ │ ├── renderer.js
│ │ │ ├── snapshot.js
│ │ │ └── styleToCSS.js
│ │ ├── escapeText.js
│ │ ├── index.js
│ │ ├── renderer.js
│ │ ├── serializer.js
│ │ └── styleToCSS.js
│ ├── rax-unmount-component-at-node/
│ │ ├── README.md
│ │ ├── package.json
│ │ └── src/
│ │ ├── __tests__/
│ │ │ └── unmountComponentAtNode.js
│ │ └── index.js
│ └── style-unit/
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ └── src/
│ ├── __tests__/
│ │ ├── style-unit.miniApp.js
│ │ ├── style-unit.web.js
│ │ └── style-unit.weex.js
│ └── index.js
└── scripts/
├── add-owner.js
├── bench/
│ ├── .gitignore
│ ├── README.md
│ ├── chromePreferences.json
│ ├── css/
│ │ ├── bootstrap.css
│ │ ├── currentStyle.css
│ │ └── main.css
│ ├── frameworks/
│ │ ├── preact/
│ │ │ ├── .babelrc
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ ├── Main.jsx
│ │ │ │ ├── Row.jsx
│ │ │ │ └── Store.es6.js
│ │ │ └── webpack.config.js
│ │ ├── rax/
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── main.jsx
│ │ │ └── webpack.config.js
│ │ ├── rax-local/
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── main.jsx
│ │ │ └── webpack.config.js
│ │ ├── vanillajs/
│ │ │ ├── .babelrc
│ │ │ ├── index.html
│ │ │ ├── package.json
│ │ │ ├── src/
│ │ │ │ └── Main.js
│ │ │ └── webpack.config.js
│ │ └── vue/
│ │ ├── .babelrc
│ │ ├── index.html
│ │ ├── package.json
│ │ ├── src/
│ │ │ ├── App.vue
│ │ │ ├── main.es6.js
│ │ │ └── store.es6.js
│ │ └── webpack.config.js
│ ├── package.json
│ └── src/
│ ├── benchmarks.js
│ ├── build.js
│ ├── common.js
│ ├── config.js
│ ├── fomart.js
│ ├── index.js
│ ├── print.js
│ ├── runner.js
│ ├── server.js
│ └── webdriverAccess.js
├── check-and-publish.js
├── compile-packages.js
├── compile.js
├── config/
│ └── getBabelConfig.js
├── dist-core.js
├── jest/
│ ├── setupEnvironment.js
│ ├── setupTests.js
│ ├── shouldIgnoreConsoleError.js
│ ├── styleMock.js
│ └── toWarnDev.js
├── mapCoverage.js
└── validate-commit-msg.js
SYMBOL INDEX (1726 symbols across 210 files)
FILE: examples/app-lifecycle/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/app-lifecycle/src/pages/Home/index.jsx
function Home (line 9) | function Home() {
FILE: examples/event-handler/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/event-handler/src/pages/Home/index.jsx
function Home (line 10) | function Home() {
FILE: examples/get-element/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/get-element/src/pages/Home/index.jsx
function Home (line 9) | function Home() {
FILE: examples/page-lifecycle-with-router/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/page-lifecycle-with-router/src/pages/About/index.jsx
function handler (line 10) | function handler(lifeCycle) {
function About (line 27) | function About(props) {
FILE: examples/page-lifecycle-with-router/src/pages/Home/index.jsx
function handler (line 10) | function handler(lifeCycle) {
function Home (line 27) | function Home(props) {
FILE: examples/use-rax-compiled-component-in-runtime-miniapp/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/with-miniapp-native-custom-component/src/components/Test/index.ali.jsx
function Home (line 7) | function Home() {
FILE: examples/with-miniapp-native-custom-component/src/components/Test/index.wechat.jsx
function Home (line 6) | function Home() {
FILE: examples/with-miniapp-native-custom-component/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/with-miniapp-native-custom-component/src/pages/Home/index.jsx
function Home (line 7) | function Home() {
FILE: examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.js
method onClick (line 3) | onClick() {
FILE: examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.js
method onClick (line 6) | onClick() {
FILE: examples/with-miniapp-native-page/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/with-miniapp-native-page/src/pages/Home/index.jsx
function Home (line 9) | function Home() {
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/api/data.js
function getData (line 3) | function getData() {
function setData (line 7) | function setData(value) {
FILE: examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.js
method onClick (line 6) | onClick() {
FILE: examples/with-miniapp-plugin-component/src/components/Test/index.ali.jsx
function Home (line 6) | function Home() {
FILE: examples/with-miniapp-plugin-component/src/components/Test/index.jsx
function Home (line 7) | function Home() {
FILE: examples/with-miniapp-plugin-component/src/components/Test/index.wechat.jsx
function Home (line 7) | function Home() {
FILE: examples/with-miniapp-plugin-component/src/document/index.jsx
function Document (line 4) | function Document() {
FILE: examples/with-miniapp-plugin-component/src/pages/Home/index.jsx
function Home (line 9) | function Home() {
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/api/data.js
function getData (line 3) | function getData() {
function setData (line 7) | function setData(value) {
FILE: examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.js
method onClick (line 18) | onClick() {
FILE: packages/driver-dom/src/index.js
constant NON_DIMENSIONAL_REG (line 24) | const NON_DIMENSIONAL_REG = /opa|ntw|ne[ch]|ex(?:s|g|n|p|$)|^ord|zoo|gri...
constant EVENT_PREFIX_REG (line 25) | const EVENT_PREFIX_REG = /^on[A-Z]/;
constant DANGEROUSLY_SET_INNER_HTML (line 26) | const DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
constant HTML (line 27) | const HTML = '__html';
constant INNER_HTML (line 28) | const INNER_HTML = 'innerHTML';
constant CLASS_NAME (line 29) | const CLASS_NAME = 'className';
constant CLASS (line 30) | const CLASS = 'class';
constant STYLE (line 31) | const STYLE = 'style';
constant CHILDREN (line 32) | const CHILDREN = 'children';
constant TEXT_CONTENT_ATTR (line 33) | const TEXT_CONTENT_ATTR = 'textContent';
constant CREATE_ELEMENT (line 34) | const CREATE_ELEMENT = 'createElement';
constant CREATE_COMMENT (line 35) | const CREATE_COMMENT = 'createComment';
constant CREATE_TEXT_NODE (line 36) | const CREATE_TEXT_NODE = 'createTextNode';
constant SET_ATTRIBUTE (line 37) | const SET_ATTRIBUTE = 'setAttribute';
constant REMOVE_ATTRIBUTE (line 38) | const REMOVE_ATTRIBUTE = 'removeAttribute';
constant SVG_NS (line 39) | const SVG_NS = 'http://www.w3.org/2000/svg';
constant TEXT_NODE (line 40) | const TEXT_NODE = 3;
constant COMMENT_NODE (line 41) | const COMMENT_NODE = 8;
constant TEXT_SPLIT_COMMENT (line 42) | const TEXT_SPLIT_COMMENT = '|';
constant EMPTY (line 43) | const EMPTY = '';
constant HYDRATION_INDEX (line 44) | const HYDRATION_INDEX = '__i';
constant HYDRATION_APPEND (line 45) | const HYDRATION_APPEND = '__a';
constant WITH_INNERHTML (line 46) | const WITH_INNERHTML = '__h';
function setTagNamePrefix (line 71) | function setTagNamePrefix(prefix) {
function createBody (line 75) | function createBody() {
function createEmpty (line 79) | function createEmpty(component) {
function createText (line 104) | function createText(text, component) {
function updateText (line 132) | function updateText(node, text) {
function findHydrationChild (line 136) | function findHydrationChild(parent) {
function createElement (line 159) | function createElement(type, props, component, __shouldConvertUnitlessTo...
function appendChild (line 253) | function appendChild(node, parent) {
function removeChild (line 259) | function removeChild(node, parent) {
function replaceChild (line 267) | function replaceChild(newChild, oldChild, parent) {
function insertAfter (line 272) | function insertAfter(node, after, parent) {
function insertBefore (line 285) | function insertBefore(node, before, parent) {
function addEventListener (line 290) | function addEventListener(node, eventName, eventHandler) {
function removeEventListener (line 294) | function removeEventListener(node, eventName, eventHandler) {
function removeAttribute (line 298) | function removeAttribute(node, propKey) {
function setAttribute (line 315) | function setAttribute(node, propKey, propValue, isSvg) {
function setStyle (line 346) | function setStyle(node, style, __shouldConvertUnitlessToRpx) {
function beforeRender (line 374) | function beforeRender({ hydrate }) {
function recolectHydrationChild (line 390) | function recolectHydrationChild(hydrationParent) {
function afterRender (line 412) | function afterRender({ container }) {
function removeChildren (line 424) | function removeChildren(node) {
FILE: packages/driver-dom/src/warning.js
function warnForReplacedHydratebleElement (line 5) | function warnForReplacedHydratebleElement(
function warnForDeletedHydratableElement (line 30) | function warnForDeletedHydratableElement(
function warnForInsertedHydratedElement (line 49) | function warnForInsertedHydratedElement(
function getNodeName (line 73) | function getNodeName(node) {
FILE: packages/driver-server/src/index.js
constant STYLE (line 5) | const STYLE = 'style';
constant CHILDREN (line 6) | const CHILDREN = 'children';
constant DANGEROUSLY_SET_INNER_HTML (line 7) | const DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
constant EVENT_PREFIX_REGEXP (line 8) | const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
constant ELEMENT_NODE (line 10) | const ELEMENT_NODE = 1;
constant TEXT_NODE (line 11) | const TEXT_NODE = 3;
constant COMMENT_NODE (line 12) | const COMMENT_NODE = 8;
method getElementById (line 18) | getElementById(id) {
method createBody (line 22) | createBody() {
method createComment (line 34) | createComment(content) {
method createEmpty (line 42) | createEmpty() {
method createText (line 46) | createText(text) {
method updateText (line 54) | updateText(node, text) {
method createElement (line 58) | createElement(type, props) {
method appendChild (line 74) | appendChild(node, parent) {
method removeChild (line 79) | removeChild(node, parent) {
method replaceChild (line 92) | replaceChild(newChild, oldChild, parent) {
method insertAfter (line 107) | insertAfter(node, after, parent) {
method insertBefore (line 124) | insertBefore(node, before, parent) {
method nextSibling (line 136) | nextSibling(node) {
method previousSibling (line 144) | previousSibling(node) {
method addEventListener (line 152) | addEventListener(node, eventName, eventHandler) {
method removeEventListener (line 156) | removeEventListener(node, eventName, eventHandler) {
method removeAttribute (line 160) | removeAttribute(node, propKey, propValue) {
method setAttribute (line 180) | setAttribute(node, propKey, propValue) {
method setStyle (line 200) | setStyle(node, style) {
method setNativeProps (line 206) | setNativeProps(node, props, shouldIgnoreStyleProp) {
FILE: packages/driver-universal/src/web.js
method createElement (line 5) | createElement(type, props, component) {
method setStyle (line 8) | setStyle(node, style) {
FILE: packages/driver-webgl/src/components/cameras/PerspectiveCamera.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/controls/OrbitControls.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/controls/TrackballControls.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/core/BufferGeometry.js
method init (line 4) | init(props) {
method updateProperty (line 16) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/core/Geometry.js
method init (line 4) | init() {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/core/Object3D.js
method init (line 4) | init() {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/core/Raycaster.js
method init (line 6) | init(props) {
method updateProperty (line 13) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/geometries/BoxGeometry.js
method init (line 4) | init(props) {
method updateProperty (line 17) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/geometries/CylinderGeometry.js
method init (line 4) | init(props) {
method updateProperty (line 28) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/geometries/SphereGeometry.js
method init (line 4) | init(props) {
method updateProperty (line 18) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/lights/AmbientLight.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/lights/DirectionalLight.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/materials/LineBasicMaterial.js
method init (line 4) | init(props) {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/materials/LineDashedMaterial.js
method init (line 4) | init(props) {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/materials/MeshBasicMaterial.js
method init (line 4) | init(props) {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/materials/MeshLambertMaterial.js
method init (line 4) | init(props) {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/materials/MeshPhongMaterial.js
method init (line 4) | init(props) {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/materials/PointsMaterial.js
method init (line 4) | init(props) {
method updateProperty (line 9) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/objects/Line.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/objects/Mesh.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/objects/Points.js
method init (line 4) | init(props) {
method updateProperty (line 10) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/components/scenes/Scene.js
method init (line 4) | init(props) {
method updateProperty (line 28) | updateProperty(key, value) {
FILE: packages/driver-webgl/src/driver.js
constant CHILDREN (line 4) | const CHILDREN = 'children';
constant EVENT_PREFIX_REGEXP (line 5) | const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
function createElement (line 13) | function createElement(type, props) {
method getElementById (line 18) | getElementById(id) {
method createBody (line 22) | createBody() {
method createEmpty (line 34) | createEmpty() {
method createElement (line 40) | createElement(type, props) {
method appendChild (line 46) | appendChild(node, parent) {
method removeChild (line 67) | removeChild(node, parent) {
method replaceChild (line 76) | replaceChild(newChild, oldChild, parent) {
method addEventListener (line 82) | addEventListener(node, eventName, eventHandler) {
method removeEventListener (line 89) | removeEventListener(node, eventName, eventHandler) {
method removeAttribute (line 96) | removeAttribute(node, propKey, propValue) {
method setAttribute (line 100) | setAttribute(node, propKey, propValue) {
method afterRender (line 108) | afterRender() {
method setNativeProps (line 112) | setNativeProps(node, props) {
FILE: packages/driver-webgl/src/plugin/controls/OrbitControls.js
function getAutoRotationAngle (line 253) | function getAutoRotationAngle() {
function getZoomScale (line 257) | function getZoomScale() {
function rotateLeft (line 261) | function rotateLeft( angle ) {
function rotateUp (line 265) | function rotateUp( angle ) {
function dollyIn (line 322) | function dollyIn( dollyScale ) {
function dollyOut (line 335) | function dollyOut( dollyScale ) {
function handleMouseDownRotate (line 352) | function handleMouseDownRotate( event ) {
function handleMouseDownDolly (line 358) | function handleMouseDownDolly( event ) {
function handleMouseDownPan (line 364) | function handleMouseDownPan( event ) {
function handleMouseMoveRotate (line 370) | function handleMouseMoveRotate( event ) {
function handleMouseMoveDolly (line 389) | function handleMouseMoveDolly( event ) {
function handleMouseMovePan (line 407) | function handleMouseMovePan( event ) {
function handleMouseUp (line 421) | function handleMouseUp( event ) {
function handleMouseWheel (line 427) | function handleMouseWheel( event ) {
function handleKeyDown (line 439) | function handleKeyDown( event ) {
function handleTouchStartRotate (line 465) | function handleTouchStartRotate( event ) {
function handleTouchStartDolly (line 471) | function handleTouchStartDolly( event ) {
function handleTouchStartPan (line 482) | function handleTouchStartPan( event ) {
function handleTouchMoveRotate (line 488) | function handleTouchMoveRotate( event ) {
function handleTouchMoveDolly (line 507) | function handleTouchMoveDolly( event ) {
function handleTouchMovePan (line 530) | function handleTouchMovePan( event ) {
function handleTouchEnd (line 544) | function handleTouchEnd( event ) {
function onMouseDown (line 554) | function onMouseDown( event ) {
function onMouseMove (line 599) | function onMouseMove( event ) {
function onMouseUp (line 631) | function onMouseUp( event ) {
function onMouseWheel (line 644) | function onMouseWheel( event ) {
function onKeyDown (line 656) | function onKeyDown( event ) {
function onTouchStart (line 662) | function onTouchStart( event ) {
function onTouchMove (line 706) | function onTouchMove( event ) {
function onTouchEnd (line 746) | function onTouchEnd( event ) {
function onContextMenu (line 756) | function onContextMenu( event ) {
FILE: packages/driver-webgl/src/plugin/controls/TrackballControls.js
function keydown (line 288) | function keydown( event ) {
function keyup (line 306) | function keyup( event ) {
function mousedown (line 314) | function mousedown( event ) {
function mousemove (line 341) | function mousemove( event ) {
function mouseup (line 357) | function mouseup( event ) {
function mousewheel (line 370) | function mousewheel( event ) {
function touchstart (line 397) | function touchstart( event ) {
function touchmove (line 423) | function touchmove( event ) {
function touchend (line 447) | function touchend( event ) {
function contextmenu (line 465) | function contextmenu( event ) {
FILE: packages/driver-weex/src/index.js
constant STYLE (line 8) | const STYLE = 'style';
constant TEXT (line 10) | const TEXT = 'text';
constant CHILDREN (line 11) | const CHILDREN = 'children';
constant EVENT_PREFIX_REGEXP (line 12) | const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
constant ARIA_PREFIX_REGEXP (line 13) | const ARIA_PREFIX_REGEXP = /^aria-/;
constant HYPHEN_REGEXP (line 14) | const HYPHEN_REGEXP = /\-(\w)/;
constant EMPTY (line 15) | const EMPTY = '';
function updateWeexTextValue (line 17) | function updateWeexTextValue(node) {
function getElementById (line 32) | function getElementById(id) {
function createBody (line 39) | function createBody(type, props) {
function createComment (line 54) | function createComment(content) {
function createEmpty (line 58) | function createEmpty(component) {
function createText (line 65) | function createText(text, component) {
function updateText (line 73) | function updateText(node, text) {
function createElement (line 81) | function createElement(type, props, component) {
function appendChild (line 118) | function appendChild(node, parent) {
function removeChild (line 129) | function removeChild(node, parent) {
function replaceChild (line 146) | function replaceChild(newChild, oldChild, parent) {
function insertAfter (line 164) | function insertAfter(node, after, parent) {
function insertBefore (line 176) | function insertBefore(node, before, parent) {
function addEventListener (line 188) | function addEventListener(node, eventName, eventHandler, props) {
function removeEventListener (line 197) | function removeEventListener(node, eventName, eventHandler) {
function removeAttribute (line 204) | function removeAttribute(node, propKey, propValue) {
function setAttribute (line 215) | function setAttribute(node, propKey, propValue, isSvg) {
function setStyle (line 233) | function setStyle(node, style) {
function beforeRender (line 244) | function beforeRender() {
function afterRender (line 252) | function afterRender() {
FILE: packages/mobx-rax/src/Provider.js
class Provider (line 8) | class Provider extends Component {
method constructor (line 17) | constructor(props, context) {
method isReactComponent (line 22) | isReactComponent() {}
method render (line 24) | render() {
method getChildContext (line 28) | getChildContext() {
method getDerivedStateFromProps (line 45) | static getDerivedStateFromProps(nextProps, prevState) {
FILE: packages/mobx-rax/src/inject.js
function createStoreInjector (line 36) | function createStoreInjector(grabStoresFn, component, injectNames) {
function grabStoresByName (line 84) | function grabStoresByName(storeNames) {
function inject (line 109) | function inject(/* fn(stores, nextProps) or ...storeNames */) {
FILE: packages/mobx-rax/src/observer.js
function createSymbol (line 23) | function createSymbol(name) {
function setHiddenProp (line 39) | function setHiddenProp(target, prop, value) {
function findDOMNode (line 52) | function findDOMNode(component) {
function reportRendering (line 66) | function reportRendering(component) {
function trackComponents (line 79) | function trackComponents() {
function useStaticRendering (line 85) | function useStaticRendering(useStaticRendering) {
function patch (line 99) | function patch(target, funcName, runMixinFirst = false) {
function shallowEqual (line 119) | function shallowEqual(objA, objB) {
function is (line 136) | function is(x, y) {
function makeComponentReactive (line 145) | function makeComponentReactive(render) {
function makeObservableProp (line 277) | function makeObservableProp(target, propName) {
function observer (line 309) | function observer(arg1, arg2) {
function mixinLifecycleEvents (line 382) | function mixinLifecycleEvents(target) {
FILE: packages/mobx-rax/src/propTypes.js
function createChainableTypeChecker (line 4) | function createChainableTypeChecker(validate) {
function isSymbol (line 46) | function isSymbol(propType, propValue) {
function getPropType (line 66) | function getPropType(propValue) {
function getPreciseType (line 85) | function getPreciseType(propValue) {
function createObservableTypeCheckerCreator (line 97) | function createObservableTypeCheckerCreator(allowNativeType, mobxType) {
function createObservableArrayOfTypeChecker (line 149) | function createObservableArrayOfTypeChecker(allowNativeType, typeChecker) {
FILE: packages/mobx-rax/src/utils/EventEmitter.js
class EventEmitter (line 1) | class EventEmitter {
method on (line 4) | on(cb) {
method emit (line 12) | emit(data) {
FILE: packages/mobx-rax/src/utils/utils.js
function isStateless (line 1) | function isStateless(component) {
FILE: packages/rax-app/src/App.js
function _isNullableComponent (line 8) | function _isNullableComponent(component) {
function App (line 12) | function App(props) {
FILE: packages/rax-app/src/index.js
function mount (line 13) | function mount(appInstance, rootEl) {
function unmount (line 19) | function unmount() {
function useAppShow (line 43) | function useAppShow(callback) {
function useAppLaunch (line 47) | function useAppLaunch(callback) {
function useAppShare (line 51) | function useAppShare(callback) {
function useAppError (line 55) | function useAppError(callback) {
function useAppHide (line 59) | function useAppHide(callback) {
function usePageNotFound (line 63) | function usePageNotFound(callback) {
function runApp (line 67) | function runApp(staticConfig, dynamicConfig = {}) {
FILE: packages/rax-children/src/__tests__/childern.js
class WrapComponent (line 8) | class WrapComponent extends Component {
method render (line 9) | render() {
FILE: packages/rax-children/src/index.js
function convertChildrenToArray (line 5) | function convertChildrenToArray(children) {
method map (line 12) | map(children, fn, ctx) {
method forEach (line 17) | forEach(children, fn, ctx) {
method count (line 22) | count(children) {
method only (line 26) | only(children) {
method toArray (line 33) | toArray(children) {
FILE: packages/rax-clone-element/src/__tests__/cloneElement.js
function createNodeElement (line 12) | function createNodeElement(tagName) {
class ComponentClass (line 31) | class ComponentClass extends Component {
method render (line 32) | render() {
class Grandparent (line 52) | class Grandparent {
method render (line 53) | render() {
method render (line 82) | render() {
method render (line 103) | render() {
method render (line 202) | render() {
method render (line 220) | render() {
class Parent (line 58) | class Parent {
method render (line 59) | render() {
method render (line 88) | render() {
method render (line 109) | render() {
method render (line 193) | render() {
method render (line 213) | render() {
class Child (line 75) | class Child {
method render (line 76) | render() {
class Grandparent (line 81) | class Grandparent {
method render (line 53) | render() {
method render (line 82) | render() {
method render (line 103) | render() {
method render (line 202) | render() {
method render (line 220) | render() {
class Parent (line 87) | class Parent {
method render (line 59) | render() {
method render (line 88) | render() {
method render (line 109) | render() {
method render (line 193) | render() {
method render (line 213) | render() {
class Grandparent (line 102) | class Grandparent {
method render (line 53) | render() {
method render (line 82) | render() {
method render (line 103) | render() {
method render (line 202) | render() {
method render (line 220) | render() {
class Parent (line 108) | class Parent {
method render (line 59) | render() {
method render (line 88) | render() {
method render (line 109) | render() {
method render (line 193) | render() {
method render (line 213) | render() {
class MyComponent (line 123) | class MyComponent {
method render (line 124) | render() {
method render (line 134) | render() {
method render (line 147) | render() {
method render (line 160) | render() {
method render (line 233) | render() {
method render (line 248) | render() {
class MyComponent (line 133) | class MyComponent {
method render (line 124) | render() {
method render (line 134) | render() {
method render (line 147) | render() {
method render (line 160) | render() {
method render (line 233) | render() {
method render (line 248) | render() {
class MyComponent (line 146) | class MyComponent {
method render (line 124) | render() {
method render (line 134) | render() {
method render (line 147) | render() {
method render (line 160) | render() {
method render (line 233) | render() {
method render (line 248) | render() {
class MyComponent (line 159) | class MyComponent {
method render (line 124) | render() {
method render (line 134) | render() {
method render (line 147) | render() {
method render (line 160) | render() {
method render (line 233) | render() {
method render (line 248) | render() {
class Parent (line 192) | class Parent {
method render (line 59) | render() {
method render (line 88) | render() {
method render (line 109) | render() {
method render (line 193) | render() {
method render (line 213) | render() {
class Grandparent (line 201) | class Grandparent {
method render (line 53) | render() {
method render (line 82) | render() {
method render (line 103) | render() {
method render (line 202) | render() {
method render (line 220) | render() {
class Parent (line 212) | class Parent {
method render (line 59) | render() {
method render (line 88) | render() {
method render (line 109) | render() {
method render (line 193) | render() {
method render (line 213) | render() {
class Grandparent (line 219) | class Grandparent {
method render (line 53) | render() {
method render (line 82) | render() {
method render (line 103) | render() {
method render (line 202) | render() {
method render (line 220) | render() {
class MyComponent (line 232) | class MyComponent {
method render (line 124) | render() {
method render (line 134) | render() {
method render (line 147) | render() {
method render (line 160) | render() {
method render (line 233) | render() {
method render (line 248) | render() {
class MyComponent (line 246) | class MyComponent {
method render (line 124) | render() {
method render (line 134) | render() {
method render (line 147) | render() {
method render (line 160) | render() {
method render (line 233) | render() {
method render (line 248) | render() {
FILE: packages/rax-clone-element/src/index.js
constant RESERVED_PROPS (line 5) | const RESERVED_PROPS = {
function cloneElement (line 10) | function cloneElement(element, config, ...children) {
FILE: packages/rax-create-class/src/__tests__/createClass.js
function createNodeElement (line 12) | function createNodeElement(tagName) {
method getInitialState (line 93) | getInitialState() {
method render (line 96) | render() {
method getChildContext (line 105) | getChildContext() {
method render (line 108) | render() {
FILE: packages/rax-create-class/src/index.js
constant AUTOBIND_BLACKLIST (line 3) | const AUTOBIND_BLACKLIST = {
function collateMixins (line 15) | function collateMixins(mixins) {
function flattenHooks (line 34) | function flattenHooks(key, hooks) {
function applyMixins (line 57) | function applyMixins(proto, mixins) {
function createReactClass (line 65) | function createReactClass(spec) {
FILE: packages/rax-create-factory/src/__tests__/createFactory.js
function createNodeElement (line 11) | function createNodeElement(tagName) {
class ComponentClass (line 30) | class ComponentClass extends Component {
method render (line 31) | render() {
FILE: packages/rax-create-factory/src/index.js
function createFactory (line 3) | function createFactory(type) {
FILE: packages/rax-create-portal/src/__tests__/createPortal.js
function createNodeElement (line 13) | function createNodeElement(tagName) {
class Sub (line 58) | class Sub extends Component {
method render (line 63) | render() {
method render (line 101) | render() {
method render (line 145) | render() {
class Parent (line 68) | class Parent extends Component {
method getChildContext (line 73) | getChildContext() {
method render (line 79) | render() {
method getChildContext (line 112) | getChildContext() {
method render (line 119) | render() {
method getChildContext (line 157) | getChildContext() {
method render (line 164) | render() {
class Sub (line 95) | class Sub extends Component {
method render (line 63) | render() {
method render (line 101) | render() {
method render (line 145) | render() {
class Parent (line 106) | class Parent extends Component {
method getChildContext (line 73) | getChildContext() {
method render (line 79) | render() {
method getChildContext (line 112) | getChildContext() {
method render (line 119) | render() {
method getChildContext (line 157) | getChildContext() {
method render (line 164) | render() {
class Sub (line 140) | class Sub extends Component {
method render (line 63) | render() {
method render (line 101) | render() {
method render (line 145) | render() {
class Parent (line 152) | class Parent extends Component {
method getChildContext (line 73) | getChildContext() {
method render (line 79) | render() {
method getChildContext (line 112) | getChildContext() {
method render (line 119) | render() {
method getChildContext (line 157) | getChildContext() {
method render (line 164) | render() {
function Portal (line 217) | function Portal() {
function App (line 222) | function App() {
FILE: packages/rax-create-portal/src/index.js
function Portal (line 4) | function Portal(props) {
function createPortal (line 21) | function createPortal(element, container) {
FILE: packages/rax-document/src/index.js
function Root (line 3) | function Root(props, context) {
function Manifest (line 17) | function Manifest(props, context) {
function Data (line 36) | function Data(props, context) {
function Style (line 47) | function Style(props, context) {
function Script (line 53) | function Script(props, context) {
function App (line 65) | function App(props, context) {
FILE: packages/rax-dom/src/index.js
function normalizeEventName (line 8) | function normalizeEventName(node, eventName, props) {
method addEventListener (line 24) | addEventListener(node, eventName, eventHandler, props) {
method removeEventListener (line 28) | removeEventListener(node, eventName, eventHandler, props) {
FILE: packages/rax-find-dom-node/src/__tests__/findDOMNode.js
function createNodeElement (line 11) | function createNodeElement(tagName) {
method render (line 71) | render() {}
method render (line 88) | render() {}
method render (line 101) | render() {}
class Foo (line 116) | class Foo extends Component {
method render (line 117) | render() {
class Bar (line 132) | class Bar extends Component {
method componentWillMount (line 133) | componentWillMount() {
method render (line 137) | render() {
FILE: packages/rax-find-dom-node/src/index.js
function findDOMNode (line 3) | function findDOMNode(instance) {
FILE: packages/rax-get-element-by-id/src/index.js
function getElementById (line 5) | function getElementById(id) {
FILE: packages/rax-is-valid-element/src/index.js
function isValidElement (line 1) | function isValidElement(object) {
FILE: packages/rax-redux/src/components/Provider.js
function Provider (line 5) | function Provider({ store, context, children }) {
FILE: packages/rax-redux/src/components/connectAdvanced.js
constant EMPTY_ARRAY (line 20) | const EMPTY_ARRAY = [];
constant NO_SUBSCRIPTION_ARRAY (line 21) | const NO_SUBSCRIPTION_ARRAY = [null, null];
function storeStateUpdatesReducer (line 31) | function storeStateUpdatesReducer(state, action) {
function connectAdvanced (line 50) | function connectAdvanced(
FILE: packages/rax-redux/src/connect/connect.js
function match (line 25) | function match(arg, factories, name) {
function strictEqual (line 40) | function strictEqual(a, b) {
function createConnect (line 46) | function createConnect({
FILE: packages/rax-redux/src/connect/mapDispatchToProps.js
function whenMapDispatchToPropsIsFunction (line 4) | function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {
function whenMapDispatchToPropsIsMissing (line 10) | function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {
function whenMapDispatchToPropsIsObject (line 16) | function whenMapDispatchToPropsIsObject(mapDispatchToProps) {
FILE: packages/rax-redux/src/connect/mapStateToProps.js
function whenMapStateToPropsIsFunction (line 3) | function whenMapStateToPropsIsFunction(mapStateToProps) {
function whenMapStateToPropsIsMissing (line 9) | function whenMapStateToPropsIsMissing(mapStateToProps) {
FILE: packages/rax-redux/src/connect/mergeProps.js
function defaultMergeProps (line 3) | function defaultMergeProps(stateProps, dispatchProps, ownProps) {
function wrapMergePropsFunc (line 7) | function wrapMergePropsFunc(mergeProps) {
function whenMergePropsIsFunction (line 34) | function whenMergePropsIsFunction(mergeProps) {
function whenMergePropsIsOmitted (line 40) | function whenMergePropsIsOmitted(mergeProps) {
FILE: packages/rax-redux/src/connect/selectorFactory.js
function impureFinalPropsSelectorFactory (line 3) | function impureFinalPropsSelectorFactory(
function pureFinalPropsSelectorFactory (line 18) | function pureFinalPropsSelectorFactory(
function finalPropsSelectorFactory (line 100) | function finalPropsSelectorFactory(
FILE: packages/rax-redux/src/connect/verifySubselectors.js
function verify (line 3) | function verify(selector, methodName, displayName) {
function verifySubselectors (line 18) | function verifySubselectors(
FILE: packages/rax-redux/src/connect/wrapMapToProps.js
function wrapMapToPropsConstant (line 3) | function wrapMapToPropsConstant(getConstant) {
function getDependsOnOwnProps (line 22) | function getDependsOnOwnProps(mapToProps) {
function wrapMapToPropsFunc (line 41) | function wrapMapToPropsFunc(mapToProps, methodName) {
FILE: packages/rax-redux/src/hooks/useDispatch.js
function createDispatchHook (line 10) | function createDispatchHook(context = ReactReduxContext) {
FILE: packages/rax-redux/src/hooks/useReduxContext.js
function useReduxContext (line 21) | function useReduxContext() {
FILE: packages/rax-redux/src/hooks/useSelector.js
function useSelectorWithStoreAndSubscription (line 31) | function useSelectorWithStoreAndSubscription(
function createSelectorHook (line 113) | function createSelectorHook(context = ReactReduxContext) {
FILE: packages/rax-redux/src/hooks/useStore.js
function createStoreHook (line 11) | function createStoreHook(context = ReactReduxContext) {
FILE: packages/rax-redux/src/utils/Subscription.js
constant CLEARED (line 7) | const CLEARED = null;
method notify (line 8) | notify() {}
function createListenerCollection (line 10) | function createListenerCollection() {
class Subscription (line 52) | class Subscription {
method constructor (line 53) | constructor(store, parentSub) {
method addNestedSub (line 62) | addNestedSub(listener) {
method notifyNestedSubs (line 67) | notifyNestedSubs() {
method handleChangeWrapper (line 71) | handleChangeWrapper() {
method isSubscribed (line 77) | isSubscribed() {
method trySubscribe (line 81) | trySubscribe() {
method tryUnsubscribe (line 91) | tryUnsubscribe() {
FILE: packages/rax-redux/src/utils/batch.js
function defaultNoopBatch (line 2) | function defaultNoopBatch(callback) {
FILE: packages/rax-redux/src/utils/hoistNonReactStatics.js
constant REACT_STATICS (line 3) | const REACT_STATICS = {
constant KNOWN_STATICS (line 16) | const KNOWN_STATICS = {
function hoistNonReactStatics (line 26) | function hoistNonReactStatics(targetComponent, sourceComponent) {
FILE: packages/rax-redux/src/utils/isPlainObject.js
function isPlainObject (line 5) | function isPlainObject(obj) {
FILE: packages/rax-redux/src/utils/isValidElementType.js
function isValidElementType (line 1) | function isValidElementType(type) {
FILE: packages/rax-redux/src/utils/shallowEqual.js
function is (line 3) | function is(x, y) {
function shallowEqual (line 11) | function shallowEqual(objA, objB) {
FILE: packages/rax-redux/src/utils/verifyPlainObject.js
function verifyPlainObject (line 4) | function verifyPlainObject(value, displayName, methodName) {
FILE: packages/rax-redux/src/utils/warning.js
function warning (line 7) | function warning(message) {
FILE: packages/rax-redux/src/utils/wrapActionCreators.js
function wrapActionCreators (line 3) | function wrapActionCreators(actionCreators) {
FILE: packages/rax-server-renderer/src/CSSProperty.js
constant TRUE (line 1) | const TRUE = true;
constant UNITLESS_NUMBER_PROPS (line 6) | const UNITLESS_NUMBER_PROPS = {
function prefixKey (line 59) | function prefixKey(prefix, key) {
FILE: packages/rax-server-renderer/src/__tests__/attributes.js
function MyComponent (line 10) | function MyComponent() {
function MyComponent (line 19) | function MyComponent() {
function MyComponent (line 28) | function MyComponent() {
function MyComponent (line 37) | function MyComponent() {
function MyComponent (line 46) | function MyComponent() {
function MyComponent (line 57) | function MyComponent() {
function MyComponent (line 66) | function MyComponent() {
function MyComponent (line 77) | function MyComponent() {
function MyComponent (line 86) | function MyComponent() {
function MyComponent (line 95) | function MyComponent() {
function MyComponent (line 104) | function MyComponent() {
function MyComponent (line 113) | function MyComponent() {
function MyComponent (line 122) | function MyComponent() {
function MyComponent (line 131) | function MyComponent() {
function MyComponent (line 140) | function MyComponent() {
function MyComponent (line 149) | function MyComponent() {
function MyComponent (line 158) | function MyComponent() {
function MyComponent (line 168) | function MyComponent() {
function MyComponent (line 177) | function MyComponent() {
function MyComponent (line 188) | function MyComponent() {
function MyComponent (line 197) | function MyComponent() {
function MyComponent (line 206) | function MyComponent() {
function MyComponent (line 215) | function MyComponent() {
function MyComponent (line 224) | function MyComponent() {
function MyComponent (line 233) | function MyComponent() {
function MyComponent (line 242) | function MyComponent() {
function MyComponent (line 251) | function MyComponent() {
function MyComponent (line 261) | function MyComponent() {
function MyComponent (line 270) | function MyComponent() {
function MyComponent (line 281) | function MyComponent() {
function MyComponent (line 290) | function MyComponent() {
function MyComponent (line 299) | function MyComponent() {
function MyComponent (line 308) | function MyComponent() {
function MyComponent (line 317) | function MyComponent() {
function MyComponent (line 326) | function MyComponent() {
function MyComponent (line 335) | function MyComponent() {
function MyComponent (line 350) | function MyComponent() {
function MyComponent (line 359) | function MyComponent() {
function MyComponent (line 368) | function MyComponent() {
function MyComponent (line 378) | function MyComponent() {
function MyComponent (line 387) | function MyComponent() {
function MyComponent (line 397) | function MyComponent() {
function MyComponent (line 407) | function MyComponent() {
function MyComponent (line 418) | function MyComponent() {
function MyComponent (line 427) | function MyComponent() {
function MyComponent (line 436) | function MyComponent() {
function MyComponent (line 445) | function MyComponent() {
function MyComponent (line 460) | function MyComponent() {
function MyComponent (line 469) | function MyComponent() {
function MyComponent (line 478) | function MyComponent() {
function MyComponent (line 487) | function MyComponent() {
function MyComponent (line 498) | function MyComponent() {
function MyComponent (line 507) | function MyComponent() {
function MyComponent (line 518) | function MyComponent() {
function MyComponent (line 529) | function MyComponent() {
function MyComponent (line 542) | function MyComponent() {
function MyComponent (line 551) | function MyComponent() {
function MyComponent (line 560) | function MyComponent() {
function MyComponent (line 569) | function MyComponent() {
function MyComponent (line 578) | function MyComponent() {
function MyComponent (line 587) | function MyComponent() {
function MyComponent (line 596) | function MyComponent() {
function MyComponent (line 605) | function MyComponent() {
function MyComponent (line 614) | function MyComponent() {
function MyComponent (line 623) | function MyComponent() {
function MyComponent (line 632) | function MyComponent() {
function MyComponent (line 643) | function MyComponent() {
function MyComponent (line 654) | function MyComponent() {
function MyComponent (line 663) | function MyComponent() {
function MyComponent (line 672) | function MyComponent() {
function MyComponent (line 684) | function MyComponent() {
function MyComponent (line 693) | function MyComponent() {
function MyComponent (line 702) | function MyComponent() {
function MyComponent (line 711) | function MyComponent() {
function MyComponent (line 720) | function MyComponent() {
function MyComponent (line 729) | function MyComponent() {
function MyComponent (line 738) | function MyComponent() {
function MyComponent (line 747) | function MyComponent() {
function MyComponent (line 756) | function MyComponent() {
function MyComponent (line 765) | function MyComponent() {
function MyComponent (line 774) | function MyComponent() {
FILE: packages/rax-server-renderer/src/__tests__/basic.js
function MyComponent (line 9) | function MyComponent() {
function MyComponent (line 18) | function MyComponent() {
function MyComponent (line 27) | function MyComponent() {
function MyComponent (line 40) | function MyComponent() {
function MyComponent (line 49) | function MyComponent() {
function MyComponent (line 60) | function MyComponent() {
function MyComponent (line 69) | function MyComponent() {
function MyComponent (line 85) | function MyComponent() {
function MyComponent (line 99) | function MyComponent() {
FILE: packages/rax-server-renderer/src/__tests__/context.js
class Parent (line 13) | class Parent extends Component {
method render (line 14) | render() {
method render (line 135) | render() {
method getChildContext (line 259) | getChildContext() {
method render (line 262) | render() {
method getChildContext (line 309) | getChildContext() {
method render (line 312) | render() {
class ClassChildWithContext (line 32) | class ClassChildWithContext extends Component {
method render (line 33) | render() {
method render (line 273) | render() {
function FunctionChildWithContext (line 52) | function FunctionChildWithContext(props) {
class ClassChildWithWrongContext (line 66) | class ClassChildWithWrongContext extends Component {
method render (line 67) | render() {
function FunctionChildWithWrongContext (line 82) | function FunctionChildWithWrongContext(props) {
function Grandchild (line 92) | function Grandchild(props) {
function Grandchild (line 112) | function Grandchild(props) {
class Parent (line 134) | class Parent extends Component {
method render (line 14) | render() {
method render (line 135) | render() {
method getChildContext (line 259) | getChildContext() {
method render (line 262) | render() {
method getChildContext (line 309) | getChildContext() {
method render (line 312) | render() {
function Child (line 144) | function Child() {
function Provider (line 228) | function Provider() {
function FnConsumer (line 236) | function FnConsumer() {
class Parent (line 258) | class Parent extends Component {
method render (line 14) | render() {
method render (line 135) | render() {
method getChildContext (line 259) | getChildContext() {
method render (line 262) | render() {
method getChildContext (line 309) | getChildContext() {
method render (line 312) | render() {
class ClassChildWithContext (line 272) | class ClassChildWithContext extends Component {
method render (line 33) | render() {
method render (line 273) | render() {
function FunctionChildWithContext (line 291) | function FunctionChildWithContext(props, context) {
class Parent (line 308) | class Parent extends Component {
method render (line 14) | render() {
method render (line 135) | render() {
method getChildContext (line 259) | getChildContext() {
method render (line 262) | render() {
method getChildContext (line 309) | getChildContext() {
method render (line 312) | render() {
function FunctionChildWithContext (line 321) | function FunctionChildWithContext(props, context) {
function FunctionChildWithContext (line 337) | function FunctionChildWithContext(props, context) {
function FunctionChildWithContext (line 353) | function FunctionChildWithContext(props, context) {
FILE: packages/rax-server-renderer/src/__tests__/elements.js
class X (line 111) | class X extends Component {
method render (line 112) | render() {
function Y (line 117) | function Y() {
function Z (line 121) | function Z() {
method toString (line 349) | toString() {
class ClassComponent (line 405) | class ClassComponent extends Component {
method render (line 406) | render() {
class UndefinedComponent (line 559) | class UndefinedComponent extends Component {
method render (line 560) | render() {
class ObjectComponent (line 580) | class ObjectComponent extends Component {
method render (line 581) | render() {
FILE: packages/rax-server-renderer/src/__tests__/hooks.js
function Text (line 6) | function Text(props) {
function Counter (line 13) | function Counter(props) {
function Counter (line 23) | function Counter(props) {
function Counter (line 35) | function Counter() {
function reducer (line 50) | function reducer(state, action) {
function Counter (line 54) | function Counter() {
function reducer (line 64) | function reducer(state, action) {
function Counter (line 67) | function Counter() {
function reducer (line 77) | function reducer(state, action) {
function Counter (line 80) | function Counter() {
function CapitalizedText (line 96) | function CapitalizedText(props) {
function CapitalizedText (line 112) | function CapitalizedText(props) {
function computeA (line 117) | function computeA() {
function Counter (line 128) | function Counter() {
function Counter (line 140) | function Counter(props) {
function Counter (line 154) | function Counter(props) {
function Counter (line 166) | function Counter(props) {
function Counter (line 180) | function Counter(props, ref) {
function Counter (line 198) | function Counter() {
function Provider (line 215) | function Provider(props) {
function FooAndBar (line 224) | function FooAndBar() {
function Baz (line 230) | function Baz() {
class Indirection (line 235) | class Indirection extends Component {
method render (line 236) | render() {
function App (line 241) | function App(props) {
FILE: packages/rax-server-renderer/src/__tests__/lifecycle.js
class TestComponent (line 10) | class TestComponent extends Component {
method constructor (line 11) | constructor(props) {
method componentWillMount (line 17) | componentWillMount() {
method componentDidMount (line 21) | componentDidMount() {
method render (line 25) | render() {
method componentDidUpdate (line 30) | componentDidUpdate() {
method shouldComponentUpdate (line 34) | shouldComponentUpdate() {
method UNSAFE_componentWillReceiveProps (line 38) | UNSAFE_componentWillReceiveProps() {
method componentWillUnmount (line 42) | componentWillUnmount() {
FILE: packages/rax-server-renderer/src/__tests__/memo.js
function App (line 11) | function App(props) {
function Outer (line 20) | function Outer(props) {
FILE: packages/rax-server-renderer/src/__tests__/refs.js
function MyComponent (line 8) | function MyComponent() {
function MyComponent (line 19) | function MyComponent() {
FILE: packages/rax-server-renderer/src/__tests__/renderToString.js
class MyComponent (line 8) | class MyComponent {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
class MyComponent (line 19) | class MyComponent {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
class MyComponent (line 34) | class MyComponent {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 45) | function MyComponent(props, context) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 54) | function MyComponent(props, context) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 63) | function MyComponent(props, context) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 72) | function MyComponent(props, context) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 81) | function MyComponent(props) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 94) | function MyComponent(props) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyContext (line 113) | function MyContext() {
function MyComponent (line 121) | function MyComponent() {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyContext (line 136) | function MyContext() {
function MyComponent (line 144) | function MyComponent() {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 159) | function MyComponent() {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function reducer (line 174) | function reducer(state, action) {
function MyComponent (line 189) | function MyComponent({initialCount}) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function View (line 201) | function View(props) {
function MyComponent (line 207) | function MyComponent(props) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyComponent (line 240) | function MyComponent(props) {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyContext (line 261) | function MyContext() {
function MyComponent (line 269) | function MyComponent() {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyContext (line 290) | function MyContext() {
function MyComponent (line 298) | function MyComponent() {
method render (line 9) | render() {
method render (line 20) | render() {
method render (line 35) | render() {
function MyContext2 (line 306) | function MyContext2() {
function App (line 314) | function App() {
function MyContext (line 330) | function MyContext() {
function MyContext2 (line 336) | function MyContext2() {
function App (line 344) | function App() {
class ErrorBoundary (line 358) | class ErrorBoundary extends Component {
method constructor (line 359) | constructor(props) {
method componentDidCatch (line 363) | componentDidCatch(error, errorInfo) {
method render (line 367) | render() {
method constructor (line 393) | constructor(props) {
method componentDidCatch (line 397) | componentDidCatch(error, errorInfo) {
method render (line 401) | render() {
function MyWidget (line 372) | function MyWidget() {
function App (line 376) | function App() {
class ErrorBoundary (line 392) | class ErrorBoundary extends Component {
method constructor (line 359) | constructor(props) {
method componentDidCatch (line 363) | componentDidCatch(error, errorInfo) {
method render (line 367) | render() {
method constructor (line 393) | constructor(props) {
method componentDidCatch (line 397) | componentDidCatch(error, errorInfo) {
method render (line 401) | render() {
function MyWidget (line 406) | function MyWidget() {
function App (line 410) | function App() {
FILE: packages/rax-server-renderer/src/__tests__/styles.js
function MyComponent (line 96) | function MyComponent(props, context) {
function MyComponent (line 115) | function MyComponent(props, context) {
function MyComponent (line 136) | function MyComponent(props, context) {
function MyComponent (line 173) | function MyComponent(props, context) {
function MyComponent (line 217) | function MyComponent(props, context) {
function MyComponent (line 231) | function MyComponent(props, context) {
function MyComponent (line 252) | function MyComponent(props, context) {
function MyComponent (line 273) | function MyComponent(props, context) {
FILE: packages/rax-server-renderer/src/attribute.js
constant STRING (line 3) | const STRING = 1;
constant BOOLEANISH_STRING (line 9) | const BOOLEANISH_STRING = 2;
constant BOOLEAN (line 14) | const BOOLEAN = 3;
constant OVERLOADED_BOOLEAN (line 20) | const OVERLOADED_BOOLEAN = 4;
constant NUMERIC (line 24) | const NUMERIC = 5;
constant POSITIVE_NUMERIC (line 28) | const POSITIVE_NUMERIC = 6;
function getPropertyInfo (line 32) | function getPropertyInfo(prop) {
function shouldRemoveAttribute (line 36) | function shouldRemoveAttribute(prop, value) {
FILE: packages/rax-server-renderer/src/index.js
constant EMPTY_OBJECT (line 6) | const EMPTY_OBJECT = {};
constant VOID_ELEMENTS (line 8) | const VOID_ELEMENTS = {
constant TEXT_SPLIT_COMMENT (line 25) | const TEXT_SPLIT_COMMENT = '<!--|-->';
constant ERROR_COMMENT (line 26) | const ERROR_COMMENT = '<!--ERROR-->';
constant ESCAPE_LOOKUP (line 28) | const ESCAPE_LOOKUP = {
constant ESCAPE_REGEXP (line 36) | const ESCAPE_REGEXP = /[&><"']/g;
constant ESCAPE_TEST_REGEXP (line 37) | const ESCAPE_TEST_REGEXP = /[&><"']/;
function escaper (line 38) | function escaper(match) {
function escapeText (line 42) | function escapeText(text) {
function merge (line 50) | function merge(target) {
constant DEFAULT_STYLE_OPTIONS (line 62) | const DEFAULT_STYLE_OPTIONS = {
constant UPPERCASE_REGEXP (line 67) | const UPPERCASE_REGEXP = /[A-Z]/g;
constant NUMBER_REGEXP (line 68) | const NUMBER_REGEXP = /^[0-9]*$/;
function styleToCSS (line 71) | function styleToCSS(style, options = {}) {
function createMarkupForProperty (line 105) | function createMarkupForProperty(prop, value, options) {
function propsToString (line 153) | function propsToString(props, options) {
function checkContext (line 180) | function checkContext(element) {
method setState (line 195) | setState(component, partialState, callback) {
method forceState (line 204) | forceState(component, callback) {
class ServerReactiveComponent (line 212) | class ServerReactiveComponent {
method constructor (line 213) | constructor(pureRender, ref) {
method getHooks (line 228) | getHooks() {
method getHookID (line 232) | getHookID() {
method useContext (line 236) | useContext(context) {
method render (line 246) | render() {
function createInstance (line 253) | function createInstance(element, context) {
class ServerRenderer (line 294) | class ServerRenderer {
method constructor (line 295) | constructor(options) {
method renderElementToString (line 303) | renderElementToString(element, context) {
function throwInValidElementError (line 455) | function throwInValidElementError(element) {
function isPlainObject (line 462) | function isPlainObject(obj) {
function renderToString (line 466) | function renderToString(element, options) {
FILE: packages/rax-server/index.js
method constructor (line 8) | constructor(options = {}) {
method render (line 18) | async render(req, res, options) {
method renderToHTML (line 25) | async renderToHTML(req, res, options = {}) {
method logError (line 56) | logError(err) {
function getParsedUrl (line 61) | function getParsedUrl(req, pathname, query) {
class PageNotFoundError (line 75) | class PageNotFoundError extends Error {
method constructor (line 76) | constructor(page) {
function renderToHTML (line 82) | async function renderToHTML(req, res, options) {
function renderShell (line 139) | async function renderShell(options) {
function getInitialProps (line 165) | async function getInitialProps(Component, ctx) {
FILE: packages/rax-set-native-props/src/flexbox.js
constant BOX_ALIGN (line 1) | const BOX_ALIGN = {
constant BOX_ORIENT (line 8) | const BOX_ORIENT = {
constant BOX_PACK (line 13) | const BOX_PACK = {
constant FLEX_PROPS (line 21) | const FLEX_PROPS = {
method isFlexProp (line 32) | isFlexProp(prop) {
method display (line 35) | display(value, style = {}) {
method flex (line 44) | flex(value, style = {}) {
method flexWrap (line 50) | flexWrap(value, style = {}) {
method alignItems (line 55) | alignItems(value, style = {}) {
method alignSelf (line 61) | alignSelf(value, style = {}) {
method flexDirection (line 66) | flexDirection(value, style = {}) {
method justifyContent (line 72) | justifyContent(value, style = {}) {
FILE: packages/rax-set-native-props/src/index.js
constant ADD_EVENT (line 6) | const ADD_EVENT = 'addEvent';
constant DANGEROUSLY_SET_INNER_HTML (line 7) | const DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
constant CLASS_NAME (line 8) | const CLASS_NAME = 'className';
constant CLASS (line 9) | const CLASS = 'class';
constant STYLE (line 10) | const STYLE = 'style';
constant CHILDREN (line 11) | const CHILDREN = 'children';
constant EVENT_PREFIX_REGEXP (line 12) | const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
function hasOwnProperty (line 16) | function hasOwnProperty(obj, key) {
function setStyles (line 20) | function setStyles(node, styles) {
function addEventListener (line 47) | function addEventListener(node, eventName, eventHandler, props) {
function setAttribute (line 55) | function setAttribute(node, propKey, propValue) {
function setNativeProps (line 82) | function setNativeProps(node, props = {}) {
FILE: packages/rax-test-renderer/src/__tests__/renderer.js
function Link (line 16) | function Link() {
method render (line 29) | render() {
class Link (line 28) | class Link extends Component {
method render (line 29) | render() {
function Empty (line 56) | function Empty() {
class MyComponent (line 66) | class MyComponent extends Component {
method render (line 69) | render() {
method componentDidMount (line 80) | componentDidMount() {
class Mouse (line 111) | class Mouse extends Component {
method constructor (line 112) | constructor() {
method handleMoose (line 116) | handleMoose() {
method render (line 119) | render() {
class Log (line 156) | class Log extends Component {
method render (line 157) | render() {
method componentDidMount (line 161) | componentDidMount() {
method componentWillUnmount (line 164) | componentWillUnmount() {
class Foo (line 184) | class Foo extends Component {
method render (line 185) | render() {
FILE: packages/rax-test-renderer/src/__tests__/snapshot.js
constant STATUS (line 4) | const STATUS = {
class Link (line 9) | class Link extends Component {
method constructor (line 10) | constructor() {
method _onMouseEnter (line 21) | _onMouseEnter() {
method _onMouseLeave (line 25) | _onMouseLeave() {
method render (line 29) | render() {
FILE: packages/rax-test-renderer/src/escapeText.js
constant ESCAPE_LOOKUP (line 1) | const ESCAPE_LOOKUP = {
constant ESCAPE_REGEX (line 9) | const ESCAPE_REGEX = /[&><"']/g;
function escaper (line 11) | function escaper(match) {
function escapeText (line 15) | function escapeText(text) {
FILE: packages/rax-test-renderer/src/renderer.js
method create (line 11) | create(element) {
FILE: packages/rax-test-renderer/src/serializer.js
constant ELEMENT_NODE (line 4) | const ELEMENT_NODE = 1;
constant TEXT_NODE (line 5) | const TEXT_NODE = 3;
constant COMMENT_NODE (line 6) | const COMMENT_NODE = 8;
constant OMITTED_CLOSE_TAGS (line 10) | const OMITTED_CLOSE_TAGS = {
function quoteAttribute (line 34) | function quoteAttribute(prop, value) {
function createOpenTagMarkup (line 38) | function createOpenTagMarkup(tagName, style, attributes) {
class Serializer (line 57) | class Serializer {
method constructor (line 58) | constructor(node) {
method toJSON (line 63) | toJSON() {
method toJSONChildren (line 67) | toJSONChildren(parentNode, isTopLevel) {
method serialize (line 118) | serialize() {
method serializeChildren (line 123) | serializeChildren(parentNode) {
FILE: packages/rax-test-renderer/src/styleToCSS.js
function styleToCSS (line 2) | function styleToCSS(style) {
FILE: packages/rax-unmount-component-at-node/src/__tests__/unmountComponentAtNode.js
method createElement (line 23) | createElement() {
method removeAllEventListeners (line 28) | removeAllEventListeners() {}
FILE: packages/rax-unmount-component-at-node/src/index.js
function unmountComponentAtNode (line 5) | function unmountComponentAtNode(node) {
FILE: packages/rax/src/__tests__/asyncUpdate.js
function createNodeElement (line 11) | function createNodeElement(tagName) {
class Child (line 36) | class Child extends Component {
method componentDidMount (line 40) | componentDidMount() {
method render (line 47) | render() {
class App (line 52) | class App extends Component {
method componentDidMount (line 56) | componentDidMount() {
method render (line 63) | render() {
method componentDidMount (line 95) | componentDidMount() {
method render (line 102) | render() {
function Child (line 81) | function Child() {
method componentDidMount (line 40) | componentDidMount() {
method render (line 47) | render() {
class App (line 91) | class App extends Component {
method componentDidMount (line 56) | componentDidMount() {
method render (line 63) | render() {
method componentDidMount (line 95) | componentDidMount() {
method render (line 102) | render() {
FILE: packages/rax/src/__tests__/createContext.js
function createNodeElement (line 13) | function createNodeElement(tagName) {
function Consumer (line 38) | function Consumer(props) {
function App (line 46) | function App(props) {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function Provider (line 66) | function Provider(props) {
function Consumer (line 79) | function Consumer(props) {
class Indirection (line 87) | class Indirection extends Component {
method shouldComponentUpdate (line 88) | shouldComponentUpdate() {
method render (line 91) | render() {
method shouldComponentUpdate (line 134) | shouldComponentUpdate() {
method render (line 137) | render() {
method shouldComponentUpdate (line 185) | shouldComponentUpdate() {
method render (line 188) | render() {
function App (line 96) | function App(props) {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
class Indirection (line 133) | class Indirection extends Component {
method shouldComponentUpdate (line 88) | shouldComponentUpdate() {
method render (line 91) | render() {
method shouldComponentUpdate (line 134) | shouldComponentUpdate() {
method render (line 137) | render() {
method shouldComponentUpdate (line 185) | shouldComponentUpdate() {
method render (line 188) | render() {
class Owner (line 141) | class Owner extends Component {
method render (line 142) | render() {
function App (line 162) | function App(props) {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
class Indirection (line 184) | class Indirection extends Component {
method shouldComponentUpdate (line 88) | shouldComponentUpdate() {
method render (line 91) | render() {
method shouldComponentUpdate (line 134) | shouldComponentUpdate() {
method render (line 137) | render() {
method shouldComponentUpdate (line 185) | shouldComponentUpdate() {
method render (line 188) | render() {
class App (line 195) | class App extends Component {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
class Parent (line 226) | class Parent extends Component {
method render (line 227) | render() {
class App (line 232) | class App extends Component {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function Child (line 267) | function Child() {
function App (line 274) | function App(props) {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function Child (line 300) | function Child() {
class LegacyProvider (line 310) | class LegacyProvider extends Component {
method getChildContext (line 315) | getChildContext() {
method render (line 318) | render() {
class App (line 325) | class App extends Component {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
class ThemeProvider (line 376) | class ThemeProvider extends Component {
method render (line 380) | render() {
function ThemeDisplay (line 386) | function ThemeDisplay(props) {
function ThemeConsumer (line 391) | function ThemeConsumer() {
function OtherChild (line 399) | function OtherChild() {
function App (line 404) | function App() {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function Provider (line 428) | function Provider(props) {
function Consumer (line 441) | function Consumer(props) {
function App (line 449) | function App(props) {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function Provider (line 487) | function Provider(props) {
function Consumer (line 500) | function Consumer(props) {
function DynamicConsumer (line 510) | function DynamicConsumer(props) {
function App (line 517) | function App(props) {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function MyContext (line 543) | function MyContext() {
function MyComponent (line 551) | function MyComponent() {
function MyContext2 (line 559) | function MyContext2() {
function App (line 567) | function App() {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
function MyContext (line 585) | function MyContext() {
function MyContext2 (line 591) | function MyContext2() {
function App (line 599) | function App() {
method render (line 196) | render() {
method render (line 233) | render() {
method render (line 327) | render() {
FILE: packages/rax/src/__tests__/createElement.js
function createNodeElement (line 10) | function createNodeElement(tagName) {
function renderToDocument (line 21) | function renderToDocument(element) {
function Foo (line 38) | function Foo(props) {
class ParentComp (line 57) | class ParentComp {
method render (line 58) | render() {
class InnerComponent (line 78) | class InnerComponent extends Component {
method render (line 79) | render() {
class ComponentWrapper (line 84) | class ComponentWrapper extends Component {
method render (line 85) | render() {
function Foo (line 147) | function Foo(props) {
FILE: packages/rax/src/__tests__/forwardRef.js
function createNodeElement (line 12) | function createNodeElement(tagName) {
function FunctionComponent (line 34) | function FunctionComponent({forwardedRef, setRefOnDiv}) {
function FunctionComponent (line 90) | function FunctionComponent({forwardedRef, optional, required}) {
FILE: packages/rax/src/__tests__/fragment.js
function createNodeElement (line 11) | function createNodeElement(tagName) {
function F (line 109) | function F({ type }) {
function G (line 116) | function G({ type }) {
class App (line 123) | class App extends Component {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function F (line 152) | function F({ type }) {
function G (line 159) | function G({ type }) {
class App (line 166) | class App extends Component {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function F (line 208) | function F({ type }) {
class App (line 215) | class App extends Component {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function App (line 239) | function App(props) {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function App (line 277) | function App(props) {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function App (line 300) | function App(props) {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function App (line 331) | function App(props) {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function App (line 366) | function App(props) {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function App (line 400) | function App(props) {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
function F (line 435) | function F({ type }) {
class App (line 442) | class App extends Component {
method render (line 124) | render() {
method render (line 167) | render() {
method render (line 216) | render() {
method render (line 443) | render() {
FILE: packages/rax/src/__tests__/hooks.js
function createNodeElement (line 15) | function createNodeElement(tagName) {
function App (line 39) | function App(props) {
function Counter (line 54) | function Counter(props) {
function Counter (line 73) | function Counter() {
function Counter (line 101) | function Counter(props) {
function Counter (line 135) | function Counter(props) {
function Counter (line 184) | function Counter(props) {
function Counter (line 223) | function Counter(props) {
function Counter (line 265) | function Counter(props) {
function Counter (line 307) | function Counter(props) {
function Counter (line 337) | function Counter() {
function Consumer (line 364) | function Consumer(props) {
function App (line 372) | function App(props) {
function Counter (line 391) | function Counter() {
function Child (line 421) | function Child({text}) {
function Parent (line 428) | function Parent() {
function Child (line 532) | function Child({text}) {
function Parent (line 540) | function Parent({theme}) {
function ThemeProvider (line 610) | function ThemeProvider({children}) {
function Child (line 619) | function Child({text}) {
function Parent (line 625) | function Parent() {
function Parent (line 690) | function Parent() {
function Child (line 694) | function Child() {
function App (line 701) | function App() {
function useForceUpdate (line 731) | function useForceUpdate() {
function Child (line 736) | function Child() {
function App (line 747) | function App(props) {
function ScrollView (line 763) | function ScrollView({row: newRow}) {
function Counter (line 793) | function Counter({row: newRow}) {
function Counter (line 819) | function Counter({row: newRow}) {
function reducer (line 837) | function reducer(state, action) {
function Counter (line 840) | function Counter({row: newRow}) {
function reducerA (line 865) | function reducerA(state, action) {
function reducerB (line 873) | function reducerB(state, action) {
function Counter (line 881) | function Counter({row: newRow}, ref) {
function reducer (line 932) | function reducer(state, action) {
function Counter (line 943) | function Counter(props, ref) {
function reducer (line 988) | function reducer(state, action) {
function Text (line 999) | function Text(props) {
function Counter (line 1004) | function Counter(props, ref) {
function Child (line 1041) | function Child({text}) {
function reducer (line 1046) | function reducer(state, action) {
function Parent (line 1052) | function Parent() {
function Counter (line 1114) | function Counter(props) {
function LayoutEffect (line 1137) | function LayoutEffect(props) {
function PassiveEffect (line 1144) | function PassiveEffect(props) {
function PassiveEffect (line 1174) | function PassiveEffect(props) {
function LayoutEffect (line 1181) | function LayoutEffect(props) {
function Text (line 1211) | function Text(props) {
function PassiveEffect (line 1215) | function PassiveEffect(props) {
function LayoutEffect (line 1221) | function LayoutEffect(props) {
function Text (line 1248) | function Text(props) {
function getCommittedText (line 1252) | function getCommittedText() {
function Counter (line 1256) | function Counter(props) {
function Text (line 1289) | function Text(props) {
function Counter (line 1293) | function Counter(props) {
function Text (line 1323) | function Text(props) {
function Counter (line 1327) | function Counter(props) {
function Text (line 1358) | function Text(props) {
function Counter (line 1363) | function Counter(props) {
function Counter (line 1391) | function Counter(props) {
function Counter (line 1429) | function Counter(props) {
function Text (line 1464) | function Text(props) {
function Counter (line 1468) | function Counter(props) {
function Text (line 1499) | function Text(props) {
function Counter (line 1503) | function Counter(props) {
function Text (line 1528) | function Text(props) {
function Counter (line 1532) | function Counter(props) {
function Text (line 1565) | function Text(props) {
function effect (line 1569) | function effect() {
function Counter (line 1575) | function Counter(props) {
function Text (line 1603) | function Text(props) {
function Counter (line 1607) | function Counter(props) {
function Text (line 1640) | function Text(props) {
function Counter (line 1644) | function Counter(props) {
function Text (line 1682) | function Text(props) {
function Counter (line 1686) | function Counter({count}) {
function App (line 1739) | function App() {
function Counter (line 1770) | function Counter(props) {
function Text (line 1817) | function Text(props) {
function CapitalizedText (line 1822) | function CapitalizedText(props) {
function Text (line 1858) | function Text(props) {
function LazyCompute (line 1862) | function LazyCompute(props) {
function computeA (line 1867) | function computeA() {
function computeB (line 1872) | function computeB() {
function Text (line 1897) | function Text(props) {
function LazyCompute (line 1901) | function LazyCompute(props) {
function compute (line 1912) | function compute(val) {
function Text (line 1935) | function Text(props) {
function reducer (line 1940) | function reducer(state, action) {
function Counter (line 1944) | function Counter(props, ref) {
function Text (line 1967) | function Text(props) {
function reducer (line 1972) | function reducer(state, action) {
function Counter (line 1976) | function Counter(props, ref) {
function Text (line 1998) | function Text(props) {
function reducer (line 2003) | function reducer(state, action) {
function Counter (line 2008) | function Counter(props, ref) {
FILE: packages/rax/src/__tests__/memo.js
function createNodeElement (line 10) | function createNodeElement(tagName) {
function App (line 34) | function App(props) {
function Outer (line 41) | function Outer(props) {
FILE: packages/rax/src/__tests__/render.js
function createNodeElement (line 10) | function createNodeElement(tagName) {
method createElement (line 35) | createElement() {
method createBody (line 38) | createBody() {
method beforeRender (line 74) | beforeRender() {
method afterRender (line 77) | afterRender() {
class App (line 121) | class App extends Component {
method componentDidMount (line 122) | componentDidMount() {
method render (line 129) | render() {
FILE: packages/rax/src/constant.js
constant INTERNAL (line 3) | const INTERNAL = '_internal';
constant INSTANCE (line 4) | const INSTANCE = '_instance';
constant NATIVE_NODE (line 5) | const NATIVE_NODE = '_nativeNode';
constant RENDERED_COMPONENT (line 6) | const RENDERED_COMPONENT = '_renderedComponent';
FILE: packages/rax/src/createContext.js
function createContext (line 9) | function createContext(defaultValue) {
FILE: packages/rax/src/createElement.js
constant RESERVED_PROPS (line 8) | const RESERVED_PROPS = {
function createElement (line 13) | function createElement(type, config, children) {
FILE: packages/rax/src/createRef.js
function createRef (line 1) | function createRef() {
FILE: packages/rax/src/debug/dump.js
constant INDENTATION_SIZE (line 4) | const INDENTATION_SIZE = 2;
constant MAX_DEPTH (line 5) | const MAX_DEPTH = 2;
constant MAX_STRING_LENGTH (line 6) | const MAX_STRING_LENGTH = 50;
function dumpTree (line 13) | function dumpTree() {
function getDumpTree (line 21) | function getDumpTree() {
function dumpNode (line 33) | function dumpNode(node, identation) {
function isNormalProp (line 70) | function isNormalProp(name) {
function convertObject (line 81) | function convertObject(object, depth) {
function convertValue (line 98) | function convertValue(value, depth = 0) {
function possiblyEllipsis (line 118) | function possiblyEllipsis(value) {
function indent (line 126) | function indent(size) {
FILE: packages/rax/src/debug/getComponentTree.js
constant CURRENT_ELEMENT (line 3) | const CURRENT_ELEMENT = '__currentElement';
function getComponentTree (line 5) | function getComponentTree(element) {
function childrenList (line 90) | function childrenList(children) {
FILE: packages/rax/src/devtools/index.js
method getClosestInstanceFromNode (line 8) | getClosestInstanceFromNode(node) {
method getNodeFromInstance (line 11) | getNodeFromInstance(inst) {
method _instancesByReactRootID (line 25) | get _instancesByReactRootID() {
FILE: packages/rax/src/devtools/reconciler.js
method mountComponent (line 5) | mountComponent() {}
method receiveComponent (line 6) | receiveComponent() {}
method unmountComponent (line 7) | unmountComponent() {}
method renderNewRootComponent (line 10) | renderNewRootComponent() {}
FILE: packages/rax/src/error.js
function createMinifiedError (line 5) | function createMinifiedError(type, code, obj) {
function getTypeInfo (line 10) | function getTypeInfo(obj) {
function getRenderErrorInfo (line 14) | function getRenderErrorInfo() {
function throwMinifiedError (line 28) | function throwMinifiedError(code, obj) {
function throwMinifiedWarn (line 40) | function throwMinifiedWarn(code, obj) {
function throwError (line 47) | function throwError(message, obj) {
FILE: packages/rax/src/fragment.js
function Fragment (line 1) | function Fragment(props) {
FILE: packages/rax/src/hooks.js
function getCurrentInstance (line 8) | function getCurrentInstance() {
function getCurrentRenderingInstance (line 12) | function getCurrentRenderingInstance() {
function areInputsEqual (line 25) | function areInputsEqual(inputs, prevInputs) {
function useState (line 39) | function useState(initialState) {
function useContext (line 93) | function useContext(context) {
function useEffect (line 98) | function useEffect(effect, inputs) {
function useLayoutEffect (line 102) | function useLayoutEffect(effect, inputs) {
function useEffectImpl (line 106) | function useEffectImpl(effect, inputs, defered) {
function useImperativeHandle (line 190) | function useImperativeHandle(ref, create, inputs) {
function useRef (line 206) | function useRef(initialValue) {
function useCallback (line 220) | function useCallback(callback, inputs) {
function useMemo (line 224) | function useMemo(create, inputs) {
function useReducer (line 242) | function useReducer(reducer, initialArg, init) {
FILE: packages/rax/src/invokeFunctionsWithContext.js
function invokeFunctionsWithContext (line 1) | function invokeFunctionsWithContext(fns, context, value) {
FILE: packages/rax/src/memo.js
function memo (line 3) | function memo(type, compare) {
FILE: packages/rax/src/render.js
function render (line 9) | function render(element, container, options, callback) {
FILE: packages/rax/src/toArray.js
function toArray (line 3) | function toArray(obj) {
FILE: packages/rax/src/types.js
function isNull (line 1) | function isNull(obj) {
function isFunction (line 5) | function isFunction(obj) {
function isObject (line 9) | function isObject(obj) {
function isPlainObject (line 13) | function isPlainObject(obj) {
function isArray (line 17) | function isArray(array) {
function isString (line 21) | function isString(string) {
function isNumber (line 25) | function isNumber(string) {
function isFalsy (line 29) | function isFalsy(val) {
constant EMPTY_OBJECT (line 34) | const EMPTY_OBJECT = {};
FILE: packages/rax/src/validateChildKeys.js
function getCurrentComponentErrorInfo (line 12) | function getCurrentComponentErrorInfo(parentType) {
function isValidElement (line 35) | function isValidElement(object) {
function validateExplicitKey (line 39) | function validateExplicitKey(element, parentType) {
function validateChildKeys (line 68) | function validateChildKeys(node, parentType) {
FILE: packages/rax/src/vdom/__tests__/component.js
class Foo (line 8) | class Foo extends Component { }
method render (line 21) | render() {
method render (line 34) | render() {
method constructor (line 48) | constructor(props) {
method render (line 52) | render() {
class Foo (line 13) | class Foo extends Component { }
method render (line 21) | render() {
method render (line 34) | render() {
method constructor (line 48) | constructor(props) {
method render (line 52) | render() {
class Foo (line 20) | class Foo extends Component {
method render (line 21) | render() {
method render (line 34) | render() {
method constructor (line 48) | constructor(props) {
method render (line 52) | render() {
class Foo (line 33) | class Foo extends Component {
method render (line 21) | render() {
method render (line 34) | render() {
method constructor (line 48) | constructor(props) {
method render (line 52) | render() {
class Foo (line 47) | class Foo extends Component {
method render (line 21) | render() {
method render (line 34) | render() {
method constructor (line 48) | constructor(props) {
method render (line 52) | render() {
FILE: packages/rax/src/vdom/__tests__/composite.js
function createNodeElement (line 10) | function createNodeElement(tagName) {
class MyComponent (line 32) | class MyComponent extends Component {
method render (line 39) | render() {
method render (line 223) | render() {
method render (line 1179) | render() {
class Foo (line 58) | class Foo extends Component {
method constructor (line 59) | constructor() {
method componentWillMount (line 63) | componentWillMount() {
method render (line 68) | render() {
method constructor (line 83) | constructor() {
method componentWillMount (line 87) | componentWillMount() {
method componentWillReceiveProps (line 94) | componentWillReceiveProps() {
method render (line 101) | render() {
method constructor (line 122) | constructor() {
method componentDidMount (line 128) | componentDidMount() {
method componentDidUpdate (line 136) | componentDidUpdate() {
method render (line 146) | render() {
method constructor (line 161) | constructor() {
method componentWillMount (line 165) | componentWillMount() {
method componentDidMount (line 169) | componentDidMount() {
method componentWillReceiveProps (line 172) | componentWillReceiveProps(nextProps) {
method shouldComponentUpdate (line 178) | shouldComponentUpdate(nextProps, nextState) {
method componentWillUpdate (line 182) | componentWillUpdate(nextProps, nextState) {
method componentDidUpdate (line 185) | componentDidUpdate(prevProps, prevState) {
method componentWillUnmount (line 188) | componentWillUnmount() {
method render (line 191) | render() {
method componentDidMount (line 881) | componentDidMount() {
method componentDidUpdate (line 888) | componentDidUpdate() {
method render (line 898) | render() {
method componentDidMount (line 937) | componentDidMount() {
method render (line 946) | render() {
class Foo (line 82) | class Foo extends Component {
method constructor (line 59) | constructor() {
method componentWillMount (line 63) | componentWillMount() {
method render (line 68) | render() {
method constructor (line 83) | constructor() {
method componentWillMount (line 87) | componentWillMount() {
method componentWillReceiveProps (line 94) | componentWillReceiveProps() {
method render (line 101) | render() {
method constructor (line 122) | constructor() {
method componentDidMount (line 128) | componentDidMount() {
method componentDidUpdate (line 136) | componentDidUpdate() {
method render (line 146) | render() {
method constructor (line 161) | constructor() {
method componentWillMount (line 165) | componentWillMount() {
method componentDidMount (line 169) | componentDidMount() {
method componentWillReceiveProps (line 172) | componentWillReceiveProps(nextProps) {
method shouldComponentUpdate (line 178) | shouldComponentUpdate(nextProps, nextState) {
method componentWillUpdate (line 182) | componentWillUpdate(nextProps, nextState) {
method componentDidUpdate (line 185) | componentDidUpdate(prevProps, prevState) {
method componentWillUnmount (line 188) | componentWillUnmount() {
method render (line 191) | render() {
method componentDidMount (line 881) | componentDidMount() {
method componentDidUpdate (line 888) | componentDidUpdate() {
method render (line 898) | render() {
method componentDidMount (line 937) | componentDidMount() {
method render (line 946) | render() {
class Foo (line 121) | class Foo extends Component {
method constructor (line 59) | constructor() {
method componentWillMount (line 63) | componentWillMount() {
method render (line 68) | render() {
method constructor (line 83) | constructor() {
method componentWillMount (line 87) | componentWillMount() {
method componentWillReceiveProps (line 94) | componentWillReceiveProps() {
method render (line 101) | render() {
method constructor (line 122) | constructor() {
method componentDidMount (line 128) | componentDidMount() {
method componentDidUpdate (line 136) | componentDidUpdate() {
method render (line 146) | render() {
method constructor (line 161) | constructor() {
method componentWillMount (line 165) | componentWillMount() {
method componentDidMount (line 169) | componentDidMount() {
method componentWillReceiveProps (line 172) | componentWillReceiveProps(nextProps) {
method shouldComponentUpdate (line 178) | shouldComponentUpdate(nextProps, nextState) {
method componentWillUpdate (line 182) | componentWillUpdate(nextProps, nextState) {
method componentDidUpdate (line 185) | componentDidUpdate(prevProps, prevState) {
method componentWillUnmount (line 188) | componentWillUnmount() {
method render (line 191) | render() {
method componentDidMount (line 881) | componentDidMount() {
method componentDidUpdate (line 888) | componentDidUpdate() {
method render (line 898) | render() {
method componentDidMount (line 937) | componentDidMount() {
method render (line 946) | render() {
class Foo (line 160) | class Foo extends Component {
method constructor (line 59) | constructor() {
method componentWillMount (line 63) | componentWillMount() {
method render (line 68) | render() {
method constructor (line 83) | constructor() {
method componentWillMount (line 87) | componentWillMount() {
method componentWillReceiveProps (line 94) | componentWillReceiveProps() {
method render (line 101) | render() {
method constructor (line 122) | constructor() {
method componentDidMount (line 128) | componentDidMount() {
method componentDidUpdate (line 136) | componentDidUpdate() {
method render (line 146) | render() {
method constructor (line 161) | constructor() {
method componentWillMount (line 165) | componentWillMount() {
method componentDidMount (line 169) | componentDidMount() {
method componentWillReceiveProps (line 172) | componentWillReceiveProps(nextProps) {
method shouldComponentUpdate (line 178) | shouldComponentUpdate(nextProps, nextState) {
method componentWillUpdate (line 182) | componentWillUpdate(nextProps, nextState) {
method componentDidUpdate (line 185) | componentDidUpdate(prevProps, prevState) {
method componentWillUnmount (line 188) | componentWillUnmount() {
method render (line 191) | render() {
method componentDidMount (line 881) | componentDidMount() {
method componentDidUpdate (line 888) | componentDidUpdate() {
method render (line 898) | render() {
method componentDidMount (line 937) | componentDidMount() {
method render (line 946) | render() {
class MyComponent (line 222) | class MyComponent extends Component {
method render (line 39) | render() {
method render (line 223) | render() {
method render (line 1179) | render() {
class BrokenRender (line 231) | class BrokenRender extends Component {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class NoBrokenRender (line 242) | class NoBrokenRender extends Component {
method render (line 243) | render() {
class ErrorBoundary (line 260) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
function BrokenRender (line 275) | function BrokenRender(props) {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 290) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
class BrokenRender (line 305) | class BrokenRender extends Component {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 335) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
class BrokenRender (line 350) | class BrokenRender extends Component {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 371) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
class BrokenRender (line 386) | class BrokenRender extends Component {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class BrokenRender (line 407) | class BrokenRender extends Component {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class Parent (line 430) | class Parent extends Component {
method componentWillUnmount (line 431) | componentWillUnmount() {
method render (line 434) | render() {
method componentDidUpdate (line 964) | componentDidUpdate() {
method render (line 968) | render() {
class Boundary (line 439) | class Boundary extends Component {
method componentDidCatch (line 440) | componentDidCatch(e) {
method render (line 443) | render() {
class ThrowsOnUnmount (line 448) | class ThrowsOnUnmount extends Component {
method componentWillUnmount (line 449) | componentWillUnmount() {
method render (line 453) | render() {
function BrokenRender (line 469) | function BrokenRender() {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 472) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
class ErrorBoundary (line 501) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
function BrokenRender (line 520) | function BrokenRender() {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 534) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
class Life1 (line 555) | class Life1 extends Component {
method componentWillMount (line 556) | componentWillMount() {
method render (line 559) | render() {
method componentDidMount (line 563) | componentDidMount() {
method componentWillUpdate (line 567) | componentWillUpdate() {
method componentDidUpdate (line 570) | componentDidUpdate() {
method componentWillUnmount (line 573) | componentWillUnmount() {
class Life2 (line 578) | class Life2 extends Component {
method componentWillMount (line 579) | componentWillMount() {
method render (line 582) | render() {
method componentDidMount (line 586) | componentDidMount() {
method componentWillUpdate (line 589) | componentWillUpdate() {
method componentDidUpdate (line 592) | componentDidUpdate() {
method componentWillUnmount (line 595) | componentWillUnmount() {
class Life3 (line 600) | class Life3 extends Component {
method componentWillMount (line 601) | componentWillMount() {
method render (line 604) | render() {
method componentDidMount (line 608) | componentDidMount() {
method componentWillUpdata (line 611) | componentWillUpdata() {
method componentDidUpdate (line 614) | componentDidUpdate() {
method componentWillUnmount (line 617) | componentWillUnmount() {
class Child (line 652) | class Child extends Component {
method render (line 656) | render() {
method componentDidMount (line 832) | componentDidMount() {
method render (line 835) | render() {
method componentDidMount (line 853) | componentDidMount() {
method render (line 856) | render() {
method componentDidUpdate (line 978) | componentDidUpdate() {
method render (line 982) | render() {
method componentDidUpdate (line 1080) | componentDidUpdate() {
method componentDidMount (line 1083) | componentDidMount() {
method render (line 1088) | render() {
class ErrorBoundary (line 667) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
class ErrorBoundary (line 695) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
function BrokenRender (line 718) | function BrokenRender(props) {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 733) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
function BrokenRender (line 752) | function BrokenRender(props) {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class ErrorBoundary (line 770) | class ErrorBoundary extends Component {
method componentDidCatch (line 262) | componentDidCatch(error) {
method render (line 265) | render() {
method componentDidCatch (line 292) | componentDidCatch(error) {
method render (line 295) | render() {
method componentDidCatch (line 337) | componentDidCatch(error) {
method render (line 340) | render() {
method componentDidCatch (line 373) | componentDidCatch(error) {
method render (line 376) | render() {
method componentDidCatch (line 474) | componentDidCatch(error) {
method render (line 477) | render() {
method componentDidCatch (line 503) | componentDidCatch(error) {
method render (line 506) | render() {
method componentDidCatch (line 536) | componentDidCatch(error) {
method componentDidMount (line 539) | componentDidMount() {
method componentDidUpdate (line 542) | componentDidUpdate() {
method render (line 545) | render() {
method componentDidCatch (line 669) | componentDidCatch(error) {
method render (line 672) | render() {
method constructor (line 696) | constructor(props) {
method getDerivedStateFromError (line 701) | static getDerivedStateFromError(error) {
method componentDidCatch (line 705) | componentDidCatch(error, errorInfo) {
method render (line 709) | render() {
method constructor (line 734) | constructor(props) {
method getDerivedStateFromError (line 739) | static getDerivedStateFromError(error) {
method render (line 743) | render() {
method constructor (line 771) | constructor(props) {
method getDerivedStateFromError (line 776) | static getDerivedStateFromError(error) {
method render (line 781) | render() {
function BrokenRender (line 790) | function BrokenRender(props) {
method constructor (line 232) | constructor() {
method render (line 235) | render() {
method componentDidMount (line 307) | componentDidMount() {
method render (line 314) | render() {
method componentDidMount (line 351) | componentDidMount() {
method render (line 354) | render() {
method constructor (line 387) | constructor() {
method render (line 390) | render() {
method componentDidCatch (line 409) | componentDidCatch(error) {
method render (line 412) | render() {
class Frag (line 807) | class Frag extends Component {
method render (line 808) | render() {
class App (line 812) | class App extends Component {
method render (line 814) | render() {
method render (line 840) | render() {
method render (line 861) | render() {
method render (line 1134) | render() {
method componentWillReceiveProps (line 1235) | componentWillReceiveProps() {
method render (line 1240) | render() {
class Child (line 831) | class Child extends Component {
method render (line 656) | render() {
method componentDidMount (line 832) | componentDidMount() {
method render (line 835) | render() {
method componentDidMount (line 853) | componentDidMount() {
method render (line 856) | render() {
method componentDidUpdate (line 978) | componentDidUpdate() {
method render (line 982) | render() {
method componentDidUpdate (line 1080) | componentDidUpdate() {
method componentDidMount (line 1083) | componentDidMount() {
method render (line 1088) | render() {
class App (line 839) | class App extends Component {
method render (line 814) | render() {
method render (line 840) | render() {
method render (line 861) | render() {
method render (line 1134) | render() {
method componentWillReceiveProps (line 1235) | componentWillReceiveProps() {
method render (line 1240) | render() {
class Child (line 852) | class Child extends Component {
method render (line 656) | render() {
method componentDidMount (line 832) | componentDidMount() {
method render (line 835) | render() {
method componentDidMount (line 853) | componentDidMount() {
method render (line 856) | render() {
method componentDidUpdate (line 978) | componentDidUpdate() {
method render (line 982) | render() {
method componentDidUpdate (line 1080) | componentDidUpdate() {
method componentDidMount (line 1083) | componentDidMount() {
method render (line 1088) | render() {
class App (line 860) | class App extends Component {
method render (line 814) | render() {
method render (line 840) | render() {
method render (line 861) | render() {
method render (line 1134) | render() {
method componentWillReceiveProps (line 1235) | componentWillReceiveProps() {
method render (line 1240) | render() {
class Foo (line 878) | class Foo extends Component {
method constructor (line 59) | constructor() {
method componentWillMount (line 63) | componentWillMount() {
method render (line 68) | render() {
method constructor (line 83) | constructor() {
method componentWillMount (line 87) | componentWillMount() {
method componentWillReceiveProps (line 94) | componentWillReceiveProps() {
method render (line 101) | render() {
method constructor (line 122) | constructor() {
method componentDidMount (line 128) | componentDidMount() {
method componentDidUpdate (line 136) | componentDidUpdate() {
method render (line 146) | render() {
method constructor (line 161) | constructor() {
method componentWillMount (line 165) | componentWillMount() {
method componentDidMount (line 169) | componentDidMount() {
method componentWillReceiveProps (line 172) | componentWillReceiveProps(nextProps) {
method shouldComponentUpdate (line 178) | shouldComponentUpdate(nextProps, nextState) {
method componentWillUpdate (line 182) | componentWillUpdate(nextProps, nextState) {
method componentDidUpdate (line 185) | componentDidUpdate(prevProps, prevState) {
method componentWillUnmount (line 188) | componentWillUnmount() {
method render (line 191) | render() {
method componentDidMount (line 881) | componentDidMount() {
method componentDidUpdate (line 888) | componentDidUpdate() {
method render (line 898) | render() {
method componentDidMount (line 937) | componentDidMount() {
method render (line 946) | render() {
class Foo (line 935) | class Foo extends Component {
method constructor (line 59) | constructor() {
method componentWillMount (line 63) | componentWillMount() {
method render (line 68) | render() {
method constructor (line 83) | constructor() {
method componentWillMount (line 87) | componentWillMount() {
method componentWillReceiveProps (line 94) | componentWillReceiveProps() {
method render (line 101) | render() {
method constructor (line 122) | constructor() {
method componentDidMount (line 128) | componentDidMount() {
method componentDidUpdate (line 136) | componentDidUpdate() {
method render (line 146) | render() {
method constructor (line 161) | constructor() {
method componentWillMount (line 165) | componentWillMount() {
method componentDidMount (line 169) | componentDidMount() {
method componentWillReceiveProps (line 172) | componentWillReceiveProps(nextProps) {
method shouldComponentUpdate (line 178) | shouldComponentUpdate(nextProps, nextState) {
method componentWillUpdate (line 182) | componentWillUpdate(nextProps, nextState) {
method componentDidUpdate (line 185) | componentDidUpdate(prevProps, prevState) {
method componentWillUnmount (line 188) | componentWillUnmount() {
method render (line 191) | render() {
method componentDidMount (line 881) | componentDidMount() {
method componentDidUpdate (line 888) | componentDidUpdate() {
method render (line 898) | render() {
method componentDidMount (line 937) | componentDidMount() {
method render (line 946) | render() {
class Parent (line 961) | class Parent extends Component {
method componentWillUnmount (line 431) | componentWillUnmount() {
method render (line 434) | render() {
method componentDidUpdate (line 964) | componentDidUpdate() {
method render (line 968) | render() {
class Child (line 975) | class Child extends Component {
method render (line 656) | render() {
method componentDidMount (line 832) | componentDidMount() {
method render (line 835) | render() {
method componentDidMount (line 853) | componentDidMount() {
method render (line 856) | render() {
method componentDidUpdate (line 978) | componentDidUpdate() {
method render (line 982) | render() {
method componentDidUpdate (line 1080) | componentDidUpdate() {
method componentDidMount (line 1083) | componentDidMount() {
method render (line 1088) | render() {
class Child2 (line 989) | class Child2 extends Component {
method componentDidUpdate (line 992) | componentDidUpdate() {
method render (line 996) | render() {
method render (line 1228) | render() {
function Batch (line 1008) | function Batch() {
class B (line 1039) | class B extends Component {
method componentDidMount (line 1042) | componentDidMount() {
method render (line 1046) | render() {
class A (line 1052) | class A extends Component {
method render (line 1055) | render() {
function Batch (line 1061) | function Batch() {
class Child (line 1076) | class Child extends Component {
method render (line 656) | render() {
method componentDidMount (line 832) | componentDidMount() {
method render (line 835) | render() {
method componentDidMount (line 853) | componentDidMount() {
method render (line 856) | render() {
method componentDidUpdate (line 978) | componentDidUpdate() {
method render (line 982) | render() {
method componentDidUpdate (line 1080) | componentDidUpdate() {
method componentDidMount (line 1083) | componentDidMount() {
method render (line 1088) | render() {
class Parent1 (line 1098) | class Parent1 extends Component {
method componentDidUpdate (line 1102) | componentDidUpdate() {
method componentDidMount (line 1105) | componentDidMount() {
method render (line 1109) | render() {
class Parent2 (line 1114) | class Parent2 extends Component {
method shouldComponentUpdate (line 1118) | shouldComponentUpdate() {
method componentDidUpdate (line 1121) | componentDidUpdate() {
method componentDidMount (line 1124) | componentDidMount() {
method render (line 1128) | render() {
class App (line 1133) | class App extends Component {
method render (line 814) | render() {
method render (line 840) | render() {
method render (line 861) | render() {
method render (line 1134) | render() {
method componentWillReceiveProps (line 1235) | componentWillReceiveProps() {
method render (line 1240) | render() {
class Hello1 (line 1150) | class Hello1 extends Component {
method render (line 1151) | render() {
class Text (line 1159) | class Text extends Component {
method render (line 1160) | render() {
class Hello2 (line 1165) | class Hello2 extends Component {
method render (line 1166) | render() {
class MyComponent (line 1175) | class MyComponent extends Component {
method render (line 39) | render() {
method render (line 223) | render() {
method render (line 1179) | render() {
class Child1 (line 1220) | class Child1 extends Component {
method render (line 1221) | render() {
class Child2 (line 1227) | class Child2 extends Component {
method componentDidUpdate (line 992) | componentDidUpdate() {
method render (line 996) | render() {
method render (line 1228) | render() {
class App (line 1234) | class App extends Component {
method render (line 814) | render() {
method render (line 840) | render() {
method render (line 861) | render() {
method render (line 1134) | render() {
method componentWillReceiveProps (line 1235) | componentWillReceiveProps() {
method render (line 1240) | render() {
FILE: packages/rax/src/vdom/__tests__/context.js
function createNodeElement (line 12) | function createNodeElement(tagName) {
class MyComponent (line 36) | class MyComponent extends Component {
method render (line 41) | render() {
method render (line 72) | render() {
method render (line 108) | render() {
class Parent (line 46) | class Parent extends Component {
method getChildContext (line 51) | getChildContext() {
method render (line 57) | render() {
method getChildContext (line 123) | getChildContext() {
method render (line 130) | render() {
class MyComponent (line 67) | class MyComponent extends Component {
method render (line 41) | render() {
method render (line 72) | render() {
method render (line 108) | render() {
class ComponentInFooBarContext (line 77) | class ComponentInFooBarContext extends Component {
method getChildContext (line 83) | getChildContext() {
method render (line 90) | render() {
class MyComponent (line 102) | class MyComponent extends Component {
method render (line 41) | render() {
method render (line 72) | render() {
method render (line 108) | render() {
class Parent (line 113) | class Parent extends Component {
method getChildContext (line 51) | getChildContext() {
method render (line 57) | render() {
method getChildContext (line 123) | getChildContext() {
method render (line 130) | render() {
FILE: packages/rax/src/vdom/__tests__/empty.js
function createNodeElement (line 22) | function createNodeElement(tagName) {
class Foo (line 34) | class Foo extends PureComponent {
method render (line 38) | render() {
method render (line 65) | render() {
method render (line 93) | render() {
method render (line 120) | render() {
class Foo (line 61) | class Foo extends PureComponent {
method render (line 38) | render() {
method render (line 65) | render() {
method render (line 93) | render() {
method render (line 120) | render() {
class Foo (line 89) | class Foo extends PureComponent {
method render (line 38) | render() {
method render (line 65) | render() {
method render (line 93) | render() {
method render (line 120) | render() {
class Foo (line 116) | class Foo extends PureComponent {
method render (line 38) | render() {
method render (line 65) | render() {
method render (line 93) | render() {
method render (line 120) | render() {
FILE: packages/rax/src/vdom/__tests__/fragment.js
function createNodeElement (line 13) | function createNodeElement(tagName) {
class Hello (line 46) | class Hello extends Component {
method render (line 47) | render() {
method render (line 139) | render() {
method render (line 192) | render() {
method render (line 221) | render() {
method render (line 252) | render() {
method render (line 299) | render() {
class Hello1 (line 74) | class Hello1 extends Component {
method render (line 75) | render() {
class Hello2 (line 83) | class Hello2 extends Component {
method render (line 84) | render() {
class MyComponent (line 92) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class Hello (line 138) | class Hello extends Component {
method render (line 47) | render() {
method render (line 139) | render() {
method render (line 192) | render() {
method render (line 221) | render() {
method render (line 252) | render() {
method render (line 299) | render() {
class World (line 147) | class World extends Component {
method render (line 148) | render() {
class MyComponent (line 156) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class Hello (line 191) | class Hello extends Component {
method render (line 47) | render() {
method render (line 139) | render() {
method render (line 192) | render() {
method render (line 221) | render() {
method render (line 252) | render() {
method render (line 299) | render() {
class MyComponent (line 197) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class Hello (line 220) | class Hello extends Component {
method render (line 47) | render() {
method render (line 139) | render() {
method render (line 192) | render() {
method render (line 221) | render() {
method render (line 252) | render() {
method render (line 299) | render() {
class MyComponent (line 226) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class Hello (line 251) | class Hello extends Component {
method render (line 47) | render() {
method render (line 139) | render() {
method render (line 192) | render() {
method render (line 221) | render() {
method render (line 252) | render() {
method render (line 299) | render() {
class MyComponent (line 258) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class Hello (line 298) | class Hello extends Component {
method render (line 47) | render() {
method render (line 139) | render() {
method render (line 192) | render() {
method render (line 221) | render() {
method render (line 252) | render() {
method render (line 299) | render() {
class MyComponent (line 304) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class MyComponent (line 330) | class MyComponent extends Component {
method render (line 96) | render() {
method componentDidMount (line 160) | componentDidMount() {
method render (line 166) | render() {
method render (line 198) | render() {
method render (line 227) | render() {
method render (line 259) | render() {
method render (line 305) | render() {
method componentWillMount (line 335) | componentWillMount() {
method render (line 341) | render() {
class Frag (line 384) | class Frag extends Component {
method render (line 385) | render() {
method render (line 420) | render() {
method render (line 455) | render() {
method render (line 471) | render() {
class App (line 390) | class App extends Component {
method render (line 392) | render() {
method render (line 427) | render() {
method render (line 478) | render() {
method componentDidMount (line 520) | componentDidMount() {
method render (line 527) | render() {
method render (line 565) | render() {
class Frag (line 419) | class Frag extends Component {
method render (line 385) | render() {
method render (line 420) | render() {
method render (line 455) | render() {
method render (line 471) | render() {
class App (line 425) | class App extends Component {
method render (line 392) | render() {
method render (line 427) | render() {
method render (line 478) | render() {
method componentDidMount (line 520) | componentDidMount() {
method render (line 527) | render() {
method render (line 565) | render() {
class Frag (line 454) | class Frag extends Component {
method render (line 385) | render() {
method render (line 420) | render() {
method render (line 455) | render() {
method render (line 471) | render() {
class Frag (line 470) | class Frag extends Component {
method render (line 385) | render() {
method render (line 420) | render() {
method render (line 455) | render() {
method render (line 471) | render() {
class App (line 476) | class App extends Component {
method render (line 392) | render() {
method render (line 427) | render() {
method render (line 478) | render() {
method componentDidMount (line 520) | componentDidMount() {
method render (line 527) | render() {
method render (line 565) | render() {
class App (line 515) | class App extends Component {
method render (line 392) | render() {
method render (line 427) | render() {
method render (line 478) | render() {
method componentDidMount (line 520) | componentDidMount() {
method render (line 527) | render() {
method render (line 565) | render() {
class Child (line 551) | class Child extends Component {
method render (line 556) | render() {
class App (line 564) | class App extends Component {
method render (line 392) | render() {
method render (line 427) | render() {
method render (line 478) | render() {
method componentDidMount (line 520) | componentDidMount() {
method render (line 527) | render() {
method render (line 565) | render() {
FILE: packages/rax/src/vdom/__tests__/key.js
function createNodeElement (line 12) | function createNodeElement(tagName) {
class MyComponent (line 39) | class MyComponent extends Component {
method render (line 42) | render() {
class Foo (line 71) | class Foo extends Component {
method render (line 76) | render() {
method constructor (line 105) | constructor(props) {
method componentWillReceiveProps (line 112) | componentWillReceiveProps() {
method render (line 116) | render() {
class Foo (line 104) | class Foo extends Component {
method render (line 76) | render() {
method constructor (line 105) | constructor(props) {
method componentWillReceiveProps (line 112) | componentWillReceiveProps() {
method render (line 116) | render() {
class App (line 137) | class App extends Component {
method render (line 139) | render() {
method render (line 165) | render() {
class App (line 164) | class App extends Component {
method render (line 139) | render() {
method render (line 165) | render() {
FILE: packages/rax/src/vdom/__tests__/native.js
function createNodeElement (line 12) | function createNodeElement(tagName) {
class Hello1 (line 78) | class Hello1 extends Component {
method render (line 79) | render() {
class Hello2 (line 87) | class Hello2 extends Component {
method render (line 88) | render() {
class MyComponent (line 97) | class MyComponent extends Component {
method render (line 101) | render() {
class App (line 140) | class App extends Component {
method render (line 142) | render() {
method constructor (line 183) | constructor(props) {
method render (line 187) | render() {
class Frag (line 176) | class Frag extends Component {
method render (line 177) | render() {
class App (line 182) | class App extends Component {
method render (line 142) | render() {
method constructor (line 183) | constructor(props) {
method render (line 187) | render() {
FILE: packages/rax/src/vdom/__tests__/purecomponent.js
class MyComponent (line 22) | class MyComponent extends PureComponent {
method render (line 25) | render() {
method render (line 52) | render() {
method shouldComponentUpdate (line 56) | shouldComponentUpdate() {
method render (line 69) | render() {
class MyComponent (line 49) | class MyComponent extends PureComponent {
method render (line 25) | render() {
method render (line 52) | render() {
method shouldComponentUpdate (line 56) | shouldComponentUpdate() {
method render (line 69) | render() {
class MyComponent (line 68) | class MyComponent extends PureComponent {
method render (line 25) | render() {
method render (line 52) | render() {
method shouldComponentUpdate (line 56) | shouldComponentUpdate() {
method render (line 69) | render() {
FILE: packages/rax/src/vdom/__tests__/reactive.js
function StatelessComponent (line 11) | function StatelessComponent(props) {
function createNodeElement (line 16) | function createNodeElement(tagName) {
class MyComponent (line 44) | class MyComponent {
method render (line 45) | render() {
class Parent (line 57) | class Parent extends Component {
method render (line 58) | render() {
method getChildContext (line 130) | getChildContext() {
method render (line 134) | render() {
class Child (line 73) | class Child extends Component {
method render (line 78) | render() {
function Parent (line 83) | function Parent() {
method render (line 58) | render() {
method getChildContext (line 130) | getChildContext() {
method render (line 134) | render() {
class GrandParent (line 87) | class GrandParent extends Component {
method getChildContext (line 92) | getChildContext() {
method render (line 96) | render() {
function Child (line 112) | function Child(props) {
method render (line 78) | render() {
class Parent (line 125) | class Parent extends Component {
method render (line 58) | render() {
method getChildContext (line 130) | getChildContext() {
method render (line 134) | render() {
function Child (line 139) | function Child(props, context) {
method render (line 78) | render() {
function Child (line 152) | function Child() {
method render (line 78) | render() {
function Child (line 162) | function Child() {
method render (line 78) | render() {
FILE: packages/rax/src/vdom/__tests__/ref.js
class RefHopsAround (line 23) | class RefHopsAround extends Component {
method render (line 30) | render() {
method render (line 108) | render() {
class Child (line 94) | class Child extends Component {
method render (line 95) | render() {
class RefHopsAround (line 101) | class RefHopsAround extends Component {
method render (line 30) | render() {
method render (line 108) | render() {
class MyComponent (line 172) | class MyComponent extends Component {
method render (line 173) | render() {
method constructor (line 184) | constructor(props) {
method render (line 188) | render() {
class MyComponent (line 183) | class MyComponent extends Component {
method render (line 173) | render() {
method constructor (line 184) | constructor(props) {
method render (line 188) | render() {
function MyComponent (line 200) | function MyComponent(props) {
method render (line 173) | render() {
method constructor (line 184) | constructor(props) {
method render (line 188) | render() {
FILE: packages/rax/src/vdom/__tests__/text.js
function createNodeElement (line 11) | function createNodeElement(tagName) {
FILE: packages/rax/src/vdom/base.js
class BaseComponent (line 7) | class BaseComponent {
method constructor (line 8) | constructor(element) {
method __initComponent (line 12) | __initComponent(parent, parentInstance, context) {
method __destoryComponent (line 19) | __destoryComponent() {
method __mountComponent (line 36) | __mountComponent(parent, parentInstance, context, nativeNodeMounter) {
method unmountComponent (line 50) | unmountComponent(shouldNotRemoveChild) {
method __getName (line 58) | __getName() {
method __mountNativeNode (line 70) | __mountNativeNode(nativeNodeMounter) {
method __getNativeNode (line 81) | __getNativeNode() {
method __getPublicInstance (line 87) | __getPublicInstance() {
FILE: packages/rax/src/vdom/component.js
class Component (line 4) | class Component {
method constructor (line 5) | constructor(props, context) {
method setState (line 11) | setState(partialState, callback) {
method forceUpdate (line 16) | forceUpdate(callback) {
class PureComponent (line 24) | class PureComponent extends Component {
method constructor (line 25) | constructor(props, context) {
FILE: packages/rax/src/vdom/composite.js
function scheduleLayoutInSandbox (line 29) | function scheduleLayoutInSandbox(fn, instance) {
function scheduleLayoutCallbacksInSandbox (line 35) | function scheduleLayoutCallbacksInSandbox(callbacks, instance) {
class CompositeComponent (line 46) | class CompositeComponent extends BaseComponent {
method __mountComponent (line 47) | __mountComponent(parent, parentInstance, context, nativeNodeMounter) {
method unmountComponent (line 177) | unmountComponent(shouldNotRemoveChild) {
method __processContext (line 213) | __processContext(context) {
method __processChildContext (line 227) | __processChildContext(currentContext) {
method __processPendingState (line 238) | __processPendingState(props, context) {
method __updateComponent (line 260) | __updateComponent(
method __updateRenderedComponent (line 388) | __updateRenderedComponent(context) {
method __getNativeNode (line 473) | __getNativeNode() {
method __getPublicInstance (line 480) | __getPublicInstance() {
FILE: packages/rax/src/vdom/element.js
function Element (line 3) | function Element(type, key, ref, props, owner) {
FILE: packages/rax/src/vdom/empty.js
class EmptyComponent (line 7) | class EmptyComponent extends BaseComponent {
method __createNativeNode (line 8) | __createNativeNode() {
method __updateComponent (line 11) | __updateComponent() {
FILE: packages/rax/src/vdom/flattenChildren.js
function traverseChildren (line 3) | function traverseChildren(children, result) {
function flattenChildren (line 13) | function flattenChildren(children) {
FILE: packages/rax/src/vdom/fragment.js
class FragmentComponent (line 9) | class FragmentComponent extends NativeComponent {
method __mountComponent (line 10) | __mountComponent(parent, parentInstance, context, nativeNodeMounter) {
method unmountComponent (line 38) | unmountComponent(shouldNotRemoveChild) {
method __updateComponent (line 51) | __updateComponent(prevElement, nextElement, prevContext, nextContext) {
method __getNativeNode (line 62) | __getNativeNode() {
FILE: packages/rax/src/vdom/getElementKeyName.js
function getElementKeyName (line 4) | function getElementKeyName(children, element, index) {
FILE: packages/rax/src/vdom/getNearestParent.js
function getNearestParent (line 3) | function getNearestParent(instance, matcher) {
FILE: packages/rax/src/vdom/getPrevSiblingNativeNode.js
function getPrevSiblingNativeNode (line 12) | function getPrevSiblingNativeNode(component) {
FILE: packages/rax/src/vdom/inject.js
function inject (line 9) | function inject() {
FILE: packages/rax/src/vdom/injectRenderOptions.js
function injectRenderOptions (line 4) | function injectRenderOptions({ driver, measurer }) {
FILE: packages/rax/src/vdom/instance.js
constant KEY (line 11) | const KEY = '_r';
method set (line 14) | set(node, instance) {
method get (line 24) | get(node) {
method remove (line 27) | remove(node) {
method mount (line 37) | mount(element, container, { parent, hydrate }) {
FILE: packages/rax/src/vdom/instantiateComponent.js
function instantiateComponent (line 5) | function instantiateComponent(element) {
FILE: packages/rax/src/vdom/native.js
constant STYLE (line 14) | const STYLE = 'style';
constant CHILDREN (line 15) | const CHILDREN = 'children';
constant TREE (line 16) | const TREE = 'tree';
constant EVENT_PREFIX_REGEXP (line 17) | const EVENT_PREFIX_REGEXP = /^on[A-Z]/;
class NativeComponent (line 22) | class NativeComponent extends BaseComponent {
method __mountComponent (line 23) | __mountComponent(parent, parentInstance, context, nativeNodeMounter) {
method __mountChildren (line 65) | __mountChildren(children, context) {
method __mountChildrenImpl (line 72) | __mountChildrenImpl(parent, children, context, nativeNodeMounter) {
method __unmountChildren (line 95) | __unmountChildren(shouldNotRemoveChild) {
method unmountComponent (line 107) | unmountComponent(shouldNotRemoveChild) {
method __updateComponent (line 127) | __updateComponent(prevElement, nextElement, prevContext, nextContext) {
method __updateProperties (line 151) | __updateProperties(prevProps, nextProps) {
method __updateChildren (line 292) | __updateChildren(nextChildrenElements, context) {
method __createNativeNode (line 460) | __createNativeNode() {
FILE: packages/rax/src/vdom/performInSandbox.js
function performInSandbox (line 5) | function performInSandbox(fn, instance, callback) {
function handleError (line 25) | function handleError(instance, error) {
FILE: packages/rax/src/vdom/reactive.js
constant RE_RENDER_LIMIT (line 8) | const RE_RENDER_LIMIT = 24;
class ReactiveComponent (line 12) | class ReactiveComponent extends Component {
method constructor (line 13) | constructor(pureRender, ref) {
method getHooks (line 57) | getHooks() {
method getHookID (line 61) | getHookID() {
method useContext (line 65) | useContext(context) {
method componentWillMount (line 92) | componentWillMount() {
method componentDidMount (line 96) | componentDidMount() {
method componentWillReceiveProps (line 100) | componentWillReceiveProps() {
method componentDidUpdate (line 104) | componentDidUpdate() {
method componentWillUnmount (line 108) | componentWillUnmount() {
method __update (line 112) | __update() {
method render (line 116) | render() {
FILE: packages/rax/src/vdom/ref.js
function updateRef (line 8) | function updateRef(prevElement, nextElement, component) {
function attachRef (line 21) | function attachRef(ownerComponent, ref, component) {
function detachRef (line 48) | function detachRef(ownerComponent, ref, component) {
FILE: packages/rax/src/vdom/root.js
class Root (line 6) | class Root extends Component {
method constructor (line 7) | constructor() {
method __getPublicInstance (line 14) | __getPublicInstance() {
method __getRenderedComponent (line 18) | __getRenderedComponent() {
method __update (line 22) | __update(element) {
method render (line 27) | render() {
FILE: packages/rax/src/vdom/scheduler.js
function invokeFunctionsWithClear (line 13) | function invokeFunctionsWithClear(callbacks) {
function schedule (line 21) | function schedule(callback) {
function flush (line 29) | function flush() {
function scheduleEffect (line 33) | function scheduleEffect(callback) {
function flushEffect (line 40) | function flushEffect() {
function scheduleLayout (line 44) | function scheduleLayout(callback) {
function flushLayout (line 48) | function flushLayout() {
FILE: packages/rax/src/vdom/shallowEqual.js
function is (line 9) | function is(x, y) {
function shallowEqual (line 26) | function shallowEqual(objA, objB) {
FILE: packages/rax/src/vdom/shouldUpdateComponent.js
function shouldUpdateComponent (line 3) | function shouldUpdateComponent(prevElement, nextElement) {
FILE: packages/rax/src/vdom/text.js
class TextComponent (line 7) | class TextComponent extends BaseComponent {
method __updateComponent (line 8) | __updateComponent(prevElement, nextElement, context) {
method __createNativeNode (line 23) | __createNativeNode() {
FILE: packages/rax/src/vdom/updater.js
function getPendingCallbacks (line 8) | function getPendingCallbacks(internal) {
function setPendingCallbacks (line 12) | function setPendingCallbacks(internal, callbacks) {
function getPendingStateQueue (line 16) | function getPendingStateQueue(internal) {
function setPendingStateQueue (line 20) | function setPendingStateQueue(internal, partialState) {
function enqueueCallback (line 24) | function enqueueCallback(internal, callback) {
function enqueueState (line 29) | function enqueueState(internal, partialState) {
function runUpdate (line 34) | function runUpdate(component) {
function mountOrderComparator (line 61) | function mountOrderComparator(c1, c2) {
function performUpdate (line 65) | function performUpdate() {
function scheduleUpdate (line 89) | function scheduleUpdate(component, shouldAsyncUpdate) {
function requestUpdate (line 105) | function requestUpdate(component, partialState, callback) {
method setState (line 154) | setState(component, partialState, callback) {
method forceUpdate (line 161) | forceUpdate(component, callback) {
FILE: packages/style-unit/src/index.js
constant RPX_REG (line 3) | const RPX_REG = /"[^"]+"|'[^']+'|url\([^\)]+\)|(\d*\.?\d+)rpx/g;
class CustomMap (line 35) | class CustomMap {
method set (line 37) | set(key, value) {
method get (line 40) | get(key) {
method has (line 43) | has(key) {
function isRpx (line 54) | function isRpx(str) {
function calcRpx (line 63) | function calcRpx(str) {
function getRpx (line 80) | function getRpx() {
function setRpx (line 84) | function setRpx(rpx) {
function getViewportWidth (line 88) | function getViewportWidth() {
function setViewportWidth (line 92) | function setViewportWidth(viewport) {
function setDecimalPixelTransformer (line 101) | function setDecimalPixelTransformer(transformer) {
function setUnitPrecision (line 109) | function setUnitPrecision(n) {
function cached (line 117) | function cached(fn) {
function setTargetPlatform (line 126) | function setTargetPlatform(platform) {
FILE: scripts/add-owner.js
constant PACKAGES_DIR (line 8) | const PACKAGES_DIR = path.resolve(__dirname, '../packages');
FILE: scripts/bench/frameworks/preact/src/Main.jsx
class Main (line 29) | class Main extends Component {
method constructor (line 30) | constructor(props) {
method printDuration (line 46) | printDuration() {
method componentDidUpdate (line 49) | componentDidUpdate() {
method componentDidMount (line 52) | componentDidMount() {
method run (line 55) | run() {
method add (line 60) | add() {
method update (line 65) | update() {
method select (line 70) | select(id) {
method delete (line 75) | delete(id) {
method runLots (line 80) | runLots() {
method clear (line 85) | clear() {
method swapRows (line 90) | swapRows() {
method render (line 95) | render() {
FILE: scripts/bench/frameworks/preact/src/Row.jsx
class Row (line 8) | class Row extends Component {
method constructor (line 9) | constructor(props) {
method shouldComponentUpdate (line 14) | shouldComponentUpdate(nextProps, nextState) {
method onDelete (line 18) | onDelete() {
method onClick (line 21) | onClick() {
method render (line 25) | render() {
FILE: scripts/bench/frameworks/preact/src/Store.es6.js
function _random (line 3) | function _random(max) {
class Store (line 7) | class Store {
method constructor (line 8) | constructor() {
method buildData (line 13) | buildData(count = 1000) {
method updateData (line 22) | updateData(mod = 10) {
method delete (line 27) | delete(id) {
method run (line 31) | run() {
method add (line 35) | add() {
method update (line 38) | update() {
method select (line 41) | select(id) {
method runLots (line 44) | runLots() {
method clear (line 48) | clear() {
method swapRows (line 52) | swapRows() {
FILE: scripts/bench/frameworks/rax-local/src/main.jsx
function random (line 7) | function random(max) {
function buildData (line 20) | function buildData(count) {
function listReducer (line 31) | function listReducer(state, action) {
FILE: scripts/bench/frameworks/rax/src/main.jsx
function random (line 7) | function random(max) {
function buildData (line 20) | function buildData(count) {
function listReducer (line 31) | function listReducer(state, action) {
FILE: scripts/bench/frameworks/vanillajs/src/Main.js
function _random (line 21) | function _random(max) {
class Store (line 28) | class Store {
method constructor (line 29) | constructor() {
method buildData (line 35) | buildData(count = 1000) {
method updateData (line 44) | updateData(mod = 10) {
method delete (line 50) | delete(id) {
method run (line 55) | run() {
method add (line 59) | add() {
method update (line 63) | update() {
method select (line 67) | select(id) {
method hideAll (line 70) | hideAll() {
method showAll (line 75) | showAll() {
method runLots (line 80) | runLots() {
method clear (line 84) | clear() {
method swapRows (line 88) | swapRows() {
class Main (line 106) | class Main {
method constructor (line 107) | constructor(props) {
method findIdx (line 169) | findIdx(id) {
method printDuration (line 175) | printDuration() {
method run (line 178) | run() {
method add (line 189) | add() {
method update (line 195) | update() {
method unselect (line 203) | unselect() {
method select (line 209) | select(idx) {
method recreateSelection (line 217) | recreateSelection() {
method delete (line 226) | delete(idx) {
method removeAllRows (line 237) | removeAllRows() {
method runLots (line 260) | runLots() {
method clear (line 271) | clear() {
method swapRows (line 283) | swapRows() {
method appendRows (line 313) | appendRows() {
method createRow (line 333) | createRow(data) {
FILE: scripts/bench/frameworks/vue/src/store.es6.js
function _random (line 3) | function _random(max) {
class Store (line 7) | class Store {
method constructor (line 8) | constructor() {
method buildData (line 13) | buildData(count = 1000) {
method updateData (line 22) | updateData(mod = 10) {
method delete (line 31) | delete(id) {
method run (line 35) | run() {
method add (line 39) | add() {
method update (line 42) | update() {
method select (line 45) | select(id) {
method runLots (line 48) | runLots() {
method clear (line 52) | clear() {
method swapRows (line 56) | swapRows() {
FILE: scripts/bench/src/benchmarks.js
constant SHORT_TIMEOUT (line 14) | const SHORT_TIMEOUT = 20 * 1000;
class Benchmark (line 31) | class Benchmark {
method constructor (line 32) | constructor(benchmarkInfo) {
method after (line 40) | after(driver, framework) {
method resultKinds (line 44) | resultKinds() {
method extractResult (line 47) | extractResult(results, resultKind) {
method constructor (line 53) | constructor() {
method init (line 62) | async init(driver) {
method run (line 65) | async run(driver) {
method constructor (line 72) | constructor() {
method init (line 82) | async init(driver) {
method run (line 93) | async run(driver) {
method constructor (line 100) | constructor() {
method init (line 111) | async init(driver) {
method run (line 124) | async run(driver) {
method constructor (line 135) | constructor() {
method init (line 148) | async init(driver) {
method run (line 156) | async run(driver) {
method constructor (line 163) | constructor() {
method init (line 176) | async init(driver) {
method run (line 186) | async run(driver) {
method constructor (line 194) | constructor() {
method init (line 204) | async init(driver) {
method run (line 227) | async run(driver) {
method constructor (line 234) | constructor() {
method init (line 243) | async init(driver) {
method run (line 246) | async run(driver) {
method constructor (line 253) | constructor() {
method init (line 263) | async init(driver) {
method run (line 268) | async run(driver) {
method constructor (line 275) | constructor() {
method init (line 285) | async init(driver) {
method run (line 290) | async run(driver) {
method constructor (line 297) | constructor() {
method init (line 306) | async init(driver) {
method run (line 309) | async run(driver) {
method after (line 312) | async after(driver, framework) {
method constructor (line 319) | constructor() {
method init (line 328) | async init(driver) {
method run (line 331) | async run(driver) {
method constructor (line 338) | constructor() {
method init (line 347) | async init(driver) {
method run (line 350) | async run(driver) {
method constructor (line 360) | constructor() {
method init (line 369) | async init(driver) {
method run (line 372) | async run(driver) {
method constructor (line 385) | constructor() {
method init (line 394) | async init(driver) {
method run (line 397) | async run(driver) {
class BenchStartup (line 447) | class BenchStartup extends Benchmark {
method constructor (line 448) | constructor() {
method init (line 456) | async init(driver) {
method run (line 460) | async run(driver, framework) {
method extractResult (line 466) | extractResult(results, resultKind) {
method resultKinds (line 473) | resultKinds() {
FILE: scripts/bench/src/build.js
function executeCommand (line 5) | function executeCommand(command) {
function buildBundles (line 18) | async function buildBundles(framework) {
FILE: scripts/bench/src/common.js
function loadFrameworkVersionInformation (line 5) | function loadFrameworkVersionInformation(frameworks) {
function getOSInformation (line 40) | function getOSInformation() {
FILE: scripts/bench/src/fomart.js
function computeGeometricMean (line 86) | function computeGeometricMean(resultsForFramework) {
FILE: scripts/bench/src/index.js
function getFrameworkNames (line 16) | function getFrameworkNames() {
function runBench (line 22) | async function runBench(framework, benchmarks, local, skipBuild) {
function run (line 94) | async function run(frameworkNames, benchmarkNames, local, skipBuild) {
FILE: scripts/bench/src/print.js
constant TABLE_CONFIG (line 6) | const TABLE_CONFIG = {
FILE: scripts/bench/src/runner.js
function extractRelevantEvents (line 20) | function extractRelevantEvents(entries) {
function fetchEventsFromPerformanceLog (line 92) | async function fetchEventsFromPerformanceLog(driver) {
function type_eq (line 108) | function type_eq(requiredType) {
function type_neq (line 112) | function type_neq(requiredType) {
function asString (line 116) | function asString(res) {
function extractRawValue (line 120) | function extractRawValue(results, id) {
function rmDir (line 129) | function rmDir(dirPath) {
function runLighthouse (line 144) | async function runLighthouse(framework, benchmarkOptions) {
function computeResultsCPU (line 210) | async function computeResultsCPU(
function computeResultsMEM (line 329) | async function computeResultsMEM(
function buildDriver (line 376) | function buildDriver(benchmarkOptions) {
function forceGC (line 422) | async function forceGC(framework, driver) {
function runBenchmark (line 433) | async function runBenchmark(driver, benchmark, framework) {
function afterBenchmark (line 442) | async function afterBenchmark(driver, benchmark, framework) {
function initBenchmark (line 455) | async function initBenchmark(driver, benchmark, framework) {
function formatResult (line 469) | function formatResult(res, dir) {
function registerError (line 516) | async function registerError(driver, framework, benchmark, error) {
function runMemOrCPUBenchmark (line 526) | async function runMemOrCPUBenchmark(framework, benchmark, benchmarkOptio...
function runStartupBenchmark (line 609) | async function runStartupBenchmark(framework, benchmark, benchmarkOption...
function executeBenchmark (line 629) | async function executeBenchmark(framework, benchmark, benchmarkOptions) {
FILE: scripts/bench/src/server.js
function createHTTPServer (line 3) | function createHTTPServer() {
FILE: scripts/bench/src/webdriverAccess.js
function setUseShadowRoot (line 5) | function setUseShadowRoot(val) {
function findByXPath (line 10) | async function findByXPath(node, path) {
function waitForCondition (line 18) | function waitForCondition(driver) {
function testTextContains (line 26) | async function testTextContains(driver, xpath, text, timeout = config.TI...
function testTextNotContained (line 50) | function testTextNotContained(driver, xpath, text, timeout = config.TIME...
function testClassContains (line 74) | function testClassContains(driver, xpath, text, timeout = config.TIMEOUT) {
function testElementLocatedByXpath (line 98) | function testElementLocatedByXpath(driver, xpath, timeout = config.TIMEO...
function testElementNotLocatedByXPath (line 117) | function testElementNotLocatedByXPath(driver, xpath, timeout = config.TI...
function testElementLocatedById (line 136) | function testElementLocatedById(driver, id, timeout = config.TIMEOUT) {
function retry (line 152) | async function retry(retryCount, driver, fun) {
function clickElementById (line 163) | function clickElementById(driver, id) {
function clickElementByXPath (line 171) | function clickElementByXPath(driver, xpath) {
function getTextByXPath (line 183) | async function getTextByXPath(driver, xpath) {
function shadowRoot (line 193) | async function shadowRoot(driver) {
FILE: scripts/check-and-publish.js
constant RETRY_LIMIT (line 10) | const RETRY_LIMIT = 8;
constant TIMEOUT (line 11) | const TIMEOUT = 5000;
function checkVersion (line 13) | function checkVersion(folder, callback) {
function checkVersionExists (line 58) | function checkVersionExists(pkg, version, retry = 0) {
function publish (line 76) | function publish(pkg, workDir, version, tag) {
function isPrerelease (line 90) | function isPrerelease(v) {
function checkVersionAndPublish (line 96) | function checkVersionAndPublish() {
FILE: scripts/compile.js
constant SRC_DIR (line 24) | const SRC_DIR = 'src';
constant JS_FILES_PATTERN (line 25) | const JS_FILES_PATTERN = '**/*.js';
constant IGNORE_PATTERN (line 26) | const IGNORE_PATTERN = '**/{__tests__,__mocks__}/**';
constant IGNORE_COMPILE_PACKAGES (line 29) | const IGNORE_COMPILE_PACKAGES = ['rax'];
function buildPackage (line 46) | function buildPackage(packagesDir, p, isBuildEs) {
function getPackages (line 60) | function getPackages(packagesDir, customPackages) {
function buildFile (line 75) | function buildFile(packagesDir, file, isBuildEs) {
FILE: scripts/dist-core.js
constant UMD (line 12) | const UMD = 'umd';
constant ESM (line 13) | const ESM = 'esm';
constant CJS (line 14) | const CJS = 'cjs';
function getExtension (line 16) | function getExtension(format) {
function build (line 39) | async function build({
function buildCorePackages (line 137) | function buildCorePackages(options) {
function getRaxVersion (line 147) | function getRaxVersion() {
FILE: scripts/jest/toWarnDev.js
function normalizeCodeLocInfo (line 6) | function normalizeCodeLocInfo(str) {
FILE: scripts/validate-commit-msg.js
function getCommitMessage (line 155) | function getCommitMessage(buffer) {
function getConfig (line 161) | function getConfig() {
function getGitFolder (line 167) | function getGitFolder() {
Condensed preview — 491 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (974K chars).
[
{
"path": ".editorconfig",
"chars": 295,
"preview": "# EditorConfig is awesome: http://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines with"
},
{
"path": ".eslintignore",
"chars": 74,
"preview": "node_modules\nlib\nes\ndist\nbuild\ncoverage\nexpected\nwebsite\ngh-pages\nvendors\n"
},
{
"path": ".eslintrc.js",
"chars": 68,
"preview": "module.exports = {\n 'extends': [\n 'rax'\n ],\n 'root': true,\n};\n"
},
{
"path": ".github/CONTRIBUTING.md",
"chars": 3597,
"preview": "# Contributing Guide\n\nHi! I’m really excited that you are interested in contributing to Rax. Before submitting your cont"
},
{
"path": ".github/GIT_COMMIT_SPECIFIC.md",
"chars": 1452,
"preview": "# GIT COMMIT MESSAGE CHEAT SHEET\n\n**Proposed format of the commit message**\n\n```\n<type>(<scope>): <subject>\n\n<body>\n```\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report.yml",
"chars": 2577,
"preview": "name: \"Bug Report\"\ndescription: \"If something isn't working as expected.\"\ntitle: \"[BUG] <title>\"\nlabels: [\"Bug\"]\nbody:\n "
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request.md",
"chars": 601,
"preview": "---\nname: Feature Request\nabout: Suggest an idea for Rax.\ntitle: \"[Feature]\"\nlabels: feature\nassignees: ''\n\n---\n\n**Is yo"
},
{
"path": ".github/ISSUE_TEMPLATE/question.md",
"chars": 157,
"preview": "---\nname: Question\nabout: Ask questions about using with Rax.\ntitle: \"[Question]\"\nlabels: question\nassignees: ''\n\n---\n\nP"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 423,
"preview": "*Before* submitting a pull request, please make sure the following is done...\n\n1. Fork the repo and create your branch f"
},
{
"path": ".github/actions/setup-chrome/action.yml",
"chars": 1464,
"preview": "# https://github.com/SeleniumHQ/selenium/blob/trunk/.github/actions/setup-chrome/action.yml\nname: 'Setup Chrome and chro"
},
{
"path": ".github/workflows/auto-publisher.yml",
"chars": 609,
"preview": "name: Auto Publisher\n\non:\n push:\n branches:\n - master\n\njobs:\n build-and-publish:\n runs-on: ubuntu-latest\n "
},
{
"path": ".github/workflows/bench.yml",
"chars": 687,
"preview": "name: Bench\n\non:\n push:\n branches:\n - master\n pull_request:\n branches:\n - '^bench'\n\njobs:\n bench:\n "
},
{
"path": ".github/workflows/ci.yml",
"chars": 729,
"preview": "name: CI\n\non: [push]\n\njobs:\n build:\n runs-on: ubuntu-latest\n strategy:\n matrix:\n node-version: [14.x]"
},
{
"path": ".gitignore",
"chars": 144,
"preview": "*~\n*.swp\n.DS_Store\nnpm-debug.log\nlerna-debug.log\nnpm-debug.log*\nlib/\nes/\ndist/\nbuild/\ncoverage/\nnode_modules/\nexamples/t"
},
{
"path": ".npmrc",
"chars": 18,
"preview": "package-lock=false"
},
{
"path": "LICENSE",
"chars": 1537,
"preview": "BSD License\n\nCopyright (c) 2015-present, Alibaba Group Holding Limited. All rights reserved.\n\nRedistribution and use in "
},
{
"path": "README.md",
"chars": 3896,
"preview": "<p align=\"center\">\n <a href=\"https://alibaba.github.io/rax\">\n <img alt=\"Rax\" src=\"https://user-images.githubusercont"
},
{
"path": "SECURITY.md",
"chars": 289,
"preview": "# Security Policy\n\n## Supported Versions\n\n\n| Version | Supported |\n| ------- | ------------------ |\n| >= 1.0.0 "
},
{
"path": "babel.config.js",
"chars": 891,
"preview": "module.exports = function(api) {\n // Cache the returned value forever and don't call this function again.\n if (api) ap"
},
{
"path": "examples/README.md",
"chars": 544,
"preview": "# Rax 示例\n\n本文件夹提供了多个 Rax 示例项目供用户参考。\n\n## 快速开始\n\n```shell\nnpm install\n\n# dev mode\nnpm run start\n\n# build mode\nnpm run build\n"
},
{
"path": "examples/app-lifecycle/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/app-lifecycle/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/app-lifecycle/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/app-lifecycle/build.json",
"chars": 329,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/app-lifecycle/package.json",
"chars": 894,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/app-lifecycle/src/app.js",
"chars": 505,
"preview": "import { runApp, useAppLaunch, useAppShow, useAppHide, useAppShare, useAppError } from 'rax-app';\nimport appConfig from "
},
{
"path": "examples/app-lifecycle/src/app.json",
"chars": 130,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n }\n ],\n \"window\": {\n \"title\": \"Rax A"
},
{
"path": "examples/app-lifecycle/src/components/Logo/index.css",
"chars": 68,
"preview": ".logo {\n width: 200rpx;\n height: 180rpx;\n margin-bottom: 20rpx;\n}"
},
{
"path": "examples/app-lifecycle/src/components/Logo/index.jsx",
"chars": 253,
"preview": "import { createElement } from 'rax';\nimport Image from 'rax-image';\n\nimport './index.css';\n\nexport default (props) => {\n"
},
{
"path": "examples/app-lifecycle/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/app-lifecycle/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/app-lifecycle/src/pages/Home/index.jsx",
"chars": 521,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\nimport Text from 'rax-text';\n\nimport './index.css';\n\ni"
},
{
"path": "examples/event-handler/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/event-handler/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/event-handler/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/event-handler/build.json",
"chars": 329,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/event-handler/package.json",
"chars": 894,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/event-handler/src/app.js",
"chars": 90,
"preview": "import { runApp } from 'rax-app';\nimport appConfig from './app.json';\n\nrunApp(appConfig);\n"
},
{
"path": "examples/event-handler/src/app.json",
"chars": 130,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n }\n ],\n \"window\": {\n \"title\": \"Rax A"
},
{
"path": "examples/event-handler/src/components/CustomComp/index.css",
"chars": 68,
"preview": ".logo {\n width: 200rpx;\n height: 180rpx;\n margin-bottom: 20rpx;\n}"
},
{
"path": "examples/event-handler/src/components/CustomComp/index.jsx",
"chars": 253,
"preview": "import { createElement } from 'rax';\nimport Image from 'rax-image';\n\nimport './index.css';\n\nexport default (props) => {\n"
},
{
"path": "examples/event-handler/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/event-handler/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/event-handler/src/pages/Home/index.jsx",
"chars": 1027,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\nimport Text from 'rax-text';\nimport Image from 'rax-im"
},
{
"path": "examples/get-element/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/get-element/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/get-element/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/get-element/abc.json",
"chars": 97,
"preview": "{\n \"type\": \"rax\",\n \"builder\": \"@ali/builder-rax-v1\",\n \"info\": {\n \"raxVersion\": \"1.x\"\n }\n}\n"
},
{
"path": "examples/get-element/build.json",
"chars": 329,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/get-element/package.json",
"chars": 894,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/get-element/src/app.js",
"chars": 505,
"preview": "import { runApp, useAppLaunch, useAppShow, useAppHide, useAppShare, useAppError } from 'rax-app';\nimport appConfig from "
},
{
"path": "examples/get-element/src/app.json",
"chars": 130,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n }\n ],\n \"window\": {\n \"title\": \"Rax A"
},
{
"path": "examples/get-element/src/components/Logo/index.css",
"chars": 68,
"preview": ".logo {\n width: 200rpx;\n height: 180rpx;\n margin-bottom: 20rpx;\n}"
},
{
"path": "examples/get-element/src/components/Logo/index.jsx",
"chars": 253,
"preview": "import { createElement } from 'rax';\nimport Image from 'rax-image';\n\nimport './index.css';\n\nexport default (props) => {\n"
},
{
"path": "examples/get-element/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/get-element/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/get-element/src/pages/Home/index.jsx",
"chars": 2123,
"preview": "import { createElement, useEffect } from 'rax';\nimport View from 'rax-view';\nimport Text from 'rax-text';\n\nimport './ind"
},
{
"path": "examples/page-lifecycle-with-router/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/page-lifecycle-with-router/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/page-lifecycle-with-router/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/page-lifecycle-with-router/build.json",
"chars": 329,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/page-lifecycle-with-router/package.json",
"chars": 894,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/page-lifecycle-with-router/src/app.js",
"chars": 90,
"preview": "import { runApp } from 'rax-app';\nimport appConfig from './app.json';\n\nrunApp(appConfig);\n"
},
{
"path": "examples/page-lifecycle-with-router/src/app.json",
"chars": 835,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n },\n {\n \"path\": \"/about\",\n \""
},
{
"path": "examples/page-lifecycle-with-router/src/components/Logo/index.css",
"chars": 68,
"preview": ".logo {\n width: 200rpx;\n height: 180rpx;\n margin-bottom: 20rpx;\n}"
},
{
"path": "examples/page-lifecycle-with-router/src/components/Logo/index.jsx",
"chars": 253,
"preview": "import { createElement } from 'rax';\nimport Image from 'rax-image';\n\nimport './index.css';\n\nexport default (props) => {\n"
},
{
"path": "examples/page-lifecycle-with-router/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/page-lifecycle-with-router/src/pages/About/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/page-lifecycle-with-router/src/pages/About/index.jsx",
"chars": 2107,
"preview": "import { createElement } from 'rax';\nimport { registerNativeEventListeners, addNativeEventListener, removeNativeEventLis"
},
{
"path": "examples/page-lifecycle-with-router/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/page-lifecycle-with-router/src/pages/Home/index.jsx",
"chars": 1983,
"preview": "import { createElement } from 'rax';\nimport { registerNativeEventListeners, addNativeEventListener, removeNativeEventLis"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/abc.json",
"chars": 97,
"preview": "{\n \"type\": \"rax\",\n \"builder\": \"@ali/builder-rax-v1\",\n \"info\": {\n \"raxVersion\": \"1.x\"\n }\n}\n"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/build.json",
"chars": 297,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/package.json",
"chars": 921,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/src/app.js",
"chars": 90,
"preview": "import { runApp } from 'rax-app';\nimport appConfig from './app.json';\n\nrunApp(appConfig);\n"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/src/app.json",
"chars": 130,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n }\n ],\n \"window\": {\n \"title\": \"Rax A"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/use-rax-compiled-component-in-runtime-miniapp/src/pages/Home/index.jsx",
"chars": 530,
"preview": "import { createElement, useState } from 'rax';\nimport View from 'rax-view';\nimport Text from 'rax-text';\nimport Modal fr"
},
{
"path": "examples/with-miniapp-native-custom-component/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/with-miniapp-native-custom-component/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/with-miniapp-native-custom-component/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/with-miniapp-native-custom-component/build.json",
"chars": 329,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/with-miniapp-native-custom-component/package.json",
"chars": 923,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/with-miniapp-native-custom-component/src/app.js",
"chars": 90,
"preview": "import { runApp } from 'rax-app';\nimport appConfig from './app.json';\n\nrunApp(appConfig);\n"
},
{
"path": "examples/with-miniapp-native-custom-component/src/app.json",
"chars": 130,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n }\n ],\n \"window\": {\n \"title\": \"Rax A"
},
{
"path": "examples/with-miniapp-native-custom-component/src/components/Test/index.ali.jsx",
"chars": 604,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\n\nimport Test from '../../public/AliNativeComp/index';\n"
},
{
"path": "examples/with-miniapp-native-custom-component/src/components/Test/index.wechat.jsx",
"chars": 388,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\n\nimport Test from '../../public/WechatNativeComp/index"
},
{
"path": "examples/with-miniapp-native-custom-component/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/with-miniapp-native-custom-component/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/with-miniapp-native-custom-component/src/pages/Home/index.jsx",
"chars": 238,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\n\nimport './index.css';\nimport Test from '../../compone"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.acss",
"chars": 28,
"preview": ".test {\n color: #F3BF37;\n}\n"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.axml",
"chars": 122,
"preview": "<view class=\"test\" onTap=\"onClick\">\n <slot name=\"header\" />\n <view>我是小程序原生自定义组件</view>\n <slot name=\"footer\" />\n</view"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.js",
"chars": 105,
"preview": "Component({\n methods: {\n onClick() {\n this.props.onClick && this.props.onClick();\n }\n }\n});\n"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/AliNativeComp/index.json",
"chars": 24,
"preview": "{\n \"component\": true\n}\n"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.js",
"chars": 131,
"preview": "Component({\n options: {\n multipleSlots: true\n },\n methods: {\n onClick() {\n this.triggerEvent('click');\n "
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.json",
"chars": 24,
"preview": "{\n \"component\": true\n}\n"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.wxml",
"chars": 124,
"preview": "<view class=\"test\" bindtap=\"onClick\">\n <slot name=\"header\" />\n <view>我是小程序原生自定义组件</view>\n <slot name=\"footer\" />\n</vi"
},
{
"path": "examples/with-miniapp-native-custom-component/src/public/WechatNativeComp/index.wxss",
"chars": 28,
"preview": ".test {\n color: #F3BF37;\n}\n"
},
{
"path": "examples/with-miniapp-native-page/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/with-miniapp-native-page/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/with-miniapp-native-page/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/with-miniapp-native-page/build.json",
"chars": 297,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/with-miniapp-native-page/package.json",
"chars": 894,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/with-miniapp-native-page/src/app.js",
"chars": 90,
"preview": "import { runApp } from 'rax-app';\nimport appConfig from './app.json';\n\nrunApp(appConfig);\n"
},
{
"path": "examples/with-miniapp-native-page/src/app.json",
"chars": 209,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n },\n {\n \"path\": \"/native\",\n "
},
{
"path": "examples/with-miniapp-native-page/src/components/Logo/index.css",
"chars": 68,
"preview": ".logo {\n width: 200rpx;\n height: 180rpx;\n margin-bottom: 20rpx;\n}"
},
{
"path": "examples/with-miniapp-native-page/src/components/Logo/index.jsx",
"chars": 253,
"preview": "import { createElement } from 'rax';\nimport Image from 'rax-image';\n\nimport './index.css';\n\nexport default (props) => {\n"
},
{
"path": "examples/with-miniapp-native-page/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/with-miniapp-native-page/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/with-miniapp-native-page/src/pages/Home/index.jsx",
"chars": 521,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\nimport Text from 'rax-text';\n\nimport './index.css';\n\ni"
},
{
"path": "examples/with-miniapp-native-page/src/pages/NativeHome/index.acss",
"chars": 0,
"preview": ""
},
{
"path": "examples/with-miniapp-native-page/src/pages/NativeHome/index.axml",
"chars": 75,
"preview": "\n<view>\n <view>这里是原生页面</view>\n <comp1></comp1>\n <comp2></comp2>\n</view>\n"
},
{
"path": "examples/with-miniapp-native-page/src/pages/NativeHome/index.js",
"chars": 10,
"preview": "Page({});\n"
},
{
"path": "examples/with-miniapp-native-page/src/pages/NativeHome/index.json",
"chars": 134,
"preview": "{\n \"usingComponents\": {\n \"comp1\": \"../../public/components/comp1/index\",\n \"comp2\": \"../../public/components/comp2"
},
{
"path": "examples/with-miniapp-native-page/src/public/components/comp1/index.axml",
"chars": 22,
"preview": "<view>我是 comp1</view>\n"
},
{
"path": "examples/with-miniapp-native-page/src/public/components/comp1/index.js",
"chars": 15,
"preview": "Component({});\n"
},
{
"path": "examples/with-miniapp-native-page/src/public/components/comp1/index.json",
"chars": 24,
"preview": "{\n \"component\": true\n}\n"
},
{
"path": "examples/with-miniapp-native-page/src/public/components/comp2/index.axml",
"chars": 22,
"preview": "<view>我是 comp2</view>\n"
},
{
"path": "examples/with-miniapp-native-page/src/public/components/comp2/index.js",
"chars": 15,
"preview": "Component({});\n"
},
{
"path": "examples/with-miniapp-native-page/src/public/components/comp2/index.json",
"chars": 24,
"preview": "{\n \"component\": true\n}\n"
},
{
"path": "examples/with-miniapp-plugin-component/.eslintrc.js",
"chars": 40,
"preview": "module.exports = {\n extends: ['rax']\n};"
},
{
"path": "examples/with-miniapp-plugin-component/.gitignore",
"chars": 184,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n*~\n*.swp\n*.log\n\n.DS_Store\n.idea/\n"
},
{
"path": "examples/with-miniapp-plugin-component/README.md",
"chars": 298,
"preview": "# rax-materials-basic-app\n\n## Getting Started\n\n### `npm run start`\n\nRuns the app in development mode.\n\nOpen [http://loca"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/api/data.js",
"chars": 170,
"preview": "var data = 'init data';\n\nfunction getData() {\n return data;\n}\n\nfunction setData(value) {\n data = value;\n}\n\nmodule.expo"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.acss",
"chars": 0,
"preview": ""
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.axml",
"chars": 61,
"preview": "<view onTap=\"onClick\">\n <view>{{pluginName}}</view>\n</view>\n"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.js",
"chars": 195,
"preview": "Component({\n props: {\n pluginName: 'plugin'\n },\n methods: {\n onClick() {\n const { pluginName } = this.prop"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/components/test/index.json",
"chars": 24,
"preview": "{\n \"component\": true\n}\n"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/index.js",
"chars": 106,
"preview": "var data = require('./api/data');\n\nmodule.exports = {\n getData: data.getData,\n setData: data.setData\n};\n"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.acss",
"chars": 0,
"preview": ""
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.axml",
"chars": 35,
"preview": "<view>Hello from plugin page</view>"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.js",
"chars": 10,
"preview": "Page({});\n"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/pages/index/index.json",
"chars": 2,
"preview": "{}"
},
{
"path": "examples/with-miniapp-plugin-component/ali-miniapp-plugin/plugin.json",
"chars": 191,
"preview": "{\n \"publicComponents\": {\n \"test\": \"components/test/index\"\n },\n \"publicPages\": {\n \"hello-page\": \"pages/index/ind"
},
{
"path": "examples/with-miniapp-plugin-component/build.json",
"chars": 329,
"preview": "{\n \"inlineStyle\": false,\n \"plugins\": [\n [\n \"build-plugin-rax-app\",\n {\n \"targets\": [\n \"min"
},
{
"path": "examples/with-miniapp-plugin-component/mini.project.json",
"chars": 129,
"preview": "{\n \"miniprogramRoot\": \"build/miniapp\",\n \"pluginRoot\": \"ali-miniapp-plugin\",\n \"compileType\": \"plugin\",\n \"component2\":"
},
{
"path": "examples/with-miniapp-plugin-component/package.json",
"chars": 925,
"preview": "{\n \"name\": \"@rax-materials/scaffolds-app-js\",\n \"author\": \"rax\",\n \"description\": \"Rax 无线跨端应用工程,使用 JavaScript。\",\n \"ver"
},
{
"path": "examples/with-miniapp-plugin-component/project.config.json",
"chars": 915,
"preview": "{\n\t\"miniprogramRoot\": \"build/wechat-miniprogram/\",\n\t\"pluginRoot\": \"wechat-miniprogram-plugin/\",\n\t\"compileType\": \"plugin\""
},
{
"path": "examples/with-miniapp-plugin-component/src/app.js",
"chars": 90,
"preview": "import { runApp } from 'rax-app';\nimport appConfig from './app.json';\n\nrunApp(appConfig);\n"
},
{
"path": "examples/with-miniapp-plugin-component/src/app.json",
"chars": 238,
"preview": "{\n \"routes\": [\n {\n \"path\": \"/\",\n \"source\": \"pages/Home/index\"\n }\n ],\n \"plugins\": {\n \"myPlugin\": {\n"
},
{
"path": "examples/with-miniapp-plugin-component/src/components/Test/index.ali.jsx",
"chars": 572,
"preview": "import { createElement, useState } from 'rax';\nimport View from 'rax-view';\n// eslint-disable-next-line\nimport Test from"
},
{
"path": "examples/with-miniapp-plugin-component/src/components/Test/index.jsx",
"chars": 285,
"preview": "import { createElement } from 'rax';\nimport { isWeb, isMiniApp } from 'universal-env';\nimport View from 'rax-view';\nimpo"
},
{
"path": "examples/with-miniapp-plugin-component/src/components/Test/index.wechat.jsx",
"chars": 627,
"preview": "import { createElement, useState } from 'rax';\nimport View from 'rax-view';\nimport Text from 'rax-text';\n// eslint-disab"
},
{
"path": "examples/with-miniapp-plugin-component/src/document/index.jsx",
"chars": 542,
"preview": "import { createElement } from 'rax';\nimport { Root, Style, Script} from 'rax-document';\n\nfunction Document() {\n return "
},
{
"path": "examples/with-miniapp-plugin-component/src/pages/Home/index.css",
"chars": 191,
"preview": ".home {\n align-items: center;\n margin-top: 200rpx;\n}\n\n.title {\n font-size: 45rpx;\n font-weight: bold;\n margin: 20rp"
},
{
"path": "examples/with-miniapp-plugin-component/src/pages/Home/index.jsx",
"chars": 240,
"preview": "import { createElement } from 'rax';\nimport View from 'rax-view';\n\nimport './index.css';\n\nimport Test from '../../compon"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/api/data.js",
"chars": 170,
"preview": "var data = 'init data';\n\nfunction getData() {\n return data;\n}\n\nfunction setData(value) {\n data = value;\n}\n\nmodule.expo"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.js",
"chars": 337,
"preview": "// plugin/components/hello-component.js\nComponent({\n properties: {\n list: {\n type: Array,\n value: [],\n "
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.json",
"chars": 48,
"preview": "{\n \"component\": true,\n \"usingComponents\": {}\n}"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.wxml",
"chars": 170,
"preview": "<!--plugin/components/hello-component.wxml-->\n<view class=\"container\" bindtap=\"onClick\">\n <text class=\"item\" wx:key=\"it"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/components/hello-component.wxss",
"chars": 108,
"preview": "/* plugin/components/hello-component.wxss */\r\n.container {\r\n margin: 1em;\r\n}\r\n.item {\r\n display: block;\r\n}"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/index.js",
"chars": 99,
"preview": "module.exports = {\n sayHello: function() {\n console.log('Hello plugin!');\n },\n answer: 42\n};\n"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.js",
"chars": 614,
"preview": "// pages/hello-page.js\nPage({\n\n /**\n * 页面的初始数据\n */\n data: {\n\n },\n\n /**\n * 生命周期函数--监听页面加载\n */\n onLoad: funct"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.json",
"chars": 27,
"preview": "{\n \"usingComponents\": {}\n}"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.wxml",
"chars": 64,
"preview": "<!--pages/hello-page.wxml-->\n<text>pages/hello-page.wxml</text>\n"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/pages/hello-page.wxss",
"chars": 27,
"preview": "/* pages/hello-page.wxss */"
},
{
"path": "examples/with-miniapp-plugin-component/wechat-miniprogram-plugin/plugin.json",
"chars": 160,
"preview": "{\n \"publicComponents\": {\n \"hello-component\": \"components/hello-component\"\n },\n \"pages\": {\n \"hello-page\": \"pages"
},
{
"path": "jest.config.js",
"chars": 682,
"preview": "// jest.config.js\n\n// Note: If you are using babel version 7 you have to install babel-jest with\n// yarn add --dev babel"
},
{
"path": "lerna.json",
"chars": 220,
"preview": "{\n \"version\": \"1.7.0\",\n \"npmClient\": \"ayarn\",\n \"useWorkspaces\": true,\n \"command\": {\n \"bootstrap\": {\n \"npmCli"
},
{
"path": "package.json",
"chars": 3424,
"preview": "{\n \"private\": true,\n \"devDependencies\": {\n \"@babel/core\": \"^7.12.9\",\n \"@babel/plugin-proposal-class-properties\":"
},
{
"path": "packages/driver-dom/CHANGELOG.md",
"chars": 149,
"preview": "## Changelog\n\n### v2.2.2\n\n- Fix hydrate style with webkit prefix in iOS 10\n\n### v2.2.1\n\n- Bump version\n\n### v2.2.0\n\n- Us"
},
{
"path": "packages/driver-dom/README.md",
"chars": 594,
"preview": "# driver-dom\n\n> DOM driver for Rax.\n\n## Install\n\n```bash\n$ npm install --save driver-dom\n```\n\n## Use\n\n```jsx\nimport {cre"
},
{
"path": "packages/driver-dom/package.json",
"chars": 487,
"preview": "{\n \"name\": \"driver-dom\",\n \"version\": \"2.2.2\",\n \"description\": \"DOM driver for Rax\",\n \"license\": \"BSD-3-Clause\",\n \"m"
},
{
"path": "packages/driver-dom/src/__tests__/attributes.js",
"chars": 2553,
"preview": "import { createElement, render } from 'rax';\nimport * as DriverDOM from '../';\n\ndescribe('attributes', () => {\n let con"
},
{
"path": "packages/driver-dom/src/__tests__/css-custom-properties.js",
"chars": 975,
"preview": "import { createElement, render } from 'rax';\nimport * as DriverDOM from '../';\n\ndescribe('Support CSS custom properties'"
},
{
"path": "packages/driver-dom/src/__tests__/css-unit-operations.js",
"chars": 2590,
"preview": "import { createElement, render } from 'rax';\nimport * as DriverDOM from '../';\n\ndescribe('CSSPropertyOperations', () => "
},
{
"path": "packages/driver-dom/src/__tests__/event-listener.js",
"chars": 608,
"preview": "import { createElement, render } from 'rax';\nimport * as DriverDOM from '../';\n\ndescribe('EventListener', () => {\n let "
},
{
"path": "packages/driver-dom/src/__tests__/hydrate.js",
"chars": 5516,
"preview": "import { createElement, render, useEffect } from 'rax';\n\ndescribe('Hydrate', () => {\n let DriverDOM;\n let container;\n\n"
},
{
"path": "packages/driver-dom/src/__tests__/node-operations.js",
"chars": 1509,
"preview": "import { createElement, Fragment, render, useState } from 'rax';\nimport * as DriverDOM from '../';\n\ndescribe('NodeOperat"
},
{
"path": "packages/driver-dom/src/__tests__/svg.js",
"chars": 1525,
"preview": "import { createElement, render } from 'rax';\nimport * as DriverDOM from '../';\n\ndescribe('svg', () => {\n let container;"
},
{
"path": "packages/driver-dom/src/index.d.ts",
"chars": 952,
"preview": "// Driver spec: https://github.com/alibaba/rax/blob/master/docs/en-US/driver-spec.md\ndeclare namespace Driver {\n functi"
},
{
"path": "packages/driver-dom/src/index.js",
"chars": 12968,
"preview": "/**\n * Driver for Web DOM\n **/\nimport { convertUnit, setViewportWidth, setUnitPrecision, cached } from 'style-unit';\nimp"
},
{
"path": "packages/driver-dom/src/warning.js",
"chars": 2588,
"preview": "let didWarnInvalidHydration = false;\n\nconst __DEV__ = process.env.NODE_ENV !== 'production';\n\nexport function warnForRep"
},
{
"path": "packages/driver-server/README.md",
"chars": 541,
"preview": "# driver-server\n\n> Server driver for Rax.\n\n## Install\n\n```bash\n$ npm install --save driver-server\n```\n\n## Use\n\n```jsx\nim"
},
{
"path": "packages/driver-server/package.json",
"chars": 366,
"preview": "{\n \"name\": \"driver-server\",\n \"version\": \"1.0.0\",\n \"description\": \"Server driver for Rax\",\n \"license\": \"BSD-3-Clause\""
},
{
"path": "packages/driver-server/src/index.js",
"chars": 5444,
"preview": "/**\n * Server driver\n **/\nconst ID = 'id';\nconst STYLE = 'style';\nconst CHILDREN = 'children';\nconst DANGEROUSLY_SET_IN"
},
{
"path": "packages/driver-universal/CHANGELOG.md",
"chars": 456,
"preview": "## Changelog\n\n## v3.5.0\n\n- Chore: use `import` instead of `require` in entry file\n\n## v3.4.0\n\n- Chore: remove kraken dri"
},
{
"path": "packages/driver-universal/README.md",
"chars": 954,
"preview": "# driver-universal\n\n> Driver for Universal App.\n\nSupport both DOM(Web) and Weex, with normalized 750rpx support of scree"
},
{
"path": "packages/driver-universal/package.json",
"chars": 988,
"preview": "{\n \"name\": \"driver-universal\",\n \"version\": \"3.5.0\",\n \"description\": \"Driver for Universal App.\",\n \"license\": \"BSD-3-"
},
{
"path": "packages/driver-universal/src/__tests__/css-custom-properties.js",
"chars": 946,
"preview": "import { createElement, render } from 'rax';\nimport DriverDOM from '../';\n\ndescribe('Support CSS custom properties', () "
},
{
"path": "packages/driver-universal/src/__tests__/dom-rpx-transformer.js",
"chars": 795,
"preview": "import { createElement, render } from 'rax';\nimport Driver from '../web';\n\ndescribe('Transform rpx', () => {\n const CLI"
},
{
"path": "packages/driver-universal/src/index.d.ts",
"chars": 952,
"preview": "// Driver spec: https://github.com/alibaba/rax/blob/master/docs/en-US/driver-spec.md\ndeclare namespace Driver {\n functi"
},
{
"path": "packages/driver-universal/src/index.js",
"chars": 559,
"preview": "import {\n isWeex,\n isWeb,\n isMiniApp,\n isWeChatMiniProgram,\n isByteDanceMicroApp,\n isBaiduSmartProgram,\n isKuaiSh"
},
{
"path": "packages/driver-universal/src/miniapp.js",
"chars": 75,
"preview": "import MiniAppDriver from 'driver-miniapp';\n\nexport default MiniAppDriver;\n"
},
{
"path": "packages/driver-universal/src/web.js",
"chars": 271,
"preview": "import * as DriverDOM from 'driver-dom';\n\nexport default {\n ...DriverDOM,\n createElement(type, props, component) {\n "
},
{
"path": "packages/driver-universal/src/weex.js",
"chars": 71,
"preview": "import * as WeexDriver from 'driver-weex';\n\nexport default WeexDriver;\n"
},
{
"path": "packages/driver-webgl/README.md",
"chars": 1967,
"preview": "# driver-webgl\n\n> WebGL driver for Rax.\n\nComponents and APIs are based on `three.js` design and implementation. Use mark"
},
{
"path": "packages/driver-webgl/package.json",
"chars": 521,
"preview": "{\n \"name\": \"driver-webgl\",\n \"version\": \"1.0.0-beta.0\",\n \"description\": \"WebGL driver for Rax.\",\n \"license\": \"BSD-3-C"
},
{
"path": "packages/driver-webgl/src/components/cameras/PerspectiveCamera.js",
"chars": 538,
"preview": "import * as THREE from 'three';\n\nexport default {\n init(props) {\n const {fov, aspect, near, far} = props;\n const "
},
{
"path": "packages/driver-webgl/src/components/controls/OrbitControls.js",
"chars": 490,
"preview": "import * as THREE from 'three';\n\nexport default {\n init(props) {\n const {camera} = props;\n const OrbitControls = "
},
{
"path": "packages/driver-webgl/src/components/controls/TrackballControls.js",
"chars": 506,
"preview": "import * as THREE from 'three';\n\nexport default {\n init(props) {\n const {camera} = props;\n const TrackballControl"
},
{
"path": "packages/driver-webgl/src/components/core/BufferGeometry.js",
"chars": 778,
"preview": "import * as THREE from 'three';\n\nexport default {\n init(props) {\n const BufferGeometry = new THREE.BufferGeometry();"
},
{
"path": "packages/driver-webgl/src/components/core/Geometry.js",
"chars": 578,
"preview": "import * as THREE from 'three';\n\nexport default {\n init() {\n const Geometry = new THREE.Geometry();\n Geometry.upd"
},
{
"path": "packages/driver-webgl/src/components/core/Object3D.js",
"chars": 431,
"preview": "import * as THREE from 'three';\n\nexport default {\n init() {\n const Object3D = new THREE.Object3D();\n Object3D.upd"
},
{
"path": "packages/driver-webgl/src/components/core/Raycaster.js",
"chars": 484,
"preview": "import * as THREE from 'three';\n\nlet camera = null;\n\nexport default {\n init(props) {\n const {origin, direction, near"
},
{
"path": "packages/driver-webgl/src/components/geometries/BoxGeometry.js",
"chars": 643,
"preview": "import * as THREE from 'three';\n\nexport default {\n init(props) {\n const {width, height, depth, widthSegments, height"
}
]
// ... and 291 more files (download for full content)
About this extraction
This page contains the full source code of the alibaba/rax GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 491 files (877.1 KB), approximately 240.5k tokens, and a symbol index with 1726 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.