Skip to content

Commit

Permalink
Mods enabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Usbergo committed May 31, 2018
1 parent ecb9c77 commit 39adc8c
Show file tree
Hide file tree
Showing 18 changed files with 176 additions and 291 deletions.
219 changes: 63 additions & 156 deletions Render.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions Render.xcodeproj/xcshareddata/xcschemes/Test.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "RENDER_MOD_STYLESHEET"
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
Expand Down Expand Up @@ -94,11 +89,6 @@
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "RENDER_MOD_STYLESHEET"
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
Expand Down Expand Up @@ -127,11 +117,6 @@
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "RENDER_MOD_STYLESHEET"
value = "YES"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</ProfileAction>
<AnalyzeAction
Expand Down
11 changes: 7 additions & 4 deletions RenderNeutrino.podspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Pod::Spec.new do |s|
s.name = "RenderNeutrino"
s.version = "5.2"
s.version = "5.3"
s.summary = "Render is a declarative library for building efficient UIs on iOS inspired by React."
s.description = <<-DESC
s.platform = :ios
Render is a declarative library for building efficient UIs on iOS inspired by React.
* Declarative: Render uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of inputs and the framework takes care of the rest (diff and reconciliation from virtual view hierarchy to the actual one under the hood).
Expand All @@ -17,7 +18,9 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/alexdrone/Render.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/alexdrone'
s.ios.deployment_target = '10.0'
s.source_files = 'render/**/*.{swift,h,m}'


s.source_files = 'render/**/*', 'mods/inspector/**/*'
s.ios.public_header_files = ['render/**/*.{h}']
s.frameworks = 'UIKit'
s.module_name = "RenderNeutrino"
s.compiler_flags = ""
end
77 changes: 41 additions & 36 deletions demo/catalog/RenderNeutrinoDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
/* End PBXAggregateTarget section */

