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

Add Swift support #178

Open
wants to merge 86 commits into
base: experimental-record
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
ab46995
Improving examples build configs and documentation.
jferreyra-sc Dec 15, 2023
fb63bbc
reverted to sdk 30.0.2
jferreyra-sc Dec 15, 2023
0e5bd48
Set min deployment target on iOS 11 for the example xcode project
jferreyra-sc Dec 19, 2023
f2143f8
Added npm instructions and examples server instructions.
jferreyra-sc Dec 19, 2023
fd1b314
Use std::expected for outcome when available
jb-gcx Mar 14, 2024
ecffe7e
Merge pull request #166 from jb-gcx/gcx/use-std-expected
li-feng-sc Apr 4, 2024
cde53fd
Merge remote-tracking branch 'origin/main' into experimental-record
li-feng-sc Apr 10, 2024
5e03b11
swift test
li-feng-sc Apr 16, 2024
3f40e5a
Fix compilation for djinni::Future
jb-gcx May 8, 2024
2e8e231
wip example
li-feng-sc May 16, 2024
1d84790
cpp files
li-feng-sc May 16, 2024
ff0c4e8
remove unneeded dep
li-feng-sc May 16, 2024
47e3ddd
Merge pull request #168 from jb-gcx/gcx/fixup-future
li-feng-sc May 17, 2024
2e8e189
optimize parameter copy
li-feng-sc May 17, 2024
3e3a662
refactor
li-feng-sc May 21, 2024
420ccc2
refactor
li-feng-sc May 21, 2024
1135f3a
Make DJFuture results nonnull in objective C
jb-gcx May 21, 2024
2842302
namespace
li-feng-sc May 22, 2024
5d95c1b
implement proxy caches
li-feng-sc May 24, 2024
8552689
initial codegen
li-feng-sc Jun 4, 2024
cf0fb53
+nc
li-feng-sc Jun 4, 2024
9972b74
wip
li-feng-sc Jun 14, 2024
9a74ee9
Merge pull request #170 from jb-gcx/gcx/nonnull-future
li-feng-sc Jun 26, 2024
36c027e
Use official C++ 20 coroutine feature test macro
jb-gcx Jul 8, 2024
ea62a3b
all swift tests passing
li-feng-sc Jul 11, 2024
bcf8b1c
comments
li-feng-sc Jul 12, 2024
f98a415
skip label for first parameter
li-feng-sc Jul 12, 2024
6f52b82
Fix extern type usage with non-nullable ptrs
trblunt Jul 14, 2024
5858e64
delete test code
li-feng-sc Jul 15, 2024
7b6cfc3
Merge pull request #179 from trblunt/fix-extern-nn-ptrs
li-feng-sc Jul 15, 2024
cc8190a
Merge pull request #155 from jferreyra-sc/main
li-feng-sc Jul 15, 2024
f603002
Allow move-only types in Promise<>. (based on contribution from jb-gcx)
li-feng-sc Jul 15, 2024
4b57d4a
Merge pull request #176 from jb-gcx/gcx/coroutine-feature-test
li-feng-sc Jul 15, 2024
bd74aaa
Merge remote-tracking branch 'origin/main' into lf/swift-support
li-feng-sc Jul 15, 2024
fe7e06e
Make `unexpect` available for djinni expected
jb-gcx Jul 8, 2024
00878de
delete unneeded overload
li-feng-sc Jul 16, 2024
5466945
Merge pull request #180 from Snapchat/lf/move-only-promise
li-feng-sc Jul 16, 2024
fb12c73
Fix continuations in djinni::Future coroutines
jb-gcx Jul 8, 2024
ee2bcb1
Add an XCTest for coroutine cleanup order
jb-gcx Jul 16, 2024
c6c9f07
Fix feature detection for experimental coroutines
jb-gcx Jul 18, 2024
a97afc7
Merge pull request #181 from jb-gcx/gcx/fix-coroutine-continuation
li-feng-sc Jul 18, 2024
ae855ee
add SharedFuture
techleeksnap Jul 19, 2024
74c6a57
Update support-lib/cpp/SharedFuture.hpp
techleeksnap Jul 19, 2024
74cedd6
cleanup
li-feng-sc Jul 22, 2024
513a6be
add support for deriving(hashable, sendable, codable)
li-feng-sc Jul 23, 2024
ffe02b8
add error conformance
li-feng-sc Jul 23, 2024
14d5aa3
refactor
li-feng-sc Jul 23, 2024
ba173f7
Implement swift future
LoganShireSnapchat Jul 24, 2024
25898a5
Merge pull request #185 from LoganShireSnapchat/lshire-swift-future
li-feng-sc Jul 24, 2024
2f0334a
comment
li-feng-sc Jul 24, 2024
9d1a289
fix warning
li-feng-sc Jul 24, 2024
edada37
address comments
techleeksnap Jul 24, 2024
c7cbf0a
use atomic int64 instead of uuid as subscription token
li-feng-sc Jul 24, 2024
1a4080d
fix
techleeksnap Jul 24, 2024
bf60220
address comments
techleeksnap Jul 24, 2024
987cd72
address comments
techleeksnap Jul 24, 2024
823a8eb
add header
li-feng-sc Jul 26, 2024
7494022
Merge branch 'main' into lf/swift-support
li-feng-sc Jul 26, 2024
954a8a9
move-only optionals
li-feng-sc Jul 26, 2024
d29731e
touch
li-feng-sc Jul 26, 2024
8e404d8
test
li-feng-sc Jul 26, 2024
e1a08ff
uncomment
li-feng-sc Jul 26, 2024
0c74a2a
touch
li-feng-sc Jul 26, 2024
c0b131e
try again
li-feng-sc Jul 26, 2024
d3ab313
try again
li-feng-sc Jul 26, 2024
c08793d
comment
li-feng-sc Jul 26, 2024
683c39f
touch
li-feng-sc Jul 26, 2024
ce6add1
Update support-lib/cpp/Future.hpp
techleeksnap Jul 26, 2024
c271198
add prefix dirs
li-feng-sc Jul 31, 2024
b604359
Merge pull request #183 from techleeksnap/sharedfuture
li-feng-sc Aug 1, 2024
6c30c31
Merge remote-tracking branch 'origin/main' into lf/swift-support
li-feng-sc Aug 1, 2024
17458b9
Small error in README.md
ysammy Aug 1, 2024
252271d
fixes as per review comments
li-feng-sc Aug 7, 2024
dc8b666
Finish futures when their promise is broken
jb-gcx Aug 12, 2024
a237529
downgrade swift protobuf to 1.26
li-feng-sc Aug 13, 2024
2383dc1
Merge pull request #186 from ysammy/patch-1
li-feng-sc Aug 14, 2024
971228b
Merge pull request #187 from jb-gcx/gcx/broken-promises
li-feng-sc Aug 14, 2024
9c687a2
Merge branch 'main' into lf/swift-support
li-feng-sc Aug 15, 2024
eedf683
fixes
li-feng-sc Aug 15, 2024
6e986dd
fixes for snap client integration
li-feng-sc Aug 29, 2024
539df09
fixes
li-feng-sc Aug 29, 2024
be7eff9
revert the nonnull future get change because it prevents future<optio…
li-feng-sc Aug 30, 2024
dd172fe
Remove -fcoroutines-ts
ivan-golub Sep 26, 2024
3d3c46b
Remove -fcoroutines-ts from host_cxxopt too
ivan-golub Sep 26, 2024
3fe25d8
Merge pull request #189 from ivan-golub/patch-1
li-feng-sc Sep 26, 2024
82ba611
avoid swift keywords
li-feng-sc Oct 9, 2024
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
Prev Previous commit
Next Next commit
+nc
  • Loading branch information
