Compare commits

...
Author SHA1 Message Date
Konstantin Raev 2360c99d99 Revert "Sync CSSLayout: Make 'stretch' aligned children fill cross-axis in containers of undefined size in the cross-axis"
Reason - to keep IOS and Android in sync
A new update will be coming to master branch

This reverts commit f538032888.
2016-03-21 11:56:26 +00:00
Martín BigioandKonstantin Raev 0f7e461820 inline __accept call so that sourcemaps work
Summary:Sourcemaps on HMR where a couple of line off. The problem is that since the `__accept` call doesn't go through the sourcemaps pipeline we need to make sure that call is a single-line one.

This was originally written in a single line but I incorrectly updated it on https://github.com/facebook/react-native/commit/436db67126f1e64d1889c2d084b77c98c8d63f8d. Would be great having test coverage for this.

Reviewed By: davidaurelio

Differential Revision: D3075164

fb-gh-sync-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
shipit-source-id: c77ea99f26bdd675f241c5d20a620eb4ddfbf701
2016-03-21 11:56:05 +00:00
Konstantin Raev cafbeb08fe added shrinkwrap to package 2016-03-16 12:07:46 +00:00
Konstantin Raev 995aa485d2 revert committed version numbers, confusing for CI npm deployments 2016-03-16 10:56:12 +00:00
Konstantin Raev 09ef2b522b added deployment debugging inf 2016-03-15 18:18:45 +00:00
Konstantin RaevandKonstantin Raev 1228321636 Npm publish
Summary:This work allows automated release deployment.

Previous semi-automation lived in release.sh and I split it into two pieces:
- test-manual-e2e.sh - that just tests that current commit is buildable and makes a quick e2e installation for manual testing
- publish-npm.js - that makes publish based on what current branch and tags are on commit that is tested/deployed by CI

This simplified `Releases.md` guide and requires you to just run
```
git checkout -b 0.22-stable
git tag v0.22.0-rc
git push origin 0.22-stable --tags
```
to have a successful npm release.
Closes https://github.com/facebook/react-native/pull/6453

Reviewed By: mkonicek

Differential Revision: D3047938

Pulled By: bestander

