Skip to content

Add missing files from internal repo sync #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GitHub Issues in the `facebook/react-native` repository are used exclusively for tracking bugs in React Native.
GitHub Issues in the `Microsoft/react-native` repository are used exclusively for tracking bugs in the Microsoft/React Native fork. If the issue concerns Facebook's react-native, submit the issue to facebook/react-native.

Please take a look at the issue templates at https://github.com/facebook/react-native/issues/new/choose before submitting a new issue. Following one of the issue templates will ensure maintainers can route your request efficiently. Thanks!
37 changes: 1 addition & 36 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,2 @@
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
<!-- Make sure you are targeting Microsoft/react-native for your PR, if you mean to submit your change to the Microsoft fork, instead of to Facebook's react-native -->

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.

Test Plan:
----------
Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!

Release Notes:
--------------
Help reviewers and the release process by writing your own release notes. See below for an example.

[CATEGORY] [TYPE] [LOCATION] - Message

<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|

EXAMPLES:

[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
71 changes: 1 addition & 70 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
# Xcode
!**/*.xcodeproj
!**/*.pbxproj
Expand Down Expand Up @@ -53,10 +52,6 @@ node_modules
*.log
.nvm
/bots/node_modules/

# TODO: Check in yarn.lock in open source. Right now we need to keep it out
# from the GitHub repo as importing it might conflict with internal workspaces
yarn.lock
package-lock.json

# OS X
Expand All @@ -69,76 +64,12 @@ package-lock.json
/coverage
/third-party
/packages/
=======
# Xcode
!**/*.xcodeproj
!**/*.pbxproj
!**/*.xcworkspacedata
!**/*.xcsettings
!**/*.xcscheme
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Gradle
/build/
/RNTester/android/app/build/
/RNTester/android/app/gradle/
/RNTester/android/app/gradlew
/RNTester/android/app/gradlew.bat
/ReactAndroid/build/

# Buck
.buckd
buck-out
/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/
/ReactAndroid/src/main/jni/prebuilt/lib/x86/
/ReactAndroid/src/main/gen

# Watchman
.watchmanconfig

# Android
.idea
.gradle
local.properties
*.iml
/android/

# Node
node_modules
*.log
.nvm
/bots/node_modules/
package-lock.json

# OS X
.DS_Store

# Test generated files
/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
*.js.meta

/coverage
/third-party

# Root dir shouldn't have Xcode project
/*.xcodeproj

# ReactCommon subdir shouldn't have Xcode project
/ReactCommon/**/*.xcodeproj
RNTester/build
>>>>>>> v0.57.0
RNTester/build
33 changes: 33 additions & 0 deletions Folly/folly/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SOURCES=$(wildcard *.md)
PDF=$(SOURCES:%.md=%.pdf)
HTML=$(SOURCES:%.md=%.html)
INSTALL=install -c -m 644
PYTHON=python
PANDOCARGS=-s
PANDOC=/usr/bin/pandoc

export LANGUAGE=C
export LC_ALL=C

all: html index.html

pdf: $(PDF)

html: $(HTML)

# This needs pandoc 1.9 or later to work
%.pdf: %.md
$(PANDOC) -f markdown -o $*.pdf $*.md

%.html: %.md style.css
$(PANDOC) $(PANDOCARGS) -H style.css -f markdown -t html --toc -o $*.html $*.md

docs.md: $(SOURCES) style.css
$(PANDOC) $(PANDOCARGS) -H style.css -f markdown -t markdown --toc -o $@ *.md

index.html: $(SOURCES) style.css
$(PANDOC) $(PANDOCARGS) -H style.css -f markdown -t html --toc -o $@ *.md


clean:
$(RM) $(PDF) $(HTML) index.html
11 changes: 11 additions & 0 deletions Folly/folly/test/function_benchmark/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ACLOCAL_AMFLAGS = -I m4

# depends on libfollybenchmark

# TESTS = function_benchmark

# check_PROGRAMS = $(TESTS)

# noinst_HEADERS = test_functions.h benchmark_impl.h

# function_benchmark_SOURCES = benchmark_impl.cpp main.cpp test_functions.cpp
58 changes: 58 additions & 0 deletions Folly/folly/test/function_benchmark/benchmark_impl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <folly/test/function_benchmark/benchmark_impl.h>

#include <folly/test/function_benchmark/test_functions.h>

/*
* These functions are defined in a separate file so that gcc won't be able to
* inline them and optimize away the indirect calls.
*/

void BM_fn_ptr_invoke_impl(int iters, void (*fn)()) {
for (int n = 0; n < iters; ++n) {
fn();
}
}

void BM_std_function_invoke_impl(int iters,
const std::function<void()>& fn) {
for (int n = 0; n < iters; ++n) {
fn();
}
}

void BM_Function_invoke_impl(int iters,
const folly::Function<void() const>& fn) {
for (int n = 0; n < iters; ++n) {
fn();
}
}

void BM_mem_fn_invoke_impl(int iters,
TestClass* tc,
void (TestClass::*memfn)()) {
for (int n = 0; n < iters; ++n) {
(tc->*memfn)();
}
}

void BM_virtual_fn_invoke_impl(int iters, VirtualClass* vc) {
for (int n = 0; n < iters; ++n) {
vc->doNothing();
}
}
51 changes: 51 additions & 0 deletions Folly/folly/test/function_benchmark/benchmark_impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <functional>

#include <folly/Function.h>

class TestClass;
class VirtualClass;

void BM_fn_ptr_invoke_impl(int iters, void (*fn)());
void BM_std_function_invoke_impl(int iters, const std::function<void()>& fn);
void BM_Function_invoke_impl(int iters,
const folly::Function<void() const>& fn);
void BM_mem_fn_invoke_impl(int iters,
TestClass* tc,
void (TestClass::*memfn)());
void BM_virtual_fn_invoke_impl(int iters, VirtualClass* vc);

// Inlined version of BM_fn_ptr_invoke_impl().
// The compiler could potentially even optimize the call to the function
// pointer if it is a constexpr.
inline void BM_fn_ptr_invoke_inlined_impl(int iters, void (*fn)()) {
for (int n = 0; n < iters; ++n) {
fn();
}
}

// Invoke a function object as a template parameter.
// This can be used to directly invoke lambda functions
template<typename T>
void BM_invoke_fn_template_impl(int iters, const T& fn) {
for (int n = 0; n < iters; ++n) {
fn();
}
}
Loading