Compare commits

...

3 Commits
0.8.0 ... 0.8.1

Author SHA1 Message Date
Nicolas Gallagher
15b960f097 0.8.1 2018-06-05 09:31:42 -07:00
Nicolas Gallagher
001be82178 [fix] remove AppRegistry logging in production
Fix #986
2018-06-05 09:08:36 -07:00
Nicolas Gallagher
5eeef9e3d2 [fix] only call preventDefault for clicks on links
The previous incarnation of this fix would cancel clicks that bubble up
to elements like ScrollViews, with undesired impact on child element
events. Instead, limit the hack to elements with accessibilityRole=link.

Fix #985
2018-06-05 09:02:35 -07:00
8 changed files with 27 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
{
"private": true,
"version": "0.8.0",
"version": "0.8.1",
"name": "react-native-web-monorepo",
"scripts": {
"clean": "del ./packages/*/dist",

View File

@@ -1,6 +1,6 @@
{
"name": "babel-plugin-react-native-web",
"version": "0.8.0",
"version": "0.8.1",
"description": "Babel plugin for React Native for Web",
"main": "index.js",
"devDependencies": {

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "benchmarks",
"version": "0.8.0",
"version": "0.8.1",
"scripts": {
"build": "mkdir -p dist && cp -f index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
"release": "yarn build && git checkout gh-pages && rm -rf ../../benchmarks && mv dist ../../benchmarks && git add -A && git commit -m \"Benchmarks deploy\" && git push origin gh-pages && git checkout -"
@@ -18,7 +18,7 @@
"react-dom": "^16.3.2",
"react-fela": "^7.2.0",
"react-jss": "^8.4.0",
"react-native-web": "0.8.0",
"react-native-web": "0.8.1",
"reactxp": "^1.1.1",
"styled-components": "^3.2.6",
"styled-jsx": "^2.2.6",
@@ -26,7 +26,7 @@
"styletron-react": "^4.2.1"
},
"devDependencies": {
"babel-plugin-react-native-web": "0.8.0",
"babel-plugin-react-native-web": "0.8.1",
"css-loader": "^0.28.11",
"style-loader": "^0.21.0",
"url-loader": "^1.0.1",

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "react-native-examples",
"version": "0.8.0",
"version": "0.8.1",
"scripts": {
"build": "mkdir -p dist && cp -f src/index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
"release": "yarn build && git checkout gh-pages && rm -rf ../../examples && mv dist ../../examples && git add -A && git commit -m \"Examples deploy\" && git push origin gh-pages && git checkout -"
@@ -10,10 +10,10 @@
"babel-runtime": "^6.26.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-native-web": "0.8.0"
"react-native-web": "0.8.1"
},
"devDependencies": {
"babel-plugin-react-native-web": "0.8.0",
"babel-plugin-react-native-web": "0.8.1",
"babel-plugin-transform-runtime": "^6.23.0",
"file-loader": "^1.1.11",
"webpack": "^4.8.1",

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-web",
"version": "0.8.0",
"version": "0.8.1",
"description": "React Native for Web",
"module": "dist/index.js",
"main": "dist/cjs/index.js",

View File

@@ -91,14 +91,16 @@ export default class AppRegistry {
static runApplication(appKey: string, appParameters: Object): void {
const isDevelopment = process.env.NODE_ENV !== 'production';
const params = { ...appParameters };
params.rootTag = `#${params.rootTag.id}`;
if (isDevelopment) {
const params = { ...appParameters };
params.rootTag = `#${params.rootTag.id}`;
console.log(
`Running application "${appKey}" with appParams: ${JSON.stringify(params)}.\n` +
`Development-level warnings: ${isDevelopment ? 'ON' : 'OFF'}.\n` +
`Performance optimizations: ${isDevelopment ? 'OFF' : 'ON'}.`
);
console.log(
`Running application "${appKey}" with appParams: ${JSON.stringify(params)}.\n` +
`Development-level warnings: ${isDevelopment ? 'ON' : 'OFF'}.\n` +
`Performance optimizations: ${isDevelopment ? 'OFF' : 'ON'}.`
);
}
invariant(
runnables[appKey] && runnables[appKey].run,

View File

@@ -50,6 +50,7 @@ const adjustProps = domProps => {
const isButtonRole = role === 'button';
const isDisabled = AccessibilityUtil.isDisabled(domProps);
const isLinkRole = role === 'link';
Object.keys(domProps).forEach(propName => {
const prop = domProps[propName];
@@ -67,11 +68,11 @@ const adjustProps = domProps => {
}
});
// Cancel click events if the responder system is being used. Click events
// are not an expected part of the React Native API, and browsers dispatch
// click events that cannot otherwise be cancelled from preceding mouse
// events in the responder system.
if (onResponderRelease) {
// Cancel click events if the responder system is being used on a link
// element. Click events are not an expected part of the React Native API,
// and browsers dispatch click events that cannot otherwise be cancelled from
// preceding mouse events in the responder system.
if (isLinkRole && onResponderRelease) {
domProps.onClick = function(e) {
if (!e.isDefaultPrevented() && !isModifiedEvent(e.nativeEvent) && !domProps.target) {
e.preventDefault();

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "website",
"version": "0.8.0",
"version": "0.8.1",
"scripts": {
"build": "build-storybook -o ./dist -c ./storybook/.storybook",
"start": "start-storybook -p 9001 -c ./storybook/.storybook",
@@ -12,10 +12,10 @@
"@storybook/react": "^3.4.3",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-native-web": "0.8.0"
"react-native-web": "0.8.1"
},
"devDependencies": {
"babel-plugin-react-native-web": "0.8.0",
"babel-plugin-react-native-web": "0.8.1",
"url-loader": "^1.0.1",
"webpack": "^4.8.1"
}