fb-gh-sync-id: dbebf4c3a0bc2c2a0ef75c54595ab5654f91b8ea
shipit-source-id: dbebf4c3a0bc2c2a0ef75c54595ab5654f91b8ea
2016-03-15 16:48:24 +00:00
Laurence BortfeldandKonstantin Raev 31c3b08a7b getCurrentConnectivity should resolve with object
Summary:`getCurrentConnectivity()` should resolve with object instead of array otherwise in `NetInfo.fetch().done(reach => console.log('Initial: ' + reach))` `reach` will be undefined (see https://github.com/l-urence/react-native/blob/master/Libraries/Network/NetInfo.js#L200).

cc satya164
Closes https://github.com/facebook/react-native/pull/6373

Differential Revision: D3032773

fb-gh-sync-id: edc545548d3c17387545b6c59894c27e4563cb18
shipit-source-id: edc545548d3c17387545b6c59894c27e4563cb18
2016-03-15 16:42:48 +00:00
Martín BigioandKonstantin Raev 25496d4d97 Unbreak HMR listener
Reviewed By: sam-swarr

Differential Revision: D3042801

fb-gh-sync-id: 2f06f2efbdf3d04ce4db0cf847ebe76d05fb109f
shipit-source-id: 2f06f2efbdf3d04ce4db0cf847ebe76d05fb109f
2016-03-15 16:42:37 +00:00
Dan AbramovandKonstantin Raev 4113da70f0 Update hot reloading dependencies
Summary:These updates include important changes to correctness in the linked and underlying packages:

* https://github.com/gaearon/babel-plugin-react-transform/releases/tag/v2.0.1
* https://github.com/gaearon/babel-plugin-react-transform/releases/tag/v2.0.2
* https://github.com/gaearon/react-proxy/releases/tag/v1.1.3
* https://github.com/gaearon/react-proxy/releases/tag/v1.1.4
* etc

We need to include these if we want to ship hot reloading.

Create a new project with those versions of packages.

<img width="761" alt="screen shot 2016-03-06 at 18 49 20" src="https://cloud.githubusercontent.com/assets/810438/13556222/2d45ca62-e3cc-11e5-8a3f-a2346efe19dd.png">

Verify hot reloading still works.

![](http://cl.ly/2J150y0Y3E1z/download/Screen%20Recording%202016-03-06%20at%2018.48.gif)

martinbigio skevy

I wasn’t sure whether to touch the shrinkwrap.
Closes https://github.com/facebook/react-native/pull/6325

Reviewed By: yungsters

Differential Revision: D3019470

Pulled By: martinbigio

fb-gh-sync-id: 99bad390cd898f58aa7f74494066561a81eb40e6
shipit-source-id: 99bad390cd898f58aa7f74494066561a81eb40e6
2016-03-15 16:42:23 +00:00
Janic DuplessisandKonstantin Raev c5feed4991 Update node-haste and replace fast-path with node-haste's version to fix Windows compatibility
Summary:This is the last bits needed to fix Windows compatibility on master, most of the work was done in node-haste.

**Test plan**
Run npm test
Run the packager using Windows and Mac

cc cpojer davidaurelio
Closes https://github.com/facebook/react-native/pull/6260

Reviewed By: dmmiller, bestander

Differential Revision: D3005397

Pulled By: davidaurelio

fb-gh-sync-id: e16847808ebfa8b234315b2093dba204c9c1e869
shipit-source-id: e16847808ebfa8b234315b2093dba204c9c1e869
2016-03-15 16:41:43 +00:00
Konstantin Raev 9ed661601b [0.22.0-rc] Bump version numbers 2016-03-08 20:07:23 +00:00
18 changed files with 257 additions and 8445 deletions
+1
View File
@@ -37,6 +37,7 @@ buck-out
.gradle
local.properties
*.iml
/android/
# Node
node_modules
+1 -1
View File
@@ -90,7 +90,7 @@ static void RCTReachabilityCallback(__unused SCNetworkReachabilityRef target, SC
RCT_EXPORT_METHOD(getCurrentConnectivity:(RCTPromiseResolveBlock)resolve
reject:(__unused RCTPromiseRejectBlock)reject)
{
resolve(@[@{@"network_info": _status}]);
resolve(@{@"network_info": _status});
}
@end
+9 -9
View File
@@ -96,15 +96,15 @@ Error: ${e.message}`
? global.nativeInjectHMRUpdate
: eval;
// TODO: (martinb) yellow box if cannot accept module
code = `
__accept(
${name},
function(global, require, module, exports) {
${code}
},
${JSON.stringify(inverseDependencies)}
);`;
code = [
`__accept(`,
`${name},`,
`function(global,require,module,exports){`,
`${code}`,
'\n},',
`${JSON.stringify(inverseDependencies)}`,
`);`,
].join('');
injectFunction(code, sourceURLs[i]);
});
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "React"
s.version = "0.0.0-master"
s.version = "0.22.0-rc"
s.summary = "Build high quality mobile apps using React."
s.description = <<-DESC
React Native apps are built using the React JS
+1 -1
View File
@@ -1,4 +1,4 @@
VERSION_NAME=0.12.0-SNAPSHOT
VERSION_NAME=0.0.0-SNAPSHOT
GROUP=com.facebook.react
POM_NAME=ReactNative
@@ -7,7 +7,7 @@
*/
// NOTE: this file is auto-copied from https://github.com/facebook/css-layout
// @generated SignedSource<<dcc87213906997ff353adb1148c8e77c>>
// @generated SignedSource<<df03fd95c4520badeed398c76e70242d>>
package com.facebook.csslayout;
@@ -258,7 +258,7 @@ public class LayoutEngine {
float paddingAndBorderAxisColumn = ((node.style.padding.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_COLUMN], leading[CSS_FLEX_DIRECTION_COLUMN]) + node.style.border.getWithFallback(leadingSpacing[CSS_FLEX_DIRECTION_COLUMN], leading[CSS_FLEX_DIRECTION_COLUMN])) + (node.style.padding.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_COLUMN], trailing[CSS_FLEX_DIRECTION_COLUMN]) + node.style.border.getWithFallback(trailingSpacing[CSS_FLEX_DIRECTION_COLUMN], trailing[CSS_FLEX_DIRECTION_COLUMN])));
if (isMeasureDefined(node)) {
boolean isResolvedRowDimDefined = (!Float.isNaN(node.layout.dimensions[dim[resolvedRowAxis]]) && node.layout.dimensions[dim[resolvedRowAxis]] >= 0.0);
boolean isResolvedRowDimDefined = !Float.isNaN(node.layout.dimensions[dim[resolvedRowAxis]]);
float width = CSSConstants.UNDEFINED;
if ((!Float.isNaN(node.style.dimensions[dim[resolvedRowAxis]]) && node.style.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
@@ -274,7 +274,7 @@ public class LayoutEngine {
float height = CSSConstants.UNDEFINED;
if ((!Float.isNaN(node.style.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && node.style.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0)) {
height = node.style.dimensions[DIMENSION_HEIGHT];
} else if ((!Float.isNaN(node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0)) {
} else if (!Float.isNaN(node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]])) {
height = node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]];
} else {
height = parentMaxHeight -
@@ -320,8 +320,8 @@ public class LayoutEngine {
float paddingAndBorderAxisMain = ((node.style.padding.getWithFallback(leadingSpacing[mainAxis], leading[mainAxis]) + node.style.border.getWithFallback(leadingSpacing[mainAxis], leading[mainAxis])) + (node.style.padding.getWithFallback(trailingSpacing[mainAxis], trailing[mainAxis]) + node.style.border.getWithFallback(trailingSpacing[mainAxis], trailing[mainAxis])));
float paddingAndBorderAxisCross = ((node.style.padding.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis]) + node.style.border.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis])) + (node.style.padding.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis]) + node.style.border.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis])));
boolean isMainDimDefined = (!Float.isNaN(node.layout.dimensions[dim[mainAxis]]) && node.layout.dimensions[dim[mainAxis]] >= 0.0);
boolean isCrossDimDefined = (!Float.isNaN(node.layout.dimensions[dim[crossAxis]]) && node.layout.dimensions[dim[crossAxis]] >= 0.0);
boolean isMainDimDefined = !Float.isNaN(node.layout.dimensions[dim[mainAxis]]);
boolean isCrossDimDefined = !Float.isNaN(node.layout.dimensions[dim[crossAxis]]);
boolean isMainRowDirection = (mainAxis == CSS_FLEX_DIRECTION_ROW || mainAxis == CSS_FLEX_DIRECTION_ROW_REVERSE);
int i;
@@ -383,8 +383,8 @@ public class LayoutEngine {
float mainDim = leadingPaddingAndBorderMain;
float crossDim = 0;
float maxWidth = CSSConstants.UNDEFINED;
float maxHeight = CSSConstants.UNDEFINED;
float maxWidth;
float maxHeight;
for (i = startLine; i < childCount; ++i) {
child = node.getChildAt(i);
child.lineIndex = linesCount;
@@ -421,7 +421,7 @@ public class LayoutEngine {
// left and right or top and bottom).
for (ii = 0; ii < 2; ii++) {
axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
if ((!Float.isNaN(node.layout.dimensions[dim[axis]]) && node.layout.dimensions[dim[axis]] >= 0.0) &&
if (!Float.isNaN(node.layout.dimensions[dim[axis]]) &&
!(!Float.isNaN(child.style.dimensions[dim[axis]]) && child.style.dimensions[dim[axis]] >= 0.0) &&
!Float.isNaN(child.style.position[leading[axis]]) &&
!Float.isNaN(child.style.position[trailing[axis]])) {
@@ -468,7 +468,7 @@ public class LayoutEngine {
maxHeight = CSSConstants.UNDEFINED;
if (!isMainRowDirection) {
if ((!Float.isNaN(node.layout.dimensions[dim[resolvedRowAxis]]) && node.layout.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
if ((!Float.isNaN(node.style.dimensions[dim[resolvedRowAxis]]) && node.style.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
maxWidth = node.layout.dimensions[dim[resolvedRowAxis]] -
paddingAndBorderAxisResolvedRow;
} else {
@@ -477,7 +477,7 @@ public class LayoutEngine {
paddingAndBorderAxisResolvedRow;
}
} else {
if ((!Float.isNaN(node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0)) {
if ((!Float.isNaN(node.style.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && node.style.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0)) {
maxHeight = node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] -
paddingAndBorderAxisColumn;
} else {
@@ -528,7 +528,7 @@ public class LayoutEngine {
if (isSimpleStackCross &&
(child.style.positionType != CSSPositionType.RELATIVE ||
(alignItem != CSSAlign.STRETCH && alignItem != CSSAlign.FLEX_START) ||
(alignItem == CSSAlign.STRETCH && !isCrossDimDefined))) {
Float.isNaN(child.layout.dimensions[dim[crossAxis]]))) {
isSimpleStackCross = false;
firstComplexCross = i;
}
@@ -611,7 +611,7 @@ public class LayoutEngine {
);
maxWidth = CSSConstants.UNDEFINED;
if ((!Float.isNaN(node.layout.dimensions[dim[resolvedRowAxis]]) && node.layout.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
if ((!Float.isNaN(node.style.dimensions[dim[resolvedRowAxis]]) && node.style.dimensions[dim[resolvedRowAxis]] >= 0.0)) {
maxWidth = node.layout.dimensions[dim[resolvedRowAxis]] -
paddingAndBorderAxisResolvedRow;
} else if (!isMainRowDirection) {
@@ -620,7 +620,7 @@ public class LayoutEngine {
paddingAndBorderAxisResolvedRow;
}
maxHeight = CSSConstants.UNDEFINED;
if ((!Float.isNaN(node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0)) {
if ((!Float.isNaN(node.style.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]]) && node.style.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] >= 0.0)) {
maxHeight = node.layout.dimensions[dim[CSS_FLEX_DIRECTION_COLUMN]] -
paddingAndBorderAxisColumn;
} else if (isMainRowDirection) {
@@ -738,31 +738,15 @@ public class LayoutEngine {
CSSAlign alignItem = getAlignItem(node, child);
/*eslint-enable */
if (alignItem == CSSAlign.STRETCH) {
// You can only stretch if the dimension has not already been defined
// You can only stretch if the dimension has not already been set
// previously.
if (!(!Float.isNaN(child.style.dimensions[dim[crossAxis]]) && child.style.dimensions[dim[crossAxis]] >= 0.0)) {
float dimCrossAxis = child.layout.dimensions[dim[crossAxis]];
if (Float.isNaN(child.layout.dimensions[dim[crossAxis]])) {
child.layout.dimensions[dim[crossAxis]] = Math.max(
boundAxis(child, crossAxis, containerCrossAxis -
paddingAndBorderAxisCross - (child.style.margin.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis]) + child.style.margin.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis]))),
// You never want to go smaller than padding
((child.style.padding.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis]) + child.style.border.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis])) + (child.style.padding.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis]) + child.style.border.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis])))
);
// If the size has changed, and this child has children we need to re-layout this child
if (dimCrossAxis != child.layout.dimensions[dim[crossAxis]] && child.getChildCount() > 0) {
// Reset child margins before re-layout as they are added back in layoutNode and would be doubled
child.layout.position[leading[mainAxis]] -= child.style.margin.getWithFallback(leadingSpacing[mainAxis], leading[mainAxis]) +
getRelativePosition(child, mainAxis);
child.layout.position[trailing[mainAxis]] -= child.style.margin.getWithFallback(trailingSpacing[mainAxis], trailing[mainAxis]) +
getRelativePosition(child, mainAxis);
child.layout.position[leading[crossAxis]] -= child.style.margin.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis]) +
getRelativePosition(child, crossAxis);
child.layout.position[trailing[crossAxis]] -= child.style.margin.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis]) +
getRelativePosition(child, crossAxis);
layoutNode(layoutContext, child, maxWidth, maxHeight, direction);
}
}
} else if (alignItem != CSSAlign.FLEX_START) {
// The remaining space between the parent dimensions+padding and child
@@ -840,7 +824,7 @@ public class LayoutEngine {
if (child.lineIndex != i) {
break;
}
if ((!Float.isNaN(child.layout.dimensions[dim[crossAxis]]) && child.layout.dimensions[dim[crossAxis]] >= 0.0)) {
if (!Float.isNaN(child.layout.dimensions[dim[crossAxis]])) {
lineHeight = Math.max(
lineHeight,
child.layout.dimensions[dim[crossAxis]] + (child.style.margin.getWithFallback(leadingSpacing[crossAxis], leading[crossAxis]) + child.style.margin.getWithFallback(trailingSpacing[crossAxis], trailing[crossAxis]))
@@ -933,7 +917,7 @@ public class LayoutEngine {
for (ii = 0; ii < 2; ii++) {
axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
if ((!Float.isNaN(node.layout.dimensions[dim[axis]]) && node.layout.dimensions[dim[axis]] >= 0.0) &&
if (!Float.isNaN(node.layout.dimensions[dim[axis]]) &&
!(!Float.isNaN(currentAbsoluteChild.style.dimensions[dim[axis]]) && currentAbsoluteChild.style.dimensions[dim[axis]] >= 0.0) &&
!Float.isNaN(currentAbsoluteChild.style.position[leading[axis]]) &&
!Float.isNaN(currentAbsoluteChild.style.position[trailing[axis]])) {
@@ -1,7 +1,7 @@
The source of truth for css-layout is: https://github.com/facebook/css-layout
The code here should be kept in sync with GitHub.
HEAD at the time this code was synced: https://github.com/facebook/css-layout/commit/3f0f4be2e868a9af4f3ed1e019f71efbc814e8a2
HEAD at the time this code was synced: https://github.com/facebook/css-layout/commit/219bdaed15c16bbf7c1f2bab17ad629d04cc4199
There is generated code in:
- README (this file)
@@ -1,7 +1,7 @@
The source of truth for css-layout is: https://github.com/facebook/css-layout
The code here should be kept in sync with GitHub.
HEAD at the time this code was synced: https://github.com/facebook/css-layout/commit/3f0f4be2e868a9af4f3ed1e019f71efbc814e8a2
HEAD at the time this code was synced: https://github.com/facebook/css-layout/commit/219bdaed15c16bbf7c1f2bab17ad629d04cc4199
There is generated code in:
- README.facebook (this file)
+40 -67
View File
@@ -5,46 +5,54 @@ Release schedule:
- **0.21 branch cut**, 0.21.0-rc - **week of Feb 15**
- 0.21.0 - Feb 29
- **0.22 branch cut**, 0.22.0-rc - **week of Feb 29**
- 0.22.0 - Mar 14
- **0.23 branch cut**, 0.23.0-rc - **week of Mar 14**
- 0.23.0 - Mar 28
- **0.24 branch cut**, 0.23.0-rc - **week of Mar 28**
- 0.24.0 - Apr 11
- **0.22 branch cut**, 0.22.0-rc - **week of Mar 7**
- 0.22.0 - Mar 21
- **0.23 branch cut**, 0.23.0-rc - **week of Mar 21**
- 0.23.0 - Apr 4
- **0.24 branch cut**, 0.23.0-rc - **week of Apr 4**
- 0.24.0 - Apr 18
- ...
## One time setup
Set up Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
## Cut a release branch
#### Check that everything works
To cut a release branch and check that everything works, you'll need Mac OS with the [Android dev environment set up](https://github.com/facebook/react-native/blob/master/ReactAndroid/README.md).
Make absolutely sure a basic iOS and Android workflow works on the commit you are going to use for release.
Make sure CI systems [Travis](https://travis-ci.org/facebook/react-native) and [Circle](https://circleci.com/gh/facebook/react-native)
are green and then run
```
./scripts/test-manual-e2e.sh
```
This script runs end to end with a proxy npm repository on local PC and asks to check that Chrome Debugging works.
## Cut a release branch and push to github
To cut a release branch and check that everything works, you'll need Mac OS with the
[Android dev environment set up](https://github.com/facebook/react-native/blob/master/ReactAndroid/README.md).
Run:
cd react-native
./scripts/release.sh version_you_are_releasing # e.g. ./scripts/release.sh 0.22
```
git checkout -b <version_you_are_releasing>-stable # e.g. git checkout -b 0.22-stable
git tag v<version_you_are_releasing>.0-rc # e.g. git tag v0.22.0-rc
git push origin <version_you_are_releasing>-stable --tags # e.g. git push origin 0.22-stable --tags
```
#### Check that everything works
Circle CI will run the tests and publish to npm with version `0.22.0-rc` and tag `next` meaning that
this version will not be installed for users by default.
Make absolutely sure a basic iOS and Android workflow works on the release branch you've just created, see the instructions printed by `release.sh`.
#### Push to github
- Check git history, the last commit should be "[0.22-rc] Bump version numbers" (with the correct version)
- `git push origin 0.version_you_are_releasing-stable # e.g. git push origin 0.22-stable`
** Note ** CI won't publish to npm if the `last` commit on the new branch does not have a tag `v<branch-name-without-stable>.0-[rc]`.
## Make sure we have release notes
Post that we're ready to release so a voluteer can write release notes:
https://github.com/facebook/react-native/releases
To go through all the commits that went into a release, one way is to use the GitHub compare view: https://github.com/facebook/react-native/compare/0.18-stable...0.19-stable
## Do an RC release (e.g. 0.22.0-rc)
IMPORTANT: `npm publish` will automatically set the latest tag. **When doing an RC release**, run `npm publish --tag next` - this way people need to opt in to get the RC release.
To go through all the commits that went into a release, one way is to use the GitHub compare view: https://github.com/facebook/react-native/compare/0.21-stable...0.22-stable
## IMPORTANT: Track bug reports from the community during the following two weeks and make sure they get fixed
@@ -56,7 +64,7 @@ We should only be tracking bugs with small and non-risky fixes. Don't pick new f
## Do a release (e.g. 0.22.0, 0.22.1)
Roughly two weeks after the branch cut (see the release schedule above) it's time to promote the RC to a real realease.
Roughly two weeks after the branch cut (see the release schedule above) it's time to promote the RC to a real release.
Make sure you know which bug fixes should definitely be cheery-picked, example: https://github.com/facebook/react-native/issues/6087
@@ -64,65 +72,30 @@ We should only cherry-pick small and non-risky bug fixes. Don't pick new feature
Do the following:
**NOTE: Most of these steps are similar to what the script `release.sh` does. The script is used to cut the release branch only, can be made more generic to help with this step too.**
```
cd react-native
git checkout master
git pull
git checkout 0.version_you_are_releasing-stable # e.g. git checkout 0.22-stable
git pull origin 0.version_you_are_releasing-stable # e.g. git pull origin 0.22-stable
# Cherry-pick those commits, test everything again using Sinopia
# Cherry-pick those commits
git cherry-pick commitHash1
# Create the 'android' folder to be published to npm.
./gradlew :ReactAndroid:installArchives
# Check that it's there: `ls android`
...
npm set registry http://localhost:4873
sinopia
# change versions in package.json and React.podspec
npm publish
cd /tmp
react-native init TestAapp
cd TestApp
react-native run-ios
# Check that you can Reload JS and the Chrome debugger works
# Kill packager
open ios/TestApp.xcodeproj
# Click run
# Check that you can Reload JS and the Chrome debugger works
cd android && ./gradlew dependencies
# Double check the react-native dep has the correct version
cd ..
react-native run-android
# test everything again using sinopia
./scripts/test-manual-e2e.sh
# Check that you can Reload JS and the Chrome debugger works
```
If everything worked:
```
npm set registry https://registry.npmjs.org
npm publish
```
Tag the release in Git:
```
git tag v-version_you_are_releasing # e.g. git tag v0.22.0, git tag v0.22.1
git push --tags
```
To update the [website](https://facebook.github.io/react-native), move the `latest` tag and push to the `0.x-stable` branch. CircleCI will build and deploy the latest docs to the website.
```
git tag -d latest
git push origin :latest
git tag latest
git push origin version_you_are_releasing-stable --tags # e.g git push origin 0.22-stable --tags
git tag latest # for docs [website](https://facebook.github.io/react-native) to be generated
git push origin 0.22-stable --tags
```
Once you see the version in the top left corner of the website has been updated:
Move the release notes to the tag you've just created. We want single release notes per version, for example if there is v0.22.0-rc and later we release v0.22.0, the release notes should live on v0.22.0:
Move the release notes to the tag you've just created. We want single release notes per version,
for example if there is v0.22.0-rc and later we release v0.22.0, the release notes should live on v0.22.0:
https://github.com/facebook/react-native/tags
Uncheck the box "This is a pre-release" and publish the notes.
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "babel-preset-react-native",
"version": "1.5.1",
"version": "1.5.2",
"description": "Babel preset for React Native applications",
"main": "index.js",
"repository": "https://github.com/facebook/react-native/tree/master/babel-preset",
@@ -15,7 +15,7 @@
},
"homepage": "https://github.com/facebook/react-native/tree/master/babel-preset/README.md",
"dependencies": {
"babel-plugin-react-transform": "2.0.0-beta1",
"babel-plugin-react-transform": "2.0.2",
"babel-plugin-syntax-async-functions": "^6.5.0",
"babel-plugin-syntax-class-properties": "^6.5.0",
"babel-plugin-syntax-flow": "^6.5.0",
@@ -40,6 +40,6 @@
"babel-plugin-transform-react-display-name": "^6.5.0",
"babel-plugin-transform-react-jsx": "^6.5.0",
"babel-plugin-transform-regenerator": "^6.5.0",
"react-transform-hmr": "^1.0.2"
"react-transform-hmr": "^1.0.4"
}
}
+5 -1
View File
@@ -30,6 +30,9 @@ dependencies:
- "buck-out/bin"
- "website/node_modules"
override:
# CIRCLE_NPM_TOKEN is in React Native project settings in Circle CI.
# It was generated for bestander user, easy to replace with anyone's else
- echo "//registry.npmjs.org/:_authToken=${CIRCLE_NPM_TOKEN}" > ~/.npmrc
- npm config set spin=false
- npm config set progress=false
- npm install
@@ -80,7 +83,7 @@ test:
#- find . -type f -regex ".*/buck-out/gen/ReactAndroid/src/test/.*/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
deployment:
website:
stable:
branch: [/.*-stable/, /master/]
commands:
# generate docs website
@@ -88,3 +91,4 @@ deployment:
- git config --global user.name "Website Deployment Script"
- echo "machine github.com login reactjs-bot password $GITHUB_TOKEN" > ~/.netrc
- cd website && GIT_USER=reactjs-bot npm run gh-pages
- node ./scripts/publish-npm.js
+1 -1
View File
@@ -275,7 +275,7 @@ function attachHMRServer({httpServer, path, packagerServer}) {
() => {
// do nothing, file was removed
},
).finally(() => {
).then(() => {
client.ws.send(JSON.stringify({type: 'update-done'}));
});
});
-8280
View File
File diff suppressed because it is too large Load Diff
+8 -7
View File
@@ -92,7 +92,7 @@
"unmockedModulePathPatterns": [
"promise",
"source-map",
"fast-path",
"node-haste/lib/fastpath",
"fbjs"
]
},
@@ -111,7 +111,8 @@
"PATENTS",
"README.md",
"jestSupport",
".flowconfig"
".flowconfig",
"npm-shrinkwrap.json"
],
"scripts": {
"test": "NODE_ENV=test jest",
@@ -131,7 +132,7 @@
"babel-core": "^6.6.4",
"babel-plugin-external-helpers": "^6.5.0",
"babel-polyfill": "^6.6.1",
"babel-preset-react-native": "^1.5.1",
"babel-preset-react-native": "^1.5.2",
"babel-register": "^6.6.0",
"babel-types": "^6.6.4",
"babylon": "^6.6.4",
@@ -141,7 +142,6 @@
"connect": "^2.8.3",
"debug": "^2.2.0",
"event-target-shim": "^1.0.5",
"fast-path": "^1.1.0",
"fbjs": "^0.7.2",
"fbjs-scripts": "^0.4.0",
"graceful-fs": "^4.1.2",
@@ -154,13 +154,13 @@
"mkdirp": "^0.5.1",
"module-deps": "^3.9.1",
"node-fetch": "^1.3.3",
"node-haste": "~2.4.0",
"node-haste": "~2.8.0",
"opn": "^3.0.2",
"optimist": "^0.6.1",
"progress": "^1.1.8",
"promise": "^7.1.1",
"react-timer-mixin": "^0.13.2",
"react-transform-hmr": "^1.0.2",
"react-transform-hmr": "^1.0.4",
"rebound": "^0.0.13",
"regenerator": "^0.8.36",
"sane": "^1.2.0",
@@ -184,6 +184,7 @@
"flow-bin": "^0.21.0",
"jest-cli": "0.9.0-fb2",
"portfinder": "0.4.0",
"react": "^0.14.5"
"react": "^0.14.5",
"shelljs": "^0.6.0"
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
require('../babelRegisterOnly')([/react-packager\/src/]);
require('fast-path').replace();
require('node-haste/lib/fastpath').replace();
useGracefulFs();
var debug = require('debug');
+154
View File
@@ -0,0 +1,154 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
'use strict';
/**
* This script publishes a new version of react-native to NPM.
* It is supposed to run in CI environment, not on a developer's machine.
*
* To make it easier for developers it uses some logic to identify with which version to publish the package.
*
* To cut a branch (and release RC):
* - Developer: `git checkout -b 0.XY-stable`
* - Developer: `git tag v0.XY.0-rc` and `git push --tags` to git@github.com:facebook/react-native.git
* - CI: test and deploy to npm (run this script) with version 0.XY.0-rc with tag "next"
*
* To update RC release:
* - Developer: `git checkout 0.XY-stable`
* - Developer: cherry-pick whatever changes needed
* - Developer: `git tag v0.XY.0-rc1` and `git push --tags` to git@github.com:facebook/react-native.git
* - CI: test and deploy to npm (run this script) with version 0.XY.0-rc1 with tag "next"
*
* To publish a release:
* - Developer: `git checkout 0.XY-stable`
* - Developer: cherry-pick whatever changes needed
* - Developer: `git tag latest`
* - Developer: `git tag v0.XY.0`
* - Developer: `git push --tags` to git@github.com:facebook/react-native.git
* - CI: test and deploy to npm (run this script) with version 0.XY.0 with and not tag (latest is implied by npm)
*
* To patch old release:
* - Developer: `git checkout 0.XY-stable`
* - Developer: cherry-pick whatever changes needed
* - Developer: `git tag v0.XY.Z`
* - Developer: `git push` to git@github.com:facebook/react-native.git (or merge as pull request)
* - CI: test and deploy to npm (run this script) with version 0.XY.Z with no tag, npm will not mark it as latest if
* there is a version higher than XY
*
* Important tags:
* If tag v0.XY.0-rcZ is present on the commit then publish to npm with version 0.XY.0-rcZ and tag next
* If tag v0.XY.Z is present on the commit then publish to npm with version 0.XY.Z and no tag (npm will consider it latest)
*/
/*eslint-disable no-undef */
require(`shelljs/global`);
const buildBranch = process.env.CIRCLE_BRANCH;
const requiredJavaVersion = `1.7`;
let branchVersion;
if (buildBranch.indexOf(`-stable`) !== -1) {
branchVersion = buildBranch.slice(0, buildBranch.indexOf(`-stable`));
} else {
echo(`Error: We publish only from stable branches`);
exit(0);
}
// ['latest', 'v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2', 'v0.34.0', '']
const tagsWithVersion = exec(`git tag -l --points-at HEAD`).stdout.split(/\s/)
// ['v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2', 'v0.34.0']
.filter(version => !!version && version.indexOf(`v${branchVersion}`) === 0)
// ['v0.33.0', 'v0.33.0-rc', 'v0.33.0-rc1', 'v0.33.0-rc2']
.filter(version => version.indexOf(branchVersion) !== -1);
if (tagsWithVersion.length === 0) {
echo(`Error: Can't find version tag in current commit. To deploy to NPM you must add tag v0.XY.Z[-rc] to your commit`);
exit(1);
}
let releaseVersion;
if (tagsWithVersion[0].indexOf(`-rc`) === -1) {
// if first tag on this commit is non -rc then we are making a stable release
// '0.33.0'
releaseVersion = tagsWithVersion[0].slice(1);
} else {
// otherwise pick last -rc tag alphabetically
// 0.33.0-rc2
releaseVersion = tagsWithVersion[tagsWithVersion.length - 1].slice(1);
}
// -------- Generating Android Artifacts with JavaDoc
// Java -version outputs to stderr 0_o
const javaVersion = exec(`java -version`).stderr;
if (javaVersion.indexOf(requiredJavaVersion) === -1) {
echo(`Java version must be 1.7.x in order to generate Javadoc. Check: java -version`);
exit(1);
}
if (sed(`-i`, /^VERSION_NAME=[0-9\.]*-SNAPSHOT/, `VERSION_NAME=${releaseVersion}`, `ReactAndroid/gradle.properties`).code) {
echo(`Couldn't update version for Gradle`);
exit(1);
}
// Uncomment Javadoc generation
if (sed(`-i`, `// archives androidJavadocJar`, `archives androidJavadocJar`, `ReactAndroid/release.gradle`).code) {
echo(`Couldn't enable Javadoc generation`);
exit(1);
}
if (exec(`./gradlew :ReactAndroid:installArchives`).code) {
echo(`Couldn't generate artifacts`);
exit(1);
}
echo("Generated artifacts for Maven");
let artifacts = ['-javadoc.jar', '-sources.jar', '.aar', '.pom'].map((suffix) => {
return `react-native-${releaseVersion}${suffix}`;
});
artifacts.forEach((name) => {
if (!test(`-e`, `./android/com/facebook/react/react-native/${releaseVersion}/${name}`)) {
echo(ls(`./android/com/facebook/react/react-native/${releaseVersion}`));
echo(`file ${name} was not generated`);
exit(1);
}
});
// ----------- Reverting changes to local files
exec(`git checkout ReactAndroid/gradle.properties`);
exec(`git checkout ReactAndroid/release.gradle`);
if (exec(`npm version --no-git-tag-version ${releaseVersion}`).code) {
echo(`Couldn't update version for npm`);
exit(1);
}
if (sed(`-i`, `s.version = "0.0.1-master"`, `s.version = \"${releaseVersion}\"`, `React.podspec`).code) {
echo(`Couldn't update version for React.podspec`);
exit(1);
}
// shrinkwrapping without dev dependencies
exec(`npm shrinkwrap`);
if (releaseVersion.indexOf(`-rc`) === -1) {
// release, package will be installed by default
exec(`npm publish`);
} else {
// RC release, package will be installed only if users specifically do it
exec(`npm publish --tag next`);
}
exec(`git checkout package.json`);
exec(`git checkout React.podspec`);
echo(`Published to npm ${releaseVersion}`);
exit(0);
/*eslint-enable no-undef */
@@ -25,37 +25,12 @@ info() {
repo_root=$(pwd)
git branch | grep -o ${RELEASE}-stable && error "Branch already exists"
java -version 2>&1 | grep ${JAVA_VERSION} || error "Java version must be 1.7.x in order to generate Javadoc. Check: java -version"
git pull || error "Couldn't pull from remote repository"
git checkout -b ${RELEASE}-stable || error "Couldn't create branch"
success "Created release branch: ${RELEASE}-stable"
sed -i.bak s/^VERSION_NAME=[0-9\.]*-SNAPSHOT/VERSION_NAME=${RELEASE}.0/g "ReactAndroid/gradle.properties" || error "Couldn't update version for Gradle"
# Uncomment Javadoc generation
sed -i.bak s:\/\/\ archives\ androidJavadocJar:archives\ androidJavadocJar:g "ReactAndroid/release.gradle" || error "Couldn't enable Javadoc generation"
./gradlew :ReactAndroid:installArchives || error "Couldn't generate artifacts"
# Revert Javadoc generation
sed -i.bak s:archives\ androidJavadocJar:\/\/\ archives\ androidJavadocJar:g "ReactAndroid/release.gradle" || error "Couldn't enable Javadoc generation"
artifacts_list=( -javadoc.jar -sources.jar .aar .pom )
# ./gradlew :ReactAndroid:installArchives put the artifacts in react-native/android, ready to be published to npm
artifacts_dir="${repo_root}/android/com/facebook/react/react-native/${RELEASE}.0"
for i in "${artifacts_list[@]}"; do
artifact_file="${artifacts_dir}/react-native-${RELEASE}.0${i}"
[ -e "${artifact_file}" ] || error "Couldn't find file: ${artifact_file}"
done
success "Generated artifacts for Maven"
sed -i.bak -E "s/(\"version\":[[:space:]]*\").+(\")/\"version\": \"${RELEASE}.0-rc\"/g" "package.json" || error "Couldn't update version for npm"
sed -i.bak -E "s/(s.version[[:space:]]{13}=[[:space:]].+)/s.version = \"${RELEASE}.0-rc\"/g" "React.podspec" || error "Couldn't update version for CocoaPods"
success "Updated version numbers"
npm_registry="http://localhost:4873/"
npm set registry "${npm_registry}" && [[ $(npm config list | grep registry) == "registry = \"${npm_registry}\"" ]] || error "Couldn't set registry to ${npm_registry}"
@@ -67,6 +42,9 @@ info ""
info "Press any key to continue"
read -n 1
sed -i.bak -E "s/(\"version\":[[:space:]]*\").+(\")/\"version\": \"${RELEASE}.0-rc\"/g" "package.json" || error "Couldn't update version for npm"
sed -i.bak -E "s/(s.version[[:space:]]{13}=[[:space:]].+)/s.version = \"${RELEASE}.0-rc\"/g" "React.podspec" || error "Couldn't update version for CocoaPods"
npm unpublish --force || error "Couldn't unpublish package from sinopia (${npm_registry})"
npm publish || error "Couldn't publish package to sinopia (${npm_registry})"
@@ -101,16 +79,14 @@ open "/tmp/${project_name}/ios/${project_name}.xcodeproj"
cd "$repo_root"
info "Press any key to commit changes"
read -n 1
git commit -am "[${RELEASE}.0-rc] Bump version numbers"
# undo changes to files
git checkout package.json
git checkout React.podspec
git checkout ReactAndroid/gradle.properties
find . -path "*.bak" | xargs rm
npm set registry "https://registry.npmjs.org/" || error "Couldn't set registry to ${npm_registry}"
info "Next steps:"
info " - git push origin ${RELEASE}-stable"
info " - git tag v${RELEASE}.0-rc ${RELEASE}-stable"
info " - git push --tags"
info " - npm set registry https://registry.npmjs.org/"
info " - When doing a RC release: npm publish --tag next"
info " - When doing a non-RC release: npm publish # Sets the latest tag automatically"
info " - git tag v${RELEASE}.0-rc"
info " - git push origin ${RELEASE}-stable --tags"
+1 -2
View File
@@ -16,7 +16,6 @@
"react-docgen": "^2.0.1",
"react-page-middleware": "git://github.com/facebook/react-page-middleware.git",
"request": "^2.69.0",
"semver-compare": "^1.0.0",
"shelljs": "^0.6.0"
"semver-compare": "^1.0.0"
}
}