Comments (21)
@zackshapiro I believe much of what @darknoon talks about from his comment in 2015 still applies here, unfortunately. Last I checked Swift still doesn't work with Objective-C++ and implementing a pure Objective-C wrapper API would take considerable effort.
/cc @ocrickard
from componentkit.
Hey, it's probably fair to give an explanation of why this isn't going to happen in the short term:
Without ObjC++ interoperability in Swift it will be really hard to make this work well. ObjC++ and Swift are pretty similar, but have incompatible object models. It would take a lot of work to make C++ compatibility happen in Swift: until we have an elegant interoperation mode at the compiler level, we can’t support Swift in this ObjC++ framework.
I'm interested in what features of Swift this community is excited about, and see what we can do to help bring those ideas to ComponentKit-based apps. Many of the nice things we love about Swift are already in C++. It, like Swift, is in active development—C++14 and C++17 has many new features. For example, a proposal for async/await like in c#/hack.
So, here’s what it would take to support Swift today with the existing compiler landscape: wrap all of the C++ code in pure ObjC. This undermines the elegance we have with CKComponentViewConfiguration
etc where you can declare things inline, and degrade performance by creating a bunch more ObjC objects.
I think the best way to achieve what you're looking for would be to port the ideas from ComponentKit / React over to Swift. We're happy to help with any questions you might have in doing that, but it's not on our priority list right now since there is so much to do improving ComponentKit as an ObjC++ framework. For instance, I recently worked on memoization for components and layouts (using some cool C++ features), which should make ComponentKit even more efficient and scale to really hard UI problems.
I think the closest thing to what you guys are looking for is Few.swift. My understanding is that it's still pretty early on and not ready for production, but you should contribute!
One final thing I'll mention is AsyncDisplayKit, which is compatible with Swift: https://github.com/facebook/asyncdisplaykit. There are some features like stack layouts similar to ComponentKit there, though it's closer to UIKit than React. It trades off the easy updates inherent in the React model for easier UIView manipulation and gestures.
Hope that helps, and sorry to be bringer of bad news… :/
from componentkit.
Hey guys, I write a wrapper of componentKit for swift, ComponentSwift. Please have a try if interested.
from componentkit.
+1 for Swift support. I think they even mentioned something about porting it to Swift in the @scale talk. I'm not sure.
from componentkit.
sure, they mentioned it. That's why I wrote this issue for :). Peek to the last minute of the video of the talk and you hear the swift mention.
from componentkit.
Adam mentioned swift is on hold for a bit on twitter: https://twitter.com/adamjernst/status/580955735456010242
I think C++ have some important similarities as far as API design goes, so even though a swift/objC wrapper is probably not viable the final API should be very familiar.
from componentkit.
I'm super interested in exploring using ComponentKit from Swift! It should be possible by building an intermediate bridging layer in Objective-C. I'd love to see some proof-of-concepts--maybe submit a pull request?
from componentkit.
I think @arigrant looked into what a Swift API might look like, could be a good starting place before writing an implementation/bridge.
from componentkit.
I should also mention Few.swift as a project that's already exploring a reactive model in Swift. It's not asynchronous and is still experimental, but I think it's promising.
from componentkit.
Any update on this? To be able to use ComponentKit with Swift would be HUGE.
from componentkit.
+1 for Swift support.
from componentkit.
+1
from componentkit.
👍
from componentkit.
+1
from componentkit.
+1
from componentkit.
+1
from componentkit.
+1
from componentkit.
+1
from componentkit.
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
from componentkit.
+1
from componentkit.
Any updates on Swift support for ComponentKit?
from componentkit.
Related Issues (20)
- Component not release
- [Documentation] Views path is not render HOT 3
- Delete 'Carthage/Checkouts' directory
- question - docs (docusaurus) repo? HOT 2
- Xcode not building ComponentKit checked out via cocoapods HOT 2
- Docusaurus source code
- question: My component is not getting full width in screen landscape mode. HOT 1
- Not Support Incremental mount
- Build Error with "RenderCoreLayoutCaching" HOT 1
- ComponentKit does not compile with Xcode 12.5 HOT 1
- Compile Error: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior HOT 1
- How do I pass multiple arguments
- Unsupported Swift Version: “FBSnapshotTestCase iOS” contains source code developed with Swift 3.x.
- [Question]How to unmount components from HostingView?
- How to make children component height equal to Scroll component's content view height but Scroll component's height HOT 2
- Yoga-internal.h:135:11: error: definition of implicit copy constructor for 'Values<9>' is deprecated
- CKNonNull.h:47:33 No member named 'move' in namespace 'std'; did you mean 'modf'?
- Abandoned?
- ComponentKit/ComponentKit.xcconfig is compiled as source code
- Unable to compile example project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from componentkit.