li-feng-sc committed Jun 4, 2024
commit cf0fb530e09307fac6f4a6edf6bf5bd7800d978f
2 changes: 1 addition & 1 deletion examples/example.djinni
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ sort_items = interface +c {
static run_sort(items: item_list): item_list;
}

textbox_listener = interface +j +o +w {
textbox_listener = interface +nc {
update(items: item_list);
}
9 changes: 8 additions & 1 deletion examples/generated-src/swift/TextboxListener+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ import DjinniSupportCxx
import TextSort
import TextSortCxx

let textboxListenerMethods: Vtbl<TextboxListener> = [
{ inst, params, ret in
let _items = ItemListMarshaller.fromCpp(djinni.swift.getMember(params, 0))
inst.update(items: _items)
},
]

enum TextboxListenerMarshaller: DjinniSupport.Marshaller {
typealias SwiftType = TextboxListener
static func fromCpp(_ c: djinni.swift.AnyValue) -> SwiftType {
return cppInterfaceToSwift(c, { fatalError("n/a") })
}
static func toCpp(_ s: SwiftType) -> djinni.swift.AnyValue {
return swiftInterfaceToCpp(s, { fatalError("n/a") })
return swiftInterfaceToCpp(s, { djinni_generated.TextboxListenerSwiftProxy.make(ctxPtr(s, textboxListenerMethods), dispatcherProtocalCall)})
}
}
8 changes: 8 additions & 0 deletions examples/generated-src/swiftxx/SwiftTextboxListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@

namespace djinni_generated {

djinni::swift::AnyValue TextboxListenerSwiftProxy::make(void* instance, djinni::swift::DispatchFunc dispatcher) {
return {std::make_shared<TextboxListenerSwiftProxy>(instance, dispatcher)};
}
void TextboxListenerSwiftProxy::update(const ::textsort::ItemList & items) {
djinni::swift::ParameterList params;
params.addValue(::djinni_generated::SwiftItemList::fromCpp(items));
callProtocol(0, &params);
}

} // namespace djinni_generated
7 changes: 7 additions & 0 deletions examples/generated-src/swiftxx/SwiftTextboxListener.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@ namespace djinni_generated {

using SwiftTextboxListener = djinni::swift::Interface<::textsort::TextboxListener>;

class TextboxListenerSwiftProxy: public ::textsort::TextboxListener, public djinni::swift::ProtocolWrapper {
public:
TextboxListenerSwiftProxy(void* instance, djinni::swift::DispatchFunc dispatcher): ProtocolWrapper(instance, dispatcher) {}
static djinni::swift::AnyValue make(void* instance, djinni::swift::DispatchFunc dispatcher);
void update(const ::textsort::ItemList & items) override;
};

} // namespace djinni_generated