We’ve decided to start tagging early access releases in Github from now on, with the first tag
ea-1.0.1 live today. This makes it easier to depend on a known version of Flint even in this pre-1.0 final release phase. The first full release of Flint will be a
1.0.x (Pascal subscripts FTW), but who knows which patch number we’ll get to before then! When any major changes are landed on master we’ll create a new tag and update the FlintDemo-iOS project to build against that (including the nightly CI builds).
In this 1.0.1 early access release, we’ve added something simple but very useful. Throughout Flint we try to help developers by preventing “footgun” incidents and being clear about how to resolve problems that are encountered at runtime. We try to avoid as many problems as possible using strict typing at compile time, but some things can only be verified at runtime – such as which activity type IDs you have registered in your
Until now we had used Swift’s
fatalError calls to trap invalid code paths and provide a meaningful explanation so you can solve the issue. Unfortunately it turns out Swift does not include the helpful error string in release builds of the framework, except for uses of
fatalError. Carthage builds the frameworks for release, so this would mean that if you used Flint and encountered one of these runtime problems you get an ugly
EXC_BAD_ACCESS and no other information about what went wrong.
So we have introduced a new set of error functions that all use
fatalError so you will always get the helpful text we’ve added to give you a clue what to do. We also want to take full ownership of problems in Flint itself and have clarity in the code as to the nature of problems, so we have function names to reflect this:
public func flintAdvisoryNotice(_ message: String) public func flintAdvisoryPrecondition(_ expression: @autoclosure () -> Bool, _ message: String) public func flintUsagePrecondition(_ expression: @autoclosure () -> Bool, _ message: String) public func flintUsageError(_ message: String) -> Never public func flintBugPrecondition(_ expression: @autoclosure () -> Bool, _ message: String) public func flintBug(_ message: String) -> Never public func flintNotImplemented(_ message: String) -> Never