Comments (7)
Maybe some people use it.
One way to do it is two add a compilation flag, and do two implementation one with public variables, the other only internals
from brightfutures.
Rather than complicate the library, I'd recommend removing them with a non-backwards compatible version change and a short code snippet in the release notes. They're very simple extensions.
from brightfutures.
With that logic, we coud provide a minimal framework and ask everyone to copy the same piece of code in all their projects, so where is the limit?
I found that using it, is convenient with asyncAfter
... (like it is done in unit test, so not part of the framework)
Example of discussion about add or not isEven
, isOdd
in Swift. foundation.
https://github.com/apple/swift-evolution/blob/master/proposals/0225-binaryinteger-iseven-isodd-ismultiple.md - https://forums.swift.org/t/se-0225-adding-iseven-isodd-ismultiple-to-binaryinteger/15382/3
(ps: non-backwards compatible version must not occurs in a 7.0.1, but a 7.1.0 now)
from brightfutures.
I would say the limit is: what is the purpose of the library? A utility library will have all manner of useful extensions. I would expect a futures library to provide futures, promises, etc. The Swift framework is going to be a special case because all developers use it.
Another option would be a CocoaPod subspec for useful extensions.
According to semantic versioning, a non-backwards compatible version would be 8.0.0 (increment major version)
from brightfutures.
But 7.0.0 is out and it will take time to have a new release. So there is also a practical way, a swift way with breaking change every times, even in swift ;(
By the way if you use cocoapod and that could help you, feel free to PR.
Default target must keep all the code for everyone, but we could have a Core subspec without some extensions.
from brightfutures.
Thanks for the discussion, @hiltonc and @phimage . I think there's a good argument for removing the second/millisecond helpers. It's not part of the core functionality of the framework.
I remember adding those helpers because I didn't like the way DispatchTime
has to be created. Looking at it again, I think it's actually fine. This:
XCTAssert(f.forced(500.milliseconds.fromNow) != nil)
would become:
XCTAssert(f.forced(.now() + .milliseconds(500)) == nil)
I'd be open to fixing this and releasing it soon. The version number would be 8.0.0 indeed. I'm not sure if I have time for it, so a PR is very welcome, @hiltonc. If it is still relevant to you after all this time.
from brightfutures.
Thank you!
from brightfutures.
Related Issues (20)
- Swift4: build failure HOT 1
- Failed when compiling Bitcode HOT 1
- Promise chaining in BrightFutures using flatMap HOT 3
- Compile error on Xcode 9.3 beta 3 HOT 2
- Swift 4.1 support release HOT 2
- Swift 4.1 Crashes HOT 3
- Generic parameter 'T' could not be inferred HOT 1
- Compile error with XCode 9.3 / Swift 3.3 HOT 1
- Developers in danger!
- Update to Result 4.0.0 (or not) HOT 2
- Carthage issue with Result version choosing HOT 2
- Crash app when execute many times Future objects HOT 5
- Synchronous resolution of Futures HOT 2
- High crash rate after upgrade to Xcode 10 HOT 3
- Update to Result -> 4
- Support Swift 5 HOT 2
- Apparent dealloc error after Swift 5/Xcode 10.3 upgrade HOT 10
- 8.0.1 not available on Cocoapods
- No option to throw an error inside map HOT 9
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 brightfutures.