Skip to content
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

Synchronizing Internal and GitHub ComponentKit version #849

Merged
merged 32 commits into from
Aug 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
1cdeeb4
Moving CKStackLayout to Flexbox
Mar 3, 2017
34cac67
Moving CKStackLayout to Flexbox
Mar 3, 2017
91a84a2
Merge branch 'master' of https://github.com/gkassabli/componentkit
Mar 3, 2017
1c44f9d
Merge branch 'master' of https://github.com/gkassabli/componentkit
Mar 3, 2017
24306c9
Merge branch 'master' of https://github.com/gkassabli/componentkit
Mar 6, 2017
23d8900
Updating PR to the latest version
Apr 21, 2017
8606b4f
Merge
Apr 21, 2017
b4e9fce
Syntax corrections + keep yoga as Carthage submodule
Apr 21, 2017
65d881d
Correcting git submodules
Apr 22, 2017
21fdf66
Added changes
Apr 22, 2017
67edbc6
Build fixes
Apr 22, 2017
bab5146
Adding build dependencies
Apr 22, 2017
a8f6405
Bumping Yoga version
Apr 22, 2017
68b6e24
Updating yoga in Carthage
Apr 22, 2017
f4becf3
Update yoga to correct version
Apr 22, 2017
f7f02d7
Merge remote-tracking branch 'upstream/master'
Apr 26, 2017
3e88e5e
Update to the latest Yoga version
Apr 26, 2017
80d7d45
Update docs
May 3, 2017
5746762
Correcting snapshot test reference images
May 3, 2017
ab91652
Adding default layout to cache
May 4, 2017
c10717a
Update with recent code
Jun 30, 2017
f9bd045
Synchronizing internal repository with external repo.
Aug 2, 2017
9ad92aa
Correcting Readme
Aug 2, 2017
28be111
Merged
Aug 2, 2017
e682ed8
Adding screenshot tests for Flexbox
Aug 2, 2017
3c86270
Adding yoga as submodule
Aug 2, 2017
81208a3
Staging submodule
Aug 2, 2017
ced0b39
Staging submodule 2
Aug 2, 2017
3c468c9
Remove yoga from root
Aug 2, 2017
ec5fa35
Remove submodules
Aug 2, 2017
79b197b
Readding modules from scratch
Aug 2, 2017
70d7b03
Updating to Carthage tagged commits
Aug 2, 2017
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "Carthage/Checkouts/ios-snapshot-test-case"]
path = Carthage/Checkouts/ios-snapshot-test-case
url = https://github.com/facebook/ios-snapshot-test-case.git
[submodule "Carthage/Checkouts/yoga"]
path = Carthage/Checkouts/yoga
url = https://github.com/facebook/yoga.git
1 change: 1 addition & 0 deletions Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github "erikdoe/ocmock" ~> 3.3
github "facebook/ios-snapshot-test-case" ~> 2.1
github "jspahrsummers/xcconfigs" ~> 0.9
github "facebook/yoga" ~> 1.6.0
3 changes: 2 additions & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github "erikdoe/ocmock" "v3.4"
github "facebook/ios-snapshot-test-case" "2.1.4"
github "erikdoe/ocmock" "v3.3.1"
github "facebook/yoga" "1.6.0"
github "jspahrsummers/xcconfigs" "0.9"
2 changes: 1 addition & 1 deletion Carthage/Checkouts/ocmock
Submodule ocmock updated 33 files
+1 −1 .travis.yml
+1 −2 Examples/iOS9Example/iOS9ExampleTests/iOS9ExampleTests.m
+1 −1 Examples/iOS9Example/usr/include/OCMock/NSNotificationCenter+OCMAdditions.h
+6 −1 Examples/iOS9Example/usr/include/OCMock/OCMArg.h
+1 −1 Examples/iOS9Example/usr/include/OCMock/OCMConstraint.h
+27 −0 Examples/iOS9Example/usr/include/OCMock/OCMFunctions.h
+4 −2 Examples/iOS9Example/usr/include/OCMock/OCMLocation.h
+4 −1 Examples/iOS9Example/usr/include/OCMock/OCMMacroState.h
+1 −1 Examples/iOS9Example/usr/include/OCMock/OCMRecorder.h
+4 −3 Examples/iOS9Example/usr/include/OCMock/OCMStubRecorder.h
+35 −7 Examples/iOS9Example/usr/include/OCMock/OCMock.h
+1 −1 Examples/iOS9Example/usr/include/OCMock/OCMockObject.h
+ Examples/iOS9Example/usr/lib/libOCMock.a
+3 −3 OCMock.podspec
+14 −0 Source/Changes.txt
+39 −15 Source/OCMock.xcodeproj/project.pbxproj
+1 −1 Source/OCMock.xcodeproj/xcshareddata/xcschemes/OCMock iOS.xcscheme
+1 −1 Source/OCMock.xcodeproj/xcshareddata/xcschemes/OCMock tvOS.xcscheme
+1 −1 Source/OCMock.xcodeproj/xcshareddata/xcschemes/OCMock.xcscheme
+1 −1 Source/OCMock.xcodeproj/xcshareddata/xcschemes/OCMockLib.xcscheme
+8 −1 Source/OCMock/OCClassMockObject.m
+7 −2 Source/OCMock/OCMFunctions.m
+10 −1 Source/OCMock/OCMockObject.m
+5 −0 Source/OCMock/OCObserverMockObject.m
+18 −2 Source/OCMock/OCPartialMockObject.m
+13 −0 Source/OCMockTests/OCMBoxedReturnValueProviderTests.m
+0 −0 Source/OCMockTests/OCMockObjectHamcrestTests.m
+12 −0 Source/OCMockTests/OCMockObjectMacroTests.m
+93 −0 Source/OCMockTests/OCMockObjectPartialMocksTests.m
+20 −0 Source/OCMockTests/OCMockObjectRuntimeTests.m
+19 −0 Source/OCMockTests/OCMockObjectTests.m
+12 −0 Source/OCMockTests/Resources/TestObjects.xcdatamodeld/TestObjects.xcdatamodel/contents
+9 −9 Tools/build.rb
1 change: 1 addition & 0 deletions Carthage/Checkouts/yoga
Submodule yoga added at 79e294
141 changes: 79 additions & 62 deletions ComponentKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ComponentKit/ComponentKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
//Layout components
#import <ComponentKit/CKBackgroundLayoutComponent.h>
#import <ComponentKit/CKCenterLayoutComponent.h>
#import <ComponentKit/CKFlexboxComponent.h>
#import <ComponentKit/CKInsetComponent.h>
#import <ComponentKit/CKOverlayLayoutComponent.h>
#import <ComponentKit/CKRatioLayoutComponent.h>
#import <ComponentKit/CKStackLayoutComponent.h>
#import <ComponentKit/CKStaticLayoutComponent.h>
//Utilities
#import <ComponentKit/CKComponentAction.h>
Expand Down
2 changes: 1 addition & 1 deletion ComponentKit/Core/CKComponentMemoizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct CKMemoizationKey;
return CKMemoize(CKMakeTupleMemoizationKey(model, other), ^{
return [self
newWithComponent:
[CKStackLayoutComponent
[CKFlexboxComponent
newWith...
});
}
Expand Down
6 changes: 3 additions & 3 deletions ComponentKit/Core/CKCompositeComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

/**
CKCompositeComponent allows you to hide your implementation details and avoid subclassing layout components like
CKStackLayoutComponent. In almost all cases, you should subclass CKCompositeComponent instead of subclassing any other
CKFlexboxComponent. In almost all cases, you should subclass CKCompositeComponent instead of subclassing any other
class directly.

For example, suppose you create a component that should lay out some children in a vertical stack.
Incorrect: subclass CKStackLayoutComponent and call `self newWithChildren:`.
Correct: subclass CKCompositeComponent and call `super newWithComponent:[CKStackLayoutComponent newWithChildren...`
Incorrect: subclass CKFlexboxComponent and call `self newWithChildren:`.
Correct: subclass CKCompositeComponent and call `super newWithComponent:[CKFlexboxComponent newWithChildren...`

This hides your layout implementation details from the outside world.

Expand Down
12 changes: 7 additions & 5 deletions ComponentKit/Core/CKDimension.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ namespace std {

class CKRelativeDimension {
public:
enum class Type {
AUTO,
POINTS,
PERCENT,
};
/** Default constructor is equivalent to "Auto". */
constexpr CKRelativeDimension() noexcept : _type(Type::AUTO), _value(0) {}
CKRelativeDimension(CGFloat points) noexcept : CKRelativeDimension(Type::POINTS, points) {}
Expand All @@ -64,13 +69,10 @@ class CKRelativeDimension {
bool operator==(const CKRelativeDimension &) const noexcept;
NSString *description() const noexcept;
CGFloat resolve(CGFloat autoSize, CGFloat parent) const noexcept;
Type type() const noexcept;
CGFloat value() const noexcept;

private:
enum class Type {
AUTO,
POINTS,
PERCENT,
};
CKRelativeDimension(Type type, CGFloat value)
: _type(type), _value(value)
{
Expand Down
10 changes: 10 additions & 0 deletions ComponentKit/Core/CKDimension.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@
}
}

CKRelativeDimension::Type CKRelativeDimension::type(void) const noexcept
{
return _type;
}

CGFloat CKRelativeDimension::value(void) const noexcept
{
return _value;
}

size_t std::hash<CKRelativeDimension>::operator ()(const CKRelativeDimension &size) noexcept {
NSUInteger subhashes[] = {
(size_t)(size._type),
Expand Down
5 changes: 5 additions & 0 deletions ComponentKit/Debug/CKComponentHierarchyDebugHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
#import <ComponentKit/CKComponentViewConfiguration.h>

@class CKComponent;
@class CKComponentRootView;
@class UIView;

struct CKComponentLayout;

/**
CKComponentHierarchyDebugHelper allows
*/
Expand All @@ -26,4 +29,6 @@
*/
+ (NSString *)componentHierarchyDescription NS_EXTENSION_UNAVAILABLE("Recursively describes components using -[UIApplication keyWindow]");

+ (const CKComponentLayout *) rootLayoutFromRootView: (CKComponentRootView*) view;

@end
4 changes: 4 additions & 0 deletions ComponentKit/Debug/CKComponentHierarchyDebugHelper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ + (NSString *)componentHierarchyDescriptionForView:(UIView *)view searchUpwards:
}
}

+ (const CKComponentLayout *) rootLayoutFromRootView: (CKComponentRootView *)view {
return rootLayoutFromRootView(view);
}

static NSString *ancestorComponentHierarchyDescriptionForView(UIView *view, BOOL showViews)
{
NSString *ancestorDescription;
Expand Down
17 changes: 17 additions & 0 deletions ComponentKit/LayoutComponents/CKComponentLayoutBaseline.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2014-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.
*
*/

#import <Foundation/Foundation.h>

/**
Set a key value pair using this in CKComponentLayout.extra for a custom baseline.
e.g. @{kCKComponentLayoutExtraBaselineKey : 20}
*/
extern NSString *const kCKComponentLayoutExtraBaselineKey;
13 changes: 13 additions & 0 deletions ComponentKit/LayoutComponents/CKComponentLayoutBaseline.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2014-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.
*
*/

#import "CKComponentLayoutBaseline.h"

NSString *const kCKComponentLayoutExtraBaselineKey = @"kCKComponentLayoutExtraBaselineKey";
Loading