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 ` 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** ``` (): ``` All lines are wrapped at 100 characters ! **Allowed ``** - 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 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] " 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): ![vscode](https://img.alicdn.com/imgextra/i4/O1CN01B2NdUc1LVH9UffWpV_!!6000000001304-1-tps-960-720.gif) ### 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