/* Begin PBXBuildFile section */
16016AB620C0706E003B434A /* RenderNeutrino.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16016AB320C0705C003B434A /* RenderNeutrino.framework */; };
16016AB720C0706E003B434A /* RenderNeutrino.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 16016AB320C0705C003B434A /* RenderNeutrino.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
160307581FE6810200044D00 /* counter.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 160307571FE6810200044D00 /* counter.yaml */; };
161456111FE5C89600B9E091 /* stylesheet.yaml in Resources */ = {isa = PBXBuildFile; fileRef = 161456101FE5C89600B9E091 /* stylesheet.yaml */; };
1614561C1FE5D44C00B9E091 /* Counter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1614561B1FE5D44C00B9E091 /* Counter.swift */; };
Expand Down Expand Up @@ -51,27 +53,27 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
16FB711420C02142007063B2 /* PBXContainerItemProxy */ = {
16016AB220C0705C003B434A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 16FB710E20C02142007063B2 /* Render.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FR_177833167596;
remoteInfo = Generate;
};
16FB711620C02142007063B2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 16FB710E20C02142007063B2 /* Render.xcodeproj */;
containerPortal = 16016AAD20C0705C003B434A /* Render.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FR_699701780932;
remoteInfo = RenderNeutrino;
};
16FB711820C02142007063B2 /* PBXContainerItemProxy */ = {
16016AB420C0705C003B434A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 16FB710E20C02142007063B2 /* Render.xcodeproj */;
containerPortal = 16016AAD20C0705C003B434A /* Render.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FR_479945003232;
remoteInfo = Test;
};
16016AB820C0706E003B434A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 16016AAD20C0705C003B434A /* Render.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = NT_699701780932;
remoteInfo = RenderNeutrino;
};
16FB711E20C021EB007063B2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 16FB711A20C021EB007063B2 /* RenderInspector.xcodeproj */;
Expand All @@ -88,13 +90,15 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
16016AB720C0706E003B434A /* RenderNeutrino.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
16016AAD20C0705C003B434A /* Render.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Render.xcodeproj; path = ../../Render.xcodeproj; sourceTree = "<group>"; };
160307571FE6810200044D00 /* counter.yaml */ = {isa = PBXFileReference; lastKnownFileType = text; path = counter.yaml; sourceTree = "<group>"; };
161456101FE5C89600B9E091 /* stylesheet.yaml */ = {isa = PBXFileReference; lastKnownFileType = text; path = stylesheet.yaml; sourceTree = "<group>"; };
1614561B1FE5D44C00B9E091 /* Counter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Counter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -124,7 +128,6 @@
16D24C441FD5705E000BADB9 /* AppStoreEntryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppStoreEntryViewController.swift; sourceTree = "<group>"; };
16D5F6CA2011FDEF0003CDF7 /* S.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = S.generated.swift; sourceTree = "<group>"; };
16ED28021FD5A74900D5E222 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
16FB710E20C02142007063B2 /* Render.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Render.xcodeproj; path = ../../Render.xcodeproj; sourceTree = "<group>"; };
16FB711A20C021EB007063B2 /* RenderInspector.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RenderInspector.xcodeproj; path = ../../tools/src/inspector/ios/RenderInspector.xcodeproj; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -133,12 +136,22 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
16016AB620C0706E003B434A /* RenderNeutrino.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
16016AAE20C0705C003B434A /* Products */ = {
isa = PBXGroup;
children = (
16016AB320C0705C003B434A /* RenderNeutrino.framework */,
16016AB520C0705C003B434A /* Test.xctest */,
);
name = Products;
sourceTree = "<group>";
};
166F93FD20890A7F0084D5ED /* common */ = {
isa = PBXGroup;
children = (
Expand All @@ -161,8 +174,8 @@
168FA6CA1F8F856D00A12585 = {
isa = PBXGroup;
children = (
16016AAD20C0705C003B434A /* Render.xcodeproj */,
16FB711A20C021EB007063B2 /* RenderInspector.xcodeproj */,
16FB710E20C02142007063B2 /* Render.xcodeproj */,
168FA6D51F8F856D00A12585 /* src */,
168FA6D41F8F856D00A12585 /* Products */,
169DC8E61F93A4A000625FA6 /* Frameworks */,
Expand Down Expand Up @@ -248,16 +261,6 @@
path = components;
sourceTree = "<group>";
};
16FB710F20C02142007063B2 /* Products */ = {
isa = PBXGroup;
children = (
16FB711520C02142007063B2 /* Generate.app */,
16FB711720C02142007063B2 /* RenderNeutrino.framework */,
16FB711920C02142007063B2 /* Test.xctest */,
);
name = Products;
sourceTree = "<group>";
};
16FB711B20C021EB007063B2 /* Products */ = {
isa = PBXGroup;
children = (
Expand All @@ -282,6 +285,7 @@
buildRules = (
);
dependencies = (
16016AB920C0706E003B434A /* PBXTargetDependency */,
);
name = RenderNeutrinoDemo;
productName = PureDemo;
Expand Down Expand Up @@ -321,8 +325,8 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = 16FB710F20C02142007063B2 /* Products */;
ProjectRef = 16FB710E20C02142007063B2 /* Render.xcodeproj */;
ProductGroup = 16016AAE20C0705C003B434A /* Products */;
ProjectRef = 16016AAD20C0705C003B434A /* Render.xcodeproj */;
},
{
ProductGroup = 16FB711B20C021EB007063B2 /* Products */;
Expand All @@ -338,25 +342,18 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
16FB711520C02142007063B2 /* Generate.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = Generate.app;
remoteRef = 16FB711420C02142007063B2 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
16FB711720C02142007063B2 /* RenderNeutrino.framework */ = {
16016AB320C0705C003B434A /* RenderNeutrino.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = RenderNeutrino.framework;
remoteRef = 16FB711620C02142007063B2 /* PBXContainerItemProxy */;
remoteRef = 16016AB220C0705C003B434A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
16FB711920C02142007063B2 /* Test.xctest */ = {
16016AB520C0705C003B434A /* Test.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = Test.xctest;
remoteRef = 16FB711820C02142007063B2 /* PBXContainerItemProxy */;
remoteRef = 16016AB420C0705C003B434A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
16FB711F20C021EB007063B2 /* RenderInspector.framework */ = {
Expand Down Expand Up @@ -444,6 +441,14 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
16016AB920C0706E003B434A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = RenderNeutrino;
targetProxy = 16016AB820C0706E003B434A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
168FA6DF1F8F856D00A12585 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
Expand Down
20 changes: 4 additions & 16 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,22 @@ targets:
type: framework
sources:
- render/
- mods/
headers:
- render/RenderNeutrino.h
- render/deps/yoga/
- mods/deps/yaml/yaml.h
- render/mods/deps/yaml/yaml.h
settings:
base:
INFOPLIST_FILE: render/Info.plist
PRODUCT_BUNDLE_IDENTIFIER: io.alexdrone.render
PLATFORM: platform $platform
SWIFT_WHOLE_MODULE_OPTIMIZATION: YES
RENDER_MOD_INSPECTOR: YES
RENDER_MOD_STYLESHEET: YES
OTHERCFLAGS: -DRENDER_MOD_INSPECTOR -DRENDER_MOD_STYLESHEET
configFiles:
Debug: configs/Debug.xcconfig
Release: configs/Release.xcconfig
Generate:
platform: macOS
type: application
sources:
- tools/src/generate/
- mods/stylesheet/
headers:
- tools/src/generate/generate-Bridging-Header.h
settings:
base:
SWIFT_OBJC_BRIDGING_HEADER: tools/src/generate/generate-Bridging-Header.h
Test:
platform: iOS
type: bundle.unit-test
Expand All @@ -50,6 +41,3 @@ targets:
- variable: TEST
value: YES
isEnabled: true
- variable: RENDER_MOD_STYLESHEET
value: YES
isEnabled: true
4 changes: 2 additions & 2 deletions render/deps/yoga/YGExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public extension UIView {

// MARK: - UIStylesheetRepresentableEnum Yoga Compliancy

#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
extension YGAlign: UIStylesheetRepresentableEnum {
public init?(rawValue: Int) { self.init(rawValue: Int32(rawValue)) }
public static func expressionConstants() -> [String : Double] { return [:] }
Expand Down Expand Up @@ -586,4 +586,4 @@ extension YGDisplay: UIStylesheetRepresentableEnum {
public init?(rawValue: Int) { self.init(rawValue: Int32(rawValue)) }
public static func expressionConstants() -> [String : Double] { return [:] }
}
#endif
//#endif
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
//
// Expression.swift
// Expression
Expand Down Expand Up @@ -1813,4 +1813,4 @@ extension Optional: _Optional {
static var nullValue: Any { return none as Any }
}

#endif
//#endif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
import Foundation

final class YAMLConstructor {
Expand Down Expand Up @@ -2134,4 +2134,4 @@ extension YAMLError {
return (YAMLMark(line: line + 1, column: column + 1), contents)
}
}
#endif
//#endif
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
import UIKit

// MARK: - UIStylesheet
Expand Down Expand Up @@ -859,4 +859,4 @@ extension UIStyleProtocol {
return identifiers
}
}
#endif
//#endif
8 changes: 4 additions & 4 deletions render/src/Component.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ open class UIComponent<S: UIStateProtocol, P: UIPropsProtocol>: NSObject, UIComp
}
guard parent == nil, canvasView != nil else { return }
self.setNeedsRender()
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
try? UIStylesheetManager.default.load(file: nil)
#endif
//#endif
}

public func setNeedsRender(options: [UIComponentRenderOption] = []) {
Expand All @@ -209,9 +209,9 @@ open class UIComponent<S: UIStateProtocol, P: UIPropsProtocol>: NSObject, UIComp
}
// Updates the context's screen state.
context._screenStateFactory.bounds = renderSize()
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
UIStylesheetManager.default.canvasSize = renderSize()
#endif
//#endif
// Rendering is suspended for this context for the time being.
// 'resumeFromSuspendedRenderingIfNecessary' will automatically be called when the render
// context will be resumed.
Expand Down
4 changes: 2 additions & 2 deletions render/src/Node.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ public class UINode<V: UIView>: UINodeProtocol {
// optimisation: applies the stylesheet-defined styles separately in order to merge
// together is a single computed style.
// - note: Non-UIStylesheetProtocol compliant styles are skipped.
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
UIStylesheetApplyStyles(styles, to: view)
#endif
//#endif

// Applies *UIStyle* subclasses.
for style in styles.compactMap({ $0 as? UIStyle }) {
Expand Down
4 changes: 2 additions & 2 deletions test/StylesheetTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
import UIKit
@testable import RenderNeutrino
#if RENDER_MOD_STYLESHEET
//#if RENDER_MOD_STYLESHEET
class StylesheetTests: XCTestCase {

let test: String = "Test"
Expand Down Expand Up @@ -160,5 +160,5 @@ View:
width_percentage: 100
customNonApplicableProperty: 42
"""
#endif
//#endif

Loading

0 comments on commit 39adc8c

Please sign in to comment.