mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93d33a3d25 | ||
|
|
ac83e5fa05 | ||
|
|
6cee1eecbf | ||
|
|
648b7c9db1 | ||
|
|
4a32ec5b4f | ||
|
|
743dbb20e6 | ||
|
|
f55d06128a | ||
|
|
319f6d10d0 | ||
|
|
5e809ba56b | ||
|
|
a6dfc9c406 | ||
|
|
469638e651 | ||
|
|
106ad8592c | ||
|
|
7c90b06b75 | ||
|
|
1a23902c60 | ||
|
|
8c99cc43de | ||
|
|
ae47e356f6 |
@@ -119,7 +119,7 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
||||
status: number = 0;
|
||||
timeout: number = 0;
|
||||
responseURL: ?string;
|
||||
withCredentials: boolean = false
|
||||
withCredentials: boolean = true
|
||||
|
||||
upload: XMLHttpRequestEventTarget = new XMLHttpRequestEventTarget();
|
||||
|
||||
|
||||
@@ -191,8 +191,13 @@ const StackRow = ({frame}: StackRowProps) => {
|
||||
const Text = require('Text');
|
||||
const TouchableHighlight = require('TouchableHighlight');
|
||||
const {file, lineNumber} = frame;
|
||||
const fileParts = file.split('/');
|
||||
const fileName = fileParts[fileParts.length - 1];
|
||||
let fileName;
|
||||
if (file) {
|
||||
const fileParts = file.split('/');
|
||||
fileName = fileParts[fileParts.length - 1];
|
||||
} else {
|
||||
fileName = '<unknown file>';
|
||||
}
|
||||
|
||||
return (
|
||||
<TouchableHighlight
|
||||
|
||||
@@ -185,8 +185,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
||||
|
||||
- (NSString *)formatFrameSource:(RCTJSStackFrame *)stackFrame
|
||||
{
|
||||
NSString *fileName = RCTNilIfNull(stackFrame.file) ? [stackFrame.file lastPathComponent] : @"<unknown file>";
|
||||
NSString *lineInfo = [NSString stringWithFormat:@"%@:%zd",
|
||||
[stackFrame.file lastPathComponent],
|
||||
fileName,
|
||||
stackFrame.lineNumber];
|
||||
|
||||
if (stackFrame.column != 0) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=1000.0.0-master
|
||||
VERSION_NAME=0.44.3
|
||||
GROUP=com.facebook.react
|
||||
|
||||
POM_NAME=ReactNative
|
||||
|
||||
+4
-2
@@ -8,9 +8,11 @@ next: images
|
||||
previous: animations
|
||||
---
|
||||
|
||||
This guide covers the various navigation components available in React Native. If you are just getting started with navigation, you will probably want to use React Navigation.
|
||||
This guide covers the various navigation components available in React Native. If you are just getting started with navigation, you will probably want to use [React Navigation](docs/navigation.html#react-navigation). React Navigation provides an easy to use navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both iOS and Android. As this is a JavaScript implementation, it provides the greatest amount of configurability as well as flexibility when integrating with state management libraries such as [redux](https://reactnavigation.org/docs/guides/redux).
|
||||
|
||||
If you are only targeting iOS and would like to stick to the native look and feel, check out `NavigatorIOS`. The `Navigator` component is older but has been thoroughly tested in production.
|
||||
If you're only targeting iOS, you may want to also check out [NavigatorIOS](docs/navigation.html#navigatorios) as a way of providing a native look and feel with minimal configuration, as it provides a wrapper around the native `UINavigationController` class. This component will not work on Android, however.
|
||||
|
||||
If you'd like to achieve a native look and feel on both iOS and Android, or you're integrating React Native into an app that already manages navigation natively, the following libraries provide native navigation on both platforms: [native-navigation](http://airbnb.io/native-navigation/), [react-native-navigation](https://github.com/wix/react-native-navigation).
|
||||
|
||||
## React Navigation
|
||||
|
||||
|
||||
@@ -15,11 +15,6 @@ const spawnOpts = {
|
||||
stdin: 'inherit',
|
||||
};
|
||||
|
||||
const projectDir = process.cwd();
|
||||
const isYarnAvailable =
|
||||
yarn.getYarnVersionIfAvailable() &&
|
||||
yarn.isGlobalCliUsingYarn(projectDir);
|
||||
|
||||
/**
|
||||
* Execute npm or yarn command
|
||||
*
|
||||
@@ -30,6 +25,11 @@ const isYarnAvailable =
|
||||
function callYarnOrNpm(yarnCommand, npmCommand) {
|
||||
let command;
|
||||
|
||||
const projectDir = process.cwd();
|
||||
const isYarnAvailable =
|
||||
yarn.getYarnVersionIfAvailable() &&
|
||||
yarn.isGlobalCliUsingYarn(projectDir);
|
||||
|
||||
if (isYarnAvailable) {
|
||||
command = yarnCommand;
|
||||
} else {
|
||||
|
||||
@@ -21,11 +21,9 @@ function getYarnVersionIfAvailable() {
|
||||
let yarnVersion;
|
||||
try {
|
||||
// execSync returns a Buffer -> convert to string
|
||||
if (process.platform.startsWith('win')) {
|
||||
yarnVersion = (execSync('yarn --version').toString() || '').trim();
|
||||
} else {
|
||||
yarnVersion = (execSync('yarn --version 2>/dev/null').toString() || '').trim();
|
||||
}
|
||||
yarnVersion = (execSync('yarn --version', {
|
||||
stdio: [ 0, 'pipe', 'ignore', ]
|
||||
}).toString() || '').trim();
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+3
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"version": "1000.0.0",
|
||||
"version": "0.44.3",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "BSD-3-Clause",
|
||||
"repository": {
|
||||
@@ -170,7 +170,7 @@
|
||||
"immutable": "~3.7.6",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"inquirer": "^0.12.0",
|
||||
"jest-haste-map": "19.0.0",
|
||||
"jest-haste-map": "^20.0.4",
|
||||
"joi": "^6.6.1",
|
||||
"json-stable-stringify": "^1.0.1",
|
||||
"json5": "^0.4.0",
|
||||
@@ -187,9 +187,6 @@
|
||||
"plist": "^1.2.0",
|
||||
"pretty-format": "^4.2.1",
|
||||
"promise": "^7.1.1",
|
||||
"react-addons-create-fragment": "15.5.0-alpha.0",
|
||||
"react-addons-pure-render-mixin": "15.5.0-alpha.0",
|
||||
"react-addons-shallow-compare": "15.5.0-alpha.0",
|
||||
"react-clone-referenced-element": "^1.0.1",
|
||||
"react-devtools-core": "^2.0.8",
|
||||
"react-timer-mixin": "^0.13.2",
|
||||
@@ -233,4 +230,4 @@
|
||||
"shelljs": "0.6.0",
|
||||
"sinon": "^2.0.0-pre.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
"graceful-fs": "^4.1.3",
|
||||
"image-size": "^0.3.5",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"jest-haste-map": "18.0.0",
|
||||
"jest-haste-map": "^20.0.4",
|
||||
"joi": "^6.6.1",
|
||||
"json-stable-stringify": "^1.0.1",
|
||||
"json5": "^0.4.0",
|
||||
|
||||
@@ -30,7 +30,11 @@ const affixes = {prefix: 'metro-bundler-symbolicate', suffix: '.sock'};
|
||||
const childPath = require.resolve('./worker');
|
||||
|
||||
exports.createWorker = (): Symbolicate => {
|
||||
const socket = xpipe.eq(temp.path(affixes));
|
||||
// There are issues with named sockets on windows that cause the connection to
|
||||
// close too early so run the symbolicate server on a random localhost port.
|
||||
const socket = process.platform === 'win32'
|
||||
? 34712
|
||||
: xpipe.eq(temp.path(affixes));
|
||||
const child = new LockingPromise(new LazyPromise(() => startupChild(socket)));
|
||||
|
||||
return (stack, sourceMaps) =>
|
||||
@@ -53,6 +57,7 @@ function startupChild(socket) {
|
||||
child.removeAllListeners();
|
||||
resolve(child);
|
||||
});
|
||||
// $FlowFixMe ChildProcess.send should accept any type.
|
||||
child.send(socket);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5182,7 +5182,7 @@ describe('DependencyGraph', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should recover from multiple modules with the same name (but this is broken right now)', async () => {
|
||||
it('should recover from multiple modules with the same name', async () => {
|
||||
const root = '/root';
|
||||
console.warn = jest.fn();
|
||||
const filesystem = setMockFileSystem({
|
||||
@@ -5231,17 +5231,11 @@ describe('DependencyGraph', function() {
|
||||
await triggerAndProcessWatchEvent(dgraph, 'change', root + '/b.js');
|
||||
}
|
||||
|
||||
// This verifies that it is broken right now. Instead of throwing it should
|
||||
// return correct results. Once this is fixed in `jest-haste`, remove
|
||||
// the whole try catch and verify results are matching a snapshot.
|
||||
try {
|
||||
await getOrderedDependenciesAsJSON(dgraph, root + '/index.js');
|
||||
throw new Error('expected `getOrderedDependenciesAsJSON` to fail');
|
||||
} catch (error) {
|
||||
if (error.type !== 'UnableToResolveError') {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
const deps = await getOrderedDependenciesAsJSON(
|
||||
dgraph,
|
||||
root + '/index.js',
|
||||
);
|
||||
expect(deps).toMatchSnapshot();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`DependencyGraph file watch updating should recover from multiple modules with the same name 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"dependencies": Array [
|
||||
"a",
|
||||
"b",
|
||||
],
|
||||
"id": "index",
|
||||
"isAsset": false,
|
||||
"isJSON": false,
|
||||
"isPolyfill": false,
|
||||
"path": "/root/index.js",
|
||||
"resolution": undefined,
|
||||
},
|
||||
Object {
|
||||
"dependencies": Array [],
|
||||
"id": "a",
|
||||
"isAsset": false,
|
||||
"isJSON": false,
|
||||
"isPolyfill": false,
|
||||
"path": "/root/a.js",
|
||||
"resolution": undefined,
|
||||
},
|
||||
Object {
|
||||
"dependencies": Array [],
|
||||
"id": "b",
|
||||
"isAsset": false,
|
||||
"isJSON": false,
|
||||
"isPolyfill": false,
|
||||
"path": "/root/b.js",
|
||||
"resolution": undefined,
|
||||
},
|
||||
]
|
||||
`;
|
||||
@@ -103,7 +103,7 @@ class DependencyGraph extends EventEmitter {
|
||||
return new JestHasteMap({
|
||||
extensions: opts.extensions.concat(opts.assetExts),
|
||||
forceNodeFilesystemAPI: opts.forceNodeFilesystemAPI,
|
||||
ignorePattern: {test: opts.ignoreFilePath},
|
||||
ignorePattern: opts.ignoreFilePath,
|
||||
maxWorkers: opts.maxWorkerCount,
|
||||
mocksPattern: '',
|
||||
name: 'react-native-packager-' + JEST_HASTE_MAP_CACHE_BREAKER,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Reference in New Issue
Block a user