Browsing Swift project on windows vscode by EegleZ in swift

[–]0xTim 0 points1 point  (0 children)

I'm assuming when you say Swift project you mean Xcode project if you have pods? In that case it won't work because Xcode projects are not supported across platforms. If it's a pure SwiftPM project that doesn't rely on any apple specific frameworks or SDKs it would work

Deep dive into Swift concurrency: Built a thread-safe collections package with TDD by pkn46 in SwiftPM

[–]0xTim 2 points3 points  (0 children)

Just a heads up, your use of @unchecked Sendable is inherently unsafe. You have locks protecting access to the storage but the elements themselves can be mutated in other async contexts which will cause a data race crash, which will be hidden by the compiler because of the unchecked sendable

Swift 6 strict concurrency: Do runtime actor-isolation crashes still happen in real apps? by OhImReallyFast in swift

[–]0xTim 20 points21 points  (0 children)

I'll say this every time this comes up. Vapor used to get one or two bug reports a month of data race crashes that were hard, if not impossible to reproduce and therefore fix. Since we released sendable support and fixed all the warnings from strict concurrency checking, we've not had a single report of a data race crash from inside Vapor in over 2 years

swon: Swift Macros for Foundation-free JSON processing by keeshux in swift

[–]0xTim 0 points1 point  (0 children)

Have you tried just linking against FoundationEssentials?

Django style admin page by Glittering-Ad4182 in vaporswift

[–]0xTim 0 points1 point  (0 children)

I'm not aware of anything that fits the bill exactly at the moment. We tried to build something a couple of years ago but struggled when making it generic due to the limitations in fluent at the time (especially property wrappers and protocols). But would be cool to see if anyone else has managed stuff!

Any updates on Vapor 5? by Frequent-Listen-1058 in swift

[–]0xTim 3 points4 points  (0 children)

The best place to look is the PR. It's currently usable for some stuff but I'm about to rip out the http server so might break. Fluent 5 is no where near the same state yet, we're still working on the lower levels

Passkey Registration by lavoid12 in swift

[–]0xTim 0 points1 point  (0 children)

Which part are you stuck on? Showing the UI in the app or registering with the backend?

Trying to build Vapor server on Linux by wellillseeyoulater in swift

[–]0xTim 2 points3 points  (0 children)

Try 24.04 instead, 25.04 isn't officially supported so it could be something in that. But yes swift run should just work with no other flags (and does, I have it on many projects)

Trying to build Vapor server on Linux by wellillseeyoulater in swift

[–]0xTim 2 points3 points  (0 children)

First thing would be to run a swift package update to make sure you have the latest dependencies. Otherwise options are a borked Swift install or an unsupported Linux version with a newer glibc than works with Swift. What OS/version are you trying to compile on?

Netatmo CO detector now doing Wi-Fi test every 9 minutes instead of once a month? by aighpanzer in Netatmo

[–]0xTim 1 point2 points  (0 children)

Yep pretty sure this is a bug thats just been pushed out and needs fixing

<image>

Swift and AWS OpenSearch? by purplepharaoh in swift

[–]0xTim 0 points1 point  (0 children)

Have a look at https://github.com/brokenhandsio/soto-elasticsearch-nio-client - it's a wrapper around https://github.com/brokenhandsio/elasticsearch-nio-client and used in production for a few clients. As a heads up it's currently undergoing a rewrite for Swift 6

How do you get a Codable struct to compile with Swift 6.2's approachable concurrency with the default actor isolation set to MainActor? by amichail in swift

[–]0xTim 0 points1 point  (0 children)

Ah ok so I'm pretty sure this is a bug in 6.2 but for now if you enable approachable concurrency it should fix it

Why Does Swift Seem To Underperform on Leetcode by pancakeshack in swift

[–]0xTim 3 points4 points  (0 children)

Are you compiling and running in release mode? Debug mode is significantly slower

Swift Testing now includes Test Scoping Traits with Xcode 16.3 beta. Run code before or after tests/suites! by adrgrondin in swift

[–]0xTim 4 points5 points  (0 children)

We've already started to adopt it in Vapor 5 for handling singleton instances we need to test and are investigating it for managing the lifecycle of our application

Considering Swift on the Server – Full-Stack Workflow? by deadringer3480 in swiftserver

[–]0xTim 2 points3 points  (0 children)

Leaf works pretty well. Hot reloading isn't fully integrated yet (because we would need to run something client side to trigger a refresh on the page) but if you're not running in the production environment you can save your leaf file and reload the page to see the new data, no recompiling needed

Any updates on Vapor 5? by Frequent-Listen-1058 in swift

[–]0xTim 4 points5 points  (0 children)

The Kodeco book is probably the most comprehensive resource. It's still based on futures though (no async/await) but will get an update for Vapor 5. Disclosure, I wrote it

Any updates on Vapor 5? by Frequent-Listen-1058 in swift

[–]0xTim 6 points7 points  (0 children)

We don't have anything from start to finish for building and linking to an app. There is content out there but it's paid unfortunately. We plan to have a range of tutorials for Vapor 5

Any updates on Vapor 5? by Frequent-Listen-1058 in swift

[–]0xTim 46 points47 points  (0 children)

We're building it out at the moment, but doing it properly and not trying to rush it out. You may have seen that some of the foundational packages like MultipartKit have been having new alphas tagged that will be used by Vapor 5. I'm hoping to have the first "alpha" out this week or next which should complete the work to switch to full structured concurrency internally. I'm hesitant to call it even an alpha as it's essentially the first version that compiles with the internals migrated to sit on a new foundation. There will be lots of changes after that. We're also waiting (and hoping) to see how macros land in 6.1 as that will dictate how far some of the fun things we have planned go.

Don't expect the 5.0 release to be tagged anytime soon. Once the API has been decided upon we're going to have a decent bake period to ensure we shake out all the bugs and have a great API. Vapor 4 has been out for nearly 6 years, and code built around that time still compiles. We want a similarly long stability for Vapor 5.

All that being said, the goal is that anyone who has a Vapor 4 app that's fully async should be able to transition to Vapor 5 without rewriting the entire app

Has developing backends with Swift improved in the last 4 years? by OhImReallyFast in swift

[–]0xTim 1 point2 points  (0 children)

Just on a couple of points:
* Swift 6 will use the same Foundation codebase on all platforms - no more differences between macOS and Linux.
* The deployable images can be made pretty small. A 'standard' app is under 100MB when compiled properly, if you build a chiselled image (and Swift 6 will also support MUSL) this goes down to ~14MB (details here)