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

[RFC] In Progress - Release 1.0 - Swift Codegen #1876

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
90cdb47
Revert "Remove swiftExperimental from codegen"
calvincestari Jul 20, 2021
0c6b976
Codegen test updates (#1877)
calvincestari Jul 21, 2021
0808589
Bring back all the pluralization (#1879)
calvincestari Jul 21, 2021
9aa9015
Revert "Remove Animal Kingdom - using swiftExperimental"
calvincestari Jul 21, 2021
ff35066
Use the correct code generation engine option
calvincestari Jul 22, 2021
1f4048b
Merge branch 'main' of https://github.com/apollographql/apollo-ios in…
AnthonyMDev Sep 21, 2021
ddabe6c
Initial commit of refactoring models and execution for 1.0
AnthonyMDev Sep 22, 2021
e8ac208
Variables on GraphQLOperation - Refactor (#1963)
AnthonyMDev Sep 23, 2021
5362e8f
Refactor GraphQLOperation definition models (#1964)
AnthonyMDev Sep 23, 2021
764f005
OperationDefinition should include fragments at types
AnthonyMDev Sep 24, 2021
20a94cf
Merge branch 'main' into release/1.0-alpha-incubating
calvincestari Sep 24, 2021
7c4e7ac
Added InputObject and RFC documentation (#1969)
AnthonyMDev Sep 27, 2021
1c6b5cf
Added GraphQLEnum and EnumType to RFC (#1970)
AnthonyMDev Sep 27, 2021
8952094
Started OperationDefinition generation spec
AnthonyMDev Sep 27, 2021
ee80100
FieldAccessor Documentation
AnthonyMDev Sep 27, 2021
f9b866f
Clarified default values for InputObjects in RFC
AnthonyMDev Sep 27, 2021
135c991
Added cache key resolution to RFC
AnthonyMDev Sep 27, 2021
526dd27
Add Unions to RFC
AnthonyMDev Sep 27, 2021
f45fcc7
Added Key Changes section to RFC
AnthonyMDev Sep 28, 2021
107cc3c
Additions to RFC
AnthonyMDev Sep 28, 2021
d84affd
Expected generated output examples and clarifications to RFC
AnthonyMDev Sep 28, 2021
73fc1d3
Cleaned up ClassroomPetsQuery example output
AnthonyMDev Sep 29, 2021
6f9a96d
Fixed imports and added debug descriptions in codegen frontend
AnthonyMDev Sep 29, 2021
1d4f8ef
Fix debug descriptions for Inline Fragments
AnthonyMDev Sep 29, 2021
fd554db
WIP: More Cleanup
AnthonyMDev Sep 29, 2021
4348a35
Refactor codegen configuration (#1975)
calvincestari Sep 30, 2021
b64ca54
Squashed commit of the following:
AnthonyMDev Sep 30, 2021
3c8dd00
Added note to RFC about SE-309
AnthonyMDev Oct 1, 2021
7e177b8
Disable CI on any 1.0 named branch (#1978)
calvincestari Oct 1, 2021
cc81c82
Rename generated selections sets to mirror field names instead of par…
AnthonyMDev Oct 11, 2021
e74f545
Merge branch 'main' into release/1.0-alpha-incubating
calvincestari Oct 15, 2021
3bb0f46
Add validation of codegen configuration (#1990)
calvincestari Oct 20, 2021
101ba85
Merge branch 'main' into release/1.0-alpha-incubating
AnthonyMDev Oct 28, 2021
e1bd1ce
Refactor `ApolloExtension` of `FileManager` (#1999)
calvincestari Oct 29, 2021
c41f866
Say Goodbye to Apollo CLI (#2003)
calvincestari Oct 29, 2021
4745545
Create AST for code generation [1/x] (#2009)
AnthonyMDev Nov 2, 2021
33de7d5
Migrate Codegen Javascript bridge to use graphql-js 16.0.1 (#2018)
AnthonyMDev Nov 4, 2021
b843c2a
Added examples of Generated legacy models to AnimalKingdomAPI
AnthonyMDev Nov 9, 2021
6d057c7
AST Field Model (#2023)
AnthonyMDev Nov 9, 2021
87f7c19
Merge branch 'main' into release/1.0-alpha-incubating
calvincestari Nov 19, 2021
18a26da
Fix `FileManagerExtensionTests` matching function (#2044)
calvincestari Nov 30, 2021
d24a512
Implements a glob path builder (#2041)
calvincestari Dec 1, 2021
6e3ee68
Compute MergedSelections as a memoized tree (#2045)
AnthonyMDev Dec 3, 2021
b16f5b6
Update FileManager extension function return (#2046)
calvincestari Dec 6, 2021
d20d795
Move validation of ApolloCodegenConfiguration (#2050)
calvincestari Dec 6, 2021
c2b3654
Change framework embed policy for UploadAPI and AnimalKingdomAPI (#2052)
calvincestari Dec 7, 2021
b89a27a
Remove unnecessary ApolloAPI import (#2051)
calvincestari Dec 7, 2021
40b1afe
Invert Dependency on JavaScriptBridge (#2056)
AnthonyMDev Dec 9, 2021
72acfa4
Generate CompilationResult (#2055)
calvincestari Dec 9, 2021
272611a
Add Glob test for absolute path matching (#2061)
calvincestari Dec 10, 2021
680f34a
Refactor Operation Builder Tests to Compile GraphQL Operations (#2064)
AnthonyMDev Dec 14, 2021
1b52864
Generate Operation Definition DocumentType template (#2066)
AnthonyMDev Dec 14, 2021
1c241f3
Generate Schema Template File (#2067)
AnthonyMDev Dec 15, 2021
d27286e
Refactor OperationBuilder to enable building of Fragments (#2069)
AnthonyMDev Dec 15, 2021
27306a3
Rename templates from "Generator" to "Template" (#2070)
AnthonyMDev Dec 15, 2021
e6b761d
Refactor FragmentProtocols to remove HasFragments (#2071)
AnthonyMDev Dec 17, 2021
9d9cc56
[FIX] Add DataDict.swift to xcodeproject
AnthonyMDev Jan 4, 2022
7ee1c96
Refactor `MockFileManager` (#2077)
calvincestari Jan 4, 2022
48fbb32
Minor fixes
AnthonyMDev Jan 4, 2022
adb9796
Merge branch 'release/1.0-alpha-incubating' of https://github.com/apo…
AnthonyMDev Jan 4, 2022
1b5136b
`GraphQLObjectType` File Generator (#2076)
calvincestari Jan 12, 2022
0f66511
File generators for other schema types (#2093)
calvincestari Jan 19, 2022
be53eb0
InterfaceFileGenerator Template Content (#2102)
calvincestari Jan 21, 2022
841798c
SchemaFileGenerator Template Content (#2097)
calvincestari Jan 21, 2022
1430a35
EnumFileGenerator Template Content (#2098)
calvincestari Jan 21, 2022
9411838
Merge-Only Selection Set: Nested Entity Field Merging (#2103)
AnthonyMDev Jan 21, 2022
6dd40a5
SelectionSet Template Generator [1/X] (#2105)
AnthonyMDev Jan 24, 2022
20e7475
Render Selection Set Template [2/X] (#2109)
AnthonyMDev Jan 24, 2022
25342e4
Implements `InputObjectTemplate` for GraphQL schema `input` types (#2…
calvincestari Jan 28, 2022
5043a53
Implements `UnionTemplate` for GraphQL schema `union` types (#2114)
calvincestari Jan 28, 2022
24d1075
Implements `TypeTemplate` for GraphQL schema object types (#2116)
calvincestari Jan 28, 2022
b9d7362
Render Selection Set Templates [3/X] (#2117)
AnthonyMDev Jan 28, 2022
3922f8c
Dependency Automation - Swift Package Manager (#2120)
calvincestari Jan 29, 2022
3024798
1.0/operation and fragment generator (#2121)
AnthonyMDev Jan 31, 2022
dabe11e
SelectionSet Template Rendering [4/X] (#2124)
AnthonyMDev Feb 1, 2022
ff490d4
Add Union and root types to referenced types in JS FrontEnd (#2126)
AnthonyMDev Feb 1, 2022
389774d
FragmentDefinition rendering & unit test fixes (#2127)
AnthonyMDev Feb 2, 2022
25506e9
Add documentation with selection set name to rendered selection sets …
AnthonyMDev Feb 3, 2022
9afa572
Added missing test for duplicated operation name in generated operati…
AnthonyMDev Feb 3, 2022
19d5306
Refactor file generators to be more functional (#2132)
calvincestari Feb 4, 2022
6fbbddb
Update swift scripting documentation for alpha & refactor codegen con…
AnthonyMDev Feb 4, 2022
43d2013
Fix paths for generated files (#2135)
calvincestari Feb 4, 2022
1c9cc6b
Get all codegen tests working (#2136)
calvincestari Feb 4, 2022
f6d14d3
Re-enable CI test runs for 1.0 branch (#2141)
calvincestari Feb 7, 2022
c6dc925
Remove warning directives (#2139)
calvincestari Feb 8, 2022
b6f324d
File Template Updates (#2142)
calvincestari Feb 8, 2022
7b15861
Update Codegen Swift script and AnimalKingdomAPI generated files (#2144)
calvincestari Feb 8, 2022
3a1106d
Prepare alpha release (#2140)
calvincestari Feb 8, 2022
5739b46
Fix documentation link
AnthonyMDev Feb 8, 2022
1d67d45
Merge branch 'main' into release/1.0-alpha-incubating
calvincestari Feb 11, 2022
1e71ad0
docs: Update broken heading hash
trevorblades Feb 14, 2022
ad37c60
Generate Operation Variables & Field Arguments (#2163)
AnthonyMDev Feb 22, 2022
8a1dd73
Ensure SelectionSet field accessors are generated with swift camelCas…
AnthonyMDev Feb 22, 2022
9729f74
Prepare Alpha 2 Release
AnthonyMDev Feb 22, 2022
9db65f0
Make fragments property public (#2173)
klanchman Feb 24, 2022
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
28 changes: 28 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,18 +200,46 @@ workflows:
jobs:
- Swift_Build:
name: Build with SPM
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- IntegrationTests_macOS_current:
name: Apollo Integration Tests macOS << pipeline.parameters.macos_version >>
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- macOS_current:
name: Apollo macOS << pipeline.parameters.macos_version >>
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- iOS_current:
name: Apollo iOS << pipeline.parameters.ios_current_version >>
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- iOS_previous:
name: Apollo iOS << pipeline.parameters.ios_previous_version >>
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- tvOS_current:
name: Apollo tvOS << pipeline.parameters.tvos_version >>
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- CodegenLib_macOS_current:
name: Swift Code Generation
filters:
# Don't run this on any branch with "1.0" in the name (temporary!)
branches:
ignore: /.*1.0.*/
- CocoaPodsTrunk:
name: Push Podspec to CocoaPods Trunk
requires:
Expand Down
4 changes: 0 additions & 4 deletions Apollo.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Pod::Spec.new do |s|

s.subspec 'Core' do |ss|
ss.source_files = 'Sources/Apollo/*.swift','Sources/ApolloUtils/*.swift','Sources/ApolloAPI/*.swift'
ss.exclude_files = 'Sources/ApolloAPI/CodegenV1/*.swift'
ss.preserve_paths = [
'scripts/run-bundled-codegen.sh',
]
end

# Apollo provides exactly one persistent cache out-of-the-box, as a reasonable default choice for
Expand Down
952 changes: 785 additions & 167 deletions Apollo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
{
"object": {
"pins": [
{
"package": "CwlCatchException",
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
"state": {
"branch": null,
"revision": "35f9e770f54ce62dd8526470f14c6e137cef3eea",
"version": "2.1.1"
}
},
{
"package": "CwlPreconditionTesting",
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state": {
"branch": null,
"revision": "c21f7bab5ca8eee0a9998bbd17ca1d0eb45d4688",
"version": "2.1.0"
}
},
{
"package": "InflectorKit",
"repositoryURL": "https://github.com/mattt/InflectorKit.git",
"state": {
"branch": null,
"revision": "d8cbcc04972690aaa5fc760a2b9ddb3e9f0decd7",
"version": "1.0.0"
}
},
{
"package": "Nimble",
"repositoryURL": "https://github.com/Quick/Nimble.git",
"state": {
"branch": null,
"revision": "c93f16c25af5770f0d3e6af27c9634640946b068",
"version": "9.2.1"
}
},
{
"package": "SQLite.swift",
"repositoryURL": "https://github.com/stephencelis/SQLite.swift.git",
Expand All @@ -9,6 +45,15 @@
"revision": "60a65015f6402b7c34b9a924f755ca0a73afeeaa",
"version": "0.13.1"
}
},
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections.git",
"state": {
"branch": null,
"revision": "48254824bb4248676bf7ce56014ff57b142b77eb",
"version": "1.0.2"
}
}
]
},
Expand Down
1,642 changes: 1,642 additions & 0 deletions CodegenProposal.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Configuration/Apollo/Apollo-Target-AnimalKingdomAPI.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "../Shared/Workspace-Universal-Framework.xcconfig"

INFOPLIST_FILE = Sources/AnimalKingdomAPI/Info.plist
2 changes: 1 addition & 1 deletion Configuration/Shared/Workspace-Target-Test.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ ENABLE_BITCODE = NO
WARNING_CFLAGS = $(inherited) -Wno-documentation-unknown-command -Wno-incomplete-module -Wno-disabled-macro-expansion -Wno-shadow

/// Test Target Deployment Target
MACOSX_DEPLOYMENT_TARGET = 10.15
MACOSX_DEPLOYMENT_TARGET = 11.0
2 changes: 1 addition & 1 deletion Configuration/Shared/Workspace-Target-TestSupport.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(PLATFORM_DIR)/Developer/L
OTHER_LDFLAGS = -weak_framework XCTest

/// Test Target Deployment Target
MACOSX_DEPLOYMENT_TARGET = 10.15
MACOSX_DEPLOYMENT_TARGET = 11.0
18 changes: 18 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{
"object": {
"pins": [
{
"package": "InflectorKit",
"repositoryURL": "https://github.com/mattt/InflectorKit",
"state": {
"branch": null,
"revision": "d8cbcc04972690aaa5fc760a2b9ddb3e9f0decd7",
"version": "1.0.0"
}
},
{
"package": "SQLite.swift",
"repositoryURL": "https://github.com/stephencelis/SQLite.swift.git",
Expand All @@ -9,6 +18,15 @@
"revision": "60a65015f6402b7c34b9a924f755ca0a73afeeaa",
"version": "0.13.1"
}
},
{
"package": "swift-collections",
"repositoryURL": "https://github.com/apple/swift-collections",
"state": {
"branch": null,
"revision": "2d33a0ea89c961dcb2b3da2157963d9c0370347e",
"version": "1.0.1"
}
}
]
},
Expand Down
14 changes: 10 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/stephencelis/SQLite.swift.git",
.upToNextMinor(from: "0.13.1"))
.upToNextMinor(from: "0.13.1")),
.package(
url: "https://github.com/mattt/InflectorKit",
.upToNextMinor(from: "1.0.0")),
.package(
url: "https://github.com/apple/swift-collections",
.upToNextMajor(from: "1.0.0"))
],
targets: [
.target(
Expand All @@ -54,8 +60,7 @@ let package = Package(
name: "ApolloAPI",
dependencies: [],
exclude: [
"Info.plist",
"CodegenV1"
"Info.plist"
]),
.target(
name: "ApolloUtils",
Expand All @@ -67,14 +72,15 @@ let package = Package(
name: "ApolloCodegenLib",
dependencies: [
"ApolloUtils",
.product(name: "InflectorKit", package: "InflectorKit"),
.product(name: "OrderedCollections", package: "swift-collections")
],
exclude: [
"Info.plist",
"Frontend/JavaScript",
],
resources: [
.copy("Frontend/dist/ApolloCodegenFrontend.bundle.js"),
.copy("Frontend/dist/ApolloCodegenFrontend.bundle.js.map")
]),
.target(
name: "ApolloSQLite",
Expand Down
11 changes: 11 additions & 0 deletions Sources/AnimalKingdomAPI/AnimalKingdomAPI.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#import <Foundation/Foundation.h>

//! Project version number for AnimalKingdomAPI.
FOUNDATION_EXPORT double AnimalKingdomAPIVersionNumber;

//! Project version string for AnimalKingdomAPI.
FOUNDATION_EXPORT const unsigned char AnimalKingdomAPIVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <AnimalKingdomAPI/PublicHeader.h>


Loading