1
00:00:00,000 --> 00:00:07,320
Well, maybe I can fill in, though we maybe need to agree on a safe word where you reel me in.

2
00:00:07,320 --> 00:00:15,560
I've debated whether I should bring it up because the news topic is, I mean, effectively, I'm talking about one of my packages,

3
00:00:15,560 --> 00:00:19,560
which I've been using for quite a number of projects now.

4
00:00:19,560 --> 00:00:28,240
And that's why I feel like it's really useful and maybe worth talking about and mentioning it so people can check it out if they need it for their work.

5
00:00:28,240 --> 00:00:35,480
And the background of that is the documentation pages are becoming more popular and more relied upon.

6
00:00:35,480 --> 00:00:41,160
So we do have a need of having a more fine grained availability testing in place.

7
00:00:41,160 --> 00:00:47,640
Now, we do have probes in place to alert us if the homepage is unavailable.

8
00:00:47,640 --> 00:00:53,400
Surge, I think we have a couple of we have like a little smoke test script, which is actually also powered by that same tool.

9
00:00:53,400 --> 00:00:59,960
And we also have Azure's availability probes in place and something else called status cake.

10
00:00:59,960 --> 00:01:00,960
Status cake, yeah.

11
00:01:00,960 --> 00:01:06,160
What's the history of that name of that web page status cake? That doesn't seem like a...

12
00:01:06,160 --> 00:01:09,560
I have no idea.

13
00:01:09,560 --> 00:01:14,560
I've been using them for years, but I have no idea where their name came from. But it is odd. It is odd.

14
00:01:14,560 --> 00:01:20,440
Every time I get an email, you know, typically when I do maintenance on staging where we don't have redundancy,

15
00:01:20,440 --> 00:01:23,480
you know, we get the status cake email and staging is done.

16
00:01:23,480 --> 00:01:30,200
I think, what on earth were they thinking naming that status cake? But yeah, it does its job.

17
00:01:30,200 --> 00:01:33,720
While we're talking about the smoke test, there was as well, you may remember,

18
00:01:33,720 --> 00:01:38,560
there was a time when our smoke test tested every single package page. Do you remember that?

19
00:01:38,560 --> 00:01:49,400
Yes. Yeah, that was... I made it so easy to actually test all the pages that I didn't stop to think whether I should.

20
00:01:49,400 --> 00:01:53,160
So the main purpose of this is we need more fine grained availability testing.

21
00:01:53,160 --> 00:02:02,680
So we need to test more pages because there are a number of doc pages that we can already see by the traffic that they are visited a lot.

22
00:02:02,680 --> 00:02:04,880
So we should ensure that they're there.

23
00:02:04,880 --> 00:02:11,320
And there's typically no risk that they should disappear once they're there, except for a couple of edge cases.

24
00:02:11,320 --> 00:02:17,240
And that is if a new version were to be published, and that version had build errors for some reason,

25
00:02:17,240 --> 00:02:21,880
you know, might either be the package having issues, which is unlikely for those packages.

26
00:02:21,880 --> 00:02:25,880
But it also might be a problem with our build system or something else going wrong.

27
00:02:25,880 --> 00:02:30,480
Or the latest Swift version may be having a problem and not preventing the docs from being published.

28
00:02:30,480 --> 00:02:37,560
So in that case, the latest version might not be available, but the main branch would still be there to pick up the issue.

29
00:02:37,560 --> 00:02:45,240
However, if there's an actual problem with a package, it's quite likely that also the main pages might have a problem.

30
00:02:45,240 --> 00:02:52,760
So in any case, we do actually want to know for a detailed list of packages, the popular ones, that the documentations are up.

31
00:02:52,760 --> 00:03:02,600
And as far as I know, there aren't a whole lot of things that allow you to create these sort of testers easily.

32
00:03:02,600 --> 00:03:09,040
On macOS, I've used Paw to do API exploration and a little bit of testing as well,

33
00:03:09,040 --> 00:03:15,680
which is a great tool for those who don't know, where you can put in a URL and add query parameters and all that,

34
00:03:15,680 --> 00:03:19,480
do post requests and all that sort of stuff and then run that repeatedly.

35
00:03:19,480 --> 00:03:24,000
But that's obviously not something that's easy to deploy into a CI environment,

36
00:03:24,000 --> 00:03:30,880
because what we want to do is have a script that a crawler uses to hit pages and then also verify the return codes.

37
00:03:30,880 --> 00:03:37,240
And the tool we're using is actually a package of mine that I wrote four years ago now for exactly that purpose,

38
00:03:37,240 --> 00:03:44,480
to do testing of pages and like detailed testing, not just for the return code, but also return results.

39
00:03:44,480 --> 00:03:53,080
So if it's a JSON API, you can drill into the payload that you're getting back and you can even use that payload to drive further requests.

40
00:03:53,080 --> 00:03:59,800
So the initial purpose was to both do the testing where you do sign up testing, for instance,

41
00:03:59,800 --> 00:04:04,000
you create a user account and then you get the token back, you sign in.

42
00:04:04,000 --> 00:04:08,960
That's obviously quite complicated to do with curl, because you'd have to get the result back,

43
00:04:08,960 --> 00:04:13,920
then use something to pass the JSON, get the data out, stick it in the next request.

44
00:04:13,920 --> 00:04:15,760
And you can imagine doing that in a shell script.

45
00:04:15,760 --> 00:04:16,880
Of course, yeah.

46
00:04:16,880 --> 00:04:18,880
Can be super fiddly.

47
00:04:18,880 --> 00:04:24,080
So what I at the time used initially was a JavaScript tool called strest.

48
00:04:24,080 --> 00:04:27,200
And that worked okay, but then it was missing a few things.

49
00:04:27,200 --> 00:04:32,160
And rather than try and extend something, you know, in a language that I'm not very familiar with,

50
00:04:32,160 --> 00:04:35,200
what do you do? You rewrite it.

51
00:04:35,200 --> 00:04:37,120
And that's what I did at the time.

52
00:04:37,120 --> 00:04:42,160
And this is the tool Resta, which we're using now to do our general smoke testing.

53
00:04:42,160 --> 00:04:49,120
So we're just a couple of pages, but also in this case, this fine grained documentation page testing.

54
00:04:49,120 --> 00:04:54,120
And the nice thing is, this is driven by a YAML file that effectively is the script.

55
00:04:54,120 --> 00:05:00,320
And that YAML file is very easy to just auto generate from a list of URLs that we just query from the database.

56
00:05:00,320 --> 00:05:06,720
So we have a little extension on our server package that actually writes out a list of URLs that we want to probe.

57
00:05:06,720 --> 00:05:10,080
And that YAML file, we just ship with a repository.

58
00:05:10,080 --> 00:05:19,040
And there's a scheduled job that runs the Resta tool, which then queries all the URLs and checks that return codes are as expected.

59
00:05:19,040 --> 00:05:25,440
And the whole thing will fail with an error if any of the URLs aren't available or something like that.

60
00:05:25,440 --> 00:05:27,920
And we've been using that for quite a while now.

61
00:05:27,920 --> 00:05:37,440
So right from the beginning of our smoke test, we've been using that Resta package to not only detect these latest documentation pages, but also every page that we test.

62
00:05:37,440 --> 00:05:38,560
Yeah, it's not new.

63
00:05:38,560 --> 00:05:50,080
So we actually have a stage that runs after a deployment that probes the whole page, a search page and another page just to make sure the deployment is up and nothing's broken.

64
00:05:50,080 --> 00:05:51,760
No, it's a great little tool.

65
00:05:51,760 --> 00:05:53,040
I'm glad we have it.

66
00:05:53,040 --> 00:05:54,400
Right.

67
00:05:54,400 --> 00:05:56,480
I think that's it with the news, isn't it?

68
00:05:56,480 --> 00:05:59,920
Yeah, I think it's a fairly slim week on news.

69
00:05:59,920 --> 00:06:02,880
I guess that's the way it happens sometimes, isn't it?

70
00:06:02,880 --> 00:06:03,920
That's the way it is.

71
00:06:03,920 --> 00:06:04,640
Yeah.

72
00:06:04,640 --> 00:06:09,440
I feel like I'm in a meeting in my bus where I have to describe what I've done over the last three weeks.

73
00:06:09,440 --> 00:06:13,200
Yeah, it's an awkward stand up where you think, oh, god damn it, what did I do?

74
00:06:13,200 --> 00:06:16,800
I was so busy, but nothing's actually finished.

75
00:06:16,800 --> 00:06:19,520
I know I've done stuff.

76
00:06:19,520 --> 00:06:25,040
There's one other thing I worked on that I'll probably talk about some other time because it's not quite done.

77
00:06:25,040 --> 00:06:26,880
I want to tie it all together.

78
00:06:26,880 --> 00:06:31,600
We also might have a bit more news in other areas to talk about next time.

79
00:06:31,600 --> 00:06:35,760
But in the meantime, maybe we can do something that we haven't done for a while.

80
00:06:35,760 --> 00:06:38,160
And I hope you forgot that we talked about that last time.

81
00:06:38,160 --> 00:06:38,960
And that is a...

82
00:06:38,960 --> 00:06:40,000
Is it a quiz time?

83
00:06:40,000 --> 00:06:40,640
Okay.

84
00:06:40,640 --> 00:06:41,600
It is quiz time.

85
00:06:41,600 --> 00:06:42,080
Yes.

86
00:06:42,080 --> 00:06:47,040
Remember what the open question was that we left dangling last time?

87
00:06:47,040 --> 00:06:49,440
I remember that there was an open question.

88
00:06:49,440 --> 00:06:50,800
I don't know what the question was.

89
00:06:50,800 --> 00:06:52,560
So that's a good thing, I think.

90
00:06:52,560 --> 00:06:53,040
That's great.

91
00:06:53,040 --> 00:06:53,920
That's a great excuse.

92
00:06:53,920 --> 00:06:58,240
So I can be fairly sure that you didn't look up the details.

93
00:06:58,240 --> 00:07:01,200
My terrible memory is a feature, not a bug.

94
00:07:01,200 --> 00:07:01,520
Yes.

95
00:07:01,520 --> 00:07:07,200
So the question was, are there any other Linux-only packages that we had?

96
00:07:07,200 --> 00:07:11,680
The topic last time we talked about documentation generation on Linux.

97
00:07:11,680 --> 00:07:19,680
And that was triggered by two packages, auto-1 package benchmark and package Frostflake.

98
00:07:19,680 --> 00:07:21,280
So these were the two example packages.

99
00:07:21,280 --> 00:07:25,360
And the question was, are there actually a lot of Linux-only packages?

100
00:07:25,360 --> 00:07:26,160
And I had a look.

101
00:07:26,160 --> 00:07:27,040
So what's your guess?

102
00:07:27,040 --> 00:07:32,080
How many overall packages are only testing as available on Linux?

103
00:07:32,080 --> 00:07:36,160
Obviously, when we test something to be only available on Linux,

104
00:07:36,160 --> 00:07:38,880
doesn't necessarily mean it is.

105
00:07:38,880 --> 00:07:41,200
So that's just the result of our tests.

106
00:07:41,200 --> 00:07:41,840
Of course.

107
00:07:41,840 --> 00:07:42,000
Yeah.

108
00:07:42,000 --> 00:07:42,960
Yeah.

109
00:07:42,960 --> 00:07:45,360
I think it's fairly low.

110
00:07:45,360 --> 00:07:47,520
I would say we're what?

111
00:07:47,520 --> 00:07:50,320
5,500-ish total.

112
00:07:50,320 --> 00:07:52,560
I would say 10.

113
00:07:52,560 --> 00:07:53,040
Oh, wow.

114
00:07:53,040 --> 00:07:54,960
It's nine.

115
00:07:54,960 --> 00:07:55,600
That was a...

116
00:07:55,600 --> 00:07:58,320
You get three points for that one.

117
00:07:58,320 --> 00:08:02,400
And I'll thank my SQL queries.

118
00:08:02,400 --> 00:08:03,040
No, I'm kidding.

119
00:08:03,040 --> 00:08:03,520
I didn't do it.

120
00:08:03,520 --> 00:08:07,760
Actually, I sat down.

121
00:08:07,760 --> 00:08:12,240
I thought, oh, God, this is going to be one of these ugly SQL queries I need to write.

122
00:08:12,240 --> 00:08:17,120
And then I realized it's actually a single field in a single table that tells us this information.

123
00:08:17,120 --> 00:08:18,800
Right.

124
00:08:18,800 --> 00:08:22,160
The thing is, I had to do a bit of digging because as I suspect,

125
00:08:22,160 --> 00:08:28,240
there's a number of accidental Linux-only ones, and that's four of them are really Linux-only,

126
00:08:28,240 --> 00:08:32,000
but the build happens to fail on the other platforms, which is kind of funny.

127
00:08:32,000 --> 00:08:37,360
But sometimes the Linux builds actually succeed because the way they fail is

128
00:08:37,360 --> 00:08:41,280
they do certain availability tests for Apple platforms,

129
00:08:41,280 --> 00:08:44,160
and Linux just falls off and doesn't actually build anything.

130
00:08:44,160 --> 00:08:46,480
So it succeeds by doing nothing and the others fail.

131
00:08:46,480 --> 00:08:46,880
Right.

132
00:08:46,880 --> 00:08:48,240
For some obscure reasons.

133
00:08:48,240 --> 00:08:49,440
Yeah, yeah, yeah.

134
00:08:49,440 --> 00:08:50,480
So that's four of them.

135
00:08:50,480 --> 00:08:56,720
And I think there are like three Linux-first packages that are clearly targeting Linux and

136
00:08:56,720 --> 00:09:00,560
don't happen to build on macOS, but probably would with a little bit of tweaking.

137
00:09:00,560 --> 00:09:06,480
And on that subject, I think it's as the popularity of the site grows,

138
00:09:06,480 --> 00:09:11,600
we see package authors pay attention to their compatibility results.

139
00:09:11,600 --> 00:09:16,160
And sometimes they'll pop in and raise an issue or pop into Discord or something

140
00:09:16,640 --> 00:09:20,880
and just raise like, oh, I was expecting it to compile here and it didn't.

141
00:09:20,880 --> 00:09:27,760
Now, I think we do a really good job of getting compatibility approximately right,

142
00:09:27,760 --> 00:09:31,280
but we can't get it 100% right for that number of packages.

143
00:09:31,280 --> 00:09:35,600
And so there are always going to be cases where package authors need to

144
00:09:35,600 --> 00:09:40,720
just kind of come in and take a quick look and see if their package results

145
00:09:40,720 --> 00:09:46,240
or their compatibility results expectation matches what we actually report.

146
00:09:46,560 --> 00:09:51,120
And I think as we become more popular and our usage grows,

147
00:09:51,120 --> 00:09:54,800
I think that will become less of a problem because people will be paying a little bit of attention.

148
00:09:54,800 --> 00:09:57,920
Because generally, once it's fixed up and once it's kind of working,

149
00:09:57,920 --> 00:09:58,800
it works forever.

150
00:09:58,800 --> 00:10:00,000
Like it's not something that...

151
00:10:00,000 --> 00:10:00,560
Yeah.

152
00:10:00,560 --> 00:10:02,960
You don't need some monitor your package compatibility results,

153
00:10:02,960 --> 00:10:05,600
but sometimes you do need to just kind of take a check.

154
00:10:05,600 --> 00:10:07,200
Is it doing what I expect it to do?

155
00:10:07,200 --> 00:10:10,960
Yeah, and an easy way to actually do check that and have an eye on it is if you stick the badge

156
00:10:10,960 --> 00:10:14,720
in your readme, because then even if you just look at the GitHub page,

157
00:10:15,520 --> 00:10:20,080
you have another chance of seeing whether it actually matches your expectations.

158
00:10:20,080 --> 00:10:27,520
In case anyone isn't familiar with that badge, you can put a shields.io badge on your readme file

159
00:10:27,520 --> 00:10:31,600
that reports the platform and the Swift compatibility status of your package.

160
00:10:31,600 --> 00:10:33,600
And to get that badge, if you...

161
00:10:33,600 --> 00:10:37,120
So as you add the package, it tells you how to get the badge at that point.

162
00:10:37,120 --> 00:10:39,840
And it is also on the package page, but it's kind of...

163
00:10:39,840 --> 00:10:42,720
The link is less obvious these days on the package page.

164
00:10:42,720 --> 00:10:46,080
So on the right hand side of your package page, towards the bottom of that column,

165
00:10:46,080 --> 00:10:49,760
you'll see a little bit of text that says something like

166
00:10:49,760 --> 00:10:52,160
information for package authors or something like that.

167
00:10:52,160 --> 00:10:55,760
And if you click on there, then you'll get some markdown from there where you can

168
00:10:55,760 --> 00:10:59,840
paste them to your readme to put those badges on your package page.

169
00:10:59,840 --> 00:11:02,480
And I'm always happy to see how many of those...

170
00:11:02,480 --> 00:11:04,400
I know you keep a track of how many you spend.

171
00:11:04,400 --> 00:11:05,680
Do you have a current count?

172
00:11:05,680 --> 00:11:08,880
I... Last I checked, it was 400.

173
00:11:08,880 --> 00:11:09,440
400.

174
00:11:09,440 --> 00:11:10,400
400 and a couple.

175
00:11:10,400 --> 00:11:16,160
That is pretty good, given 5,500 packages-ish.

176
00:11:16,160 --> 00:11:18,400
400, I'm very happy with that number.

177
00:11:18,400 --> 00:11:19,840
Yeah. Yeah, it's really great.

178
00:11:19,840 --> 00:11:22,160
That's it for the quiz.

179
00:11:22,160 --> 00:11:25,040
So 9 overall, that was two real Linux-only packages,

180
00:11:25,040 --> 00:11:29,760
which was clear because they tried to import glibc.

181
00:11:29,760 --> 00:11:30,320
Right.

182
00:11:30,320 --> 00:11:34,560
I guess those could also be made to work on macOS and three Linux-first packages.

183
00:11:34,560 --> 00:11:41,840
But yeah, it's a low number, but Linux at this time is not the most common platform

184
00:11:41,840 --> 00:11:45,440
for Swift yet, although it's probably widely used in the server space.

185
00:11:45,440 --> 00:11:49,440
Let's revisit this in a year and see how many Windows-only packages there are.

186
00:11:49,440 --> 00:11:50,560
All right.

187
00:11:50,560 --> 00:11:52,400
So if we're done with news...

188
00:11:52,400 --> 00:11:54,000
Let's do some package recommendations.

189
00:11:54,000 --> 00:11:57,840
I wonder if we get clashes again, because I think there's one that we probably both have

190
00:11:57,840 --> 00:11:59,200
picked, but let's see how it goes.

191
00:11:59,200 --> 00:12:03,600
Well, I'm going to start off with one that I've picked this week,

192
00:12:03,600 --> 00:12:05,600
because it changed its name.

193
00:12:05,600 --> 00:12:11,840
So we have a script that runs every night that looks for deleted packages.

194
00:12:11,840 --> 00:12:14,240
If it starts getting a 404 on the repository,

195
00:12:14,240 --> 00:12:19,920
or if we get a redirect on the repository, it notes that and it removes the old one

196
00:12:19,920 --> 00:12:21,680
and it adds the new one, that kind of thing.

197
00:12:21,680 --> 00:12:26,960
So I noticed one package author who is a very prolific package author, actually.

198
00:12:26,960 --> 00:12:31,760
It's Sindre Sorhus, and he renamed one of his packages from

199
00:12:31,760 --> 00:12:39,280
Preferences to Settings to match the new Apple terminology of now everything is settings,

200
00:12:39,280 --> 00:12:44,560
settings and nothing is preferences, to match the iPhone, I believe is where that came from.

201
00:12:44,560 --> 00:12:52,000
And he has a package called Settings Now, which is a macOS UI package to build a kind of standard

202
00:12:52,000 --> 00:12:59,280
looking tab bar at the top, window that resizes to fit your settings, standard settings window

203
00:12:59,280 --> 00:13:01,040
for any macOS app.

204
00:13:01,040 --> 00:13:06,960
And that's the kind of thing that, you know, I've built several macOS apps that maybe wouldn't

205
00:13:06,960 --> 00:13:09,840
have ever needed too many settings.

206
00:13:09,840 --> 00:13:13,520
And you just end up with, you know, maybe a settings window with one or two checkboxes,

207
00:13:13,520 --> 00:13:16,320
but it never looks quite right.

208
00:13:16,320 --> 00:13:20,400
And to actually get that functionality, especially if you are switching tabs between lots of

209
00:13:20,400 --> 00:13:22,880
different settings pages, it's quite a lot of work.

210
00:13:22,880 --> 00:13:29,040
And so this package is a nice little shortcut to save you the effort of building all that

211
00:13:29,040 --> 00:13:29,680
functionality.

212
00:13:29,680 --> 00:13:35,440
So whenever you switch tabs, it resizes the window to fit your new set of UI controls.

213
00:13:35,440 --> 00:13:39,200
You can add icons and text at the top.

214
00:13:39,200 --> 00:13:43,680
You can also have it in a segmented control style.

215
00:13:43,680 --> 00:13:47,760
So if you didn't want to use icons, you could just have a segmented control at the top.

216
00:13:47,760 --> 00:13:52,400
Really nice little package just to save you a whole lot of time building a standard looking

217
00:13:52,400 --> 00:13:55,280
consistent settings window.

218
00:13:55,280 --> 00:13:57,920
It is surprisingly difficult to layout settings.

219
00:13:58,480 --> 00:14:05,520
I have only this little app and it has a preferences window, settings window, and I'm never quite

220
00:14:05,520 --> 00:14:06,160
happy.

221
00:14:06,160 --> 00:14:10,000
I'm not super happy with the way it looks, but I just don't know what to do to make it

222
00:14:10,000 --> 00:14:10,480
look nice.

223
00:14:10,480 --> 00:14:15,120
I can tell if a settings window is really nicely laid out, but for the life of me, I

224
00:14:15,120 --> 00:14:19,200
can't, I can't steal the mechanics of actually getting there.

225
00:14:19,200 --> 00:14:24,240
It's really bizarre how difficult it can be to lay out a little bit of text and controls

226
00:14:24,240 --> 00:14:25,920
to make it look grouped.

227
00:14:25,920 --> 00:14:28,160
I always open a couple of different examples.

228
00:14:28,160 --> 00:14:33,440
Obviously this system settings, which is the preferences or the old system preferences,

229
00:14:33,440 --> 00:14:38,720
but also a company that always does a great job of settings windows is Panic.

230
00:14:38,720 --> 00:14:44,160
So if you open any of Panic's apps and open up their settings window, that I have one

231
00:14:44,160 --> 00:14:45,200
I put on my screen right now.

232
00:14:45,200 --> 00:14:52,320
It just looks right in every, every single panel that just looks really the correct design.

233
00:14:52,320 --> 00:14:56,240
And it's really hard to, to put into words what makes it correct.

234
00:14:56,240 --> 00:15:01,680
And I had a great hope actually for SwiftUI to kind of fix this because that takes away

235
00:15:01,680 --> 00:15:02,800
a lot of the layout stuff.

236
00:15:02,800 --> 00:15:07,200
And you have this, you only even have this control called form that you should be able

237
00:15:07,200 --> 00:15:08,400
to just pop a form in.

238
00:15:08,400 --> 00:15:13,280
And I was hoping desperately that it would give you a perfectly laid out settings window.

239
00:15:13,280 --> 00:15:16,000
The reality of that on Mac OS is not quite there yet.

240
00:15:16,000 --> 00:15:20,080
I don't think, and I think there's something about settings windows that, that form doesn't,

241
00:15:20,080 --> 00:15:24,000
I form, I don't think was intended to be just for settings windows.

242
00:15:24,000 --> 00:15:27,280
In fact, it certainly wasn't, but I hoped that it would do that job.

243
00:15:27,280 --> 00:15:30,960
And I think there's a little way to go yet before it can, it can do that.

244
00:15:30,960 --> 00:15:34,320
And at the moment it needs, it still needs manual layout for me.

245
00:15:34,320 --> 00:15:34,560
Yeah.

246
00:15:34,560 --> 00:15:40,080
It was a bit like the hope, like SF symbols for, for, you know, symbols and icons, because

247
00:15:40,080 --> 00:15:47,200
that's, that's a great, it baseline a lot of iconography in apps to a very solid baseline.

248
00:15:47,200 --> 00:15:52,160
And you don't get that same thing for, for layout and forms and stuff like that yet.

249
00:15:52,160 --> 00:15:57,200
And one day we will get the old Java applet dream of write once run anywhere.

250
00:15:57,200 --> 00:15:59,600
But today is not that day.

251
00:15:59,600 --> 00:16:01,360
Right.

252
00:16:01,360 --> 00:16:06,160
My first pick is called Popup View by Alisa Milnikova.

253
00:16:06,160 --> 00:16:13,840
And this is a, a package that allows you to display alerts, popups or toasts in your app.

254
00:16:13,840 --> 00:16:16,480
Why are they called toasts anyway?

255
00:16:16,480 --> 00:16:17,120
Do you know?

256
00:16:17,120 --> 00:16:20,480
I don't know why they're called toast, but that is a standard term for these.

257
00:16:20,480 --> 00:16:21,760
It's really bizarre.

258
00:16:21,760 --> 00:16:27,120
I first came across that when I worked in London and, you know, bigger company and all

259
00:16:27,120 --> 00:16:31,600
those terms started flying around and I never quite never stopped to ask why it's called

260
00:16:31,600 --> 00:16:36,320
that, but you know, toast is like a little banner at the top that displays something.

261
00:16:36,320 --> 00:16:37,840
And it's a really nice package.

262
00:16:37,840 --> 00:16:41,600
You can bring it in, has lots of different styles that you can pick from.

263
00:16:41,600 --> 00:16:46,800
And obviously there's always a bit of a risk delegating such a core element to a third

264
00:16:46,800 --> 00:16:47,600
party library.

265
00:16:47,600 --> 00:16:52,320
But one of the things I thought about when I looked at this package is there's a low

266
00:16:52,320 --> 00:16:54,880
risk way of introducing something like that.

267
00:16:54,880 --> 00:16:59,840
If you maybe initially deploy it for in-house error messages, you know, like when you are

268
00:16:59,840 --> 00:17:05,280
developing an app, you might want to surface all the network errors in detail in your debug

269
00:17:05,280 --> 00:17:06,320
builds or something like that.

270
00:17:06,320 --> 00:17:11,120
That might be a good way to start using a package, but that's not to say that this package

271
00:17:11,120 --> 00:17:16,560
would actually, you know, you would have to be careful because this has been around quite

272
00:17:16,560 --> 00:17:17,120
a bit.

273
00:17:17,120 --> 00:17:21,920
It's quite, it's quite popular, 2K stars, and it looks like a really nice package to

274
00:17:21,920 --> 00:17:23,520
handle that sort of thing for you.

275
00:17:23,520 --> 00:17:27,680
So that's PopupView by Alistair Melnikova.

276
00:17:27,680 --> 00:17:35,200
I did see this package and I think if you want toasts or, you know, whatever you want

277
00:17:35,200 --> 00:17:40,000
to call them in your app, then this is a fine package to use.

278
00:17:40,000 --> 00:17:47,280
But I also, every time I see these used in a real app, I wonder whether a toast was the

279
00:17:47,280 --> 00:17:53,040
right idea because it's a very easy way to just throw UI into a place where it can just

280
00:17:53,040 --> 00:17:54,000
be ignored almost.

281
00:17:54,000 --> 00:17:58,640
You can kind of have some UI come down from the top.

282
00:17:58,640 --> 00:18:04,240
And if you look at, I mean, I always look towards Apple's apps in terms of design.

283
00:18:05,520 --> 00:18:09,360
It's very rare that they use this type of control.

284
00:18:09,360 --> 00:18:13,760
I'm not going to say they never use it because I'm sure somebody will prove me wrong, but

285
00:18:13,760 --> 00:18:15,440
it's certainly, it's certainly rare.

286
00:18:15,440 --> 00:18:20,000
And I think with a package like this, not specific to this package, but with a concept

287
00:18:20,000 --> 00:18:25,280
like this, restraint is beneficial when using this.

288
00:18:25,280 --> 00:18:29,440
You can end up with apps, and I've seen apps that have so many toasts in them that they're

289
00:18:29,440 --> 00:18:30,480
kind of annoying.

290
00:18:30,480 --> 00:18:33,280
So yeah, that would be my only comment on that.

291
00:18:33,920 --> 00:18:39,360
Yeah, I mean, there's perhaps a reason why there isn't a native UI element for that.

292
00:18:39,360 --> 00:18:39,840
Right.

293
00:18:39,840 --> 00:18:42,400
But I do think there are cases where it's useful.

294
00:18:42,400 --> 00:18:47,280
And I realized that the other day when I was using Hivery, they mastered on client because

295
00:18:47,280 --> 00:18:53,040
what they do is they toast stuff in that would normally be a notification if you're not in

296
00:18:53,040 --> 00:18:53,280
app.

297
00:18:53,280 --> 00:18:57,520
And then it's actually quite nice because you're not pulled out of your current view.

298
00:18:57,520 --> 00:18:59,680
You get a chance to see what's happening.

299
00:18:59,680 --> 00:19:05,600
That is actually populating a little notification bubble for another view that you're not currently

300
00:19:05,600 --> 00:19:06,160
looking at.

301
00:19:06,160 --> 00:19:09,200
So I think that's a great use of it.

302
00:19:09,200 --> 00:19:09,440
Yes.

303
00:19:09,440 --> 00:19:14,400
It's too heavy for notification, but it's still interesting enough to actually be displayed

304
00:19:14,400 --> 00:19:15,040
immediately.

305
00:19:15,040 --> 00:19:19,120
I think that's a great use case for those kinds of things.

306
00:19:19,120 --> 00:19:23,840
My next package is another result builder.

307
00:19:23,840 --> 00:19:28,560
I think I've had a result, some kind of result builder for the last several weeks now.

308
00:19:29,440 --> 00:19:31,600
And this week is no different.

309
00:19:31,600 --> 00:19:36,400
My result builder this week is called Menu Builder and it's by Jed Fox.

310
00:19:36,400 --> 00:19:38,880
And it is a, again, it's a Mac OS package.

311
00:19:38,880 --> 00:19:41,440
Am I secretly building a Mac app?

312
00:19:41,440 --> 00:19:47,680
The answer is no, but I do seem to have picked a couple of Mac OS packages this week.

313
00:19:47,680 --> 00:19:51,200
So this is a result builder for NSMenu.

314
00:19:51,200 --> 00:19:57,360
And NSMenu is a relatively old API these days.

315
00:19:57,360 --> 00:20:04,000
And to be able to, in an AppKit application, just have a very SwiftUI-like menu item.

316
00:20:04,000 --> 00:20:09,920
And then inside a menu item, you can have a .view, which then gives you a SwiftUI view

317
00:20:09,920 --> 00:20:13,120
inside that menu item, separator items.

318
00:20:13,120 --> 00:20:20,240
And then, yeah, it's a great way to visualize your menu inside your code in an easier way

319
00:20:20,240 --> 00:20:24,400
than it would be with NSMenu in code directly.

320
00:20:24,400 --> 00:20:24,720
Nice.

321
00:20:24,720 --> 00:20:28,080
Would that work in menu bar items?

322
00:20:28,080 --> 00:20:29,920
Does that mention that or would you not?

323
00:20:29,920 --> 00:20:35,440
It doesn't mention it, but a menu bar item is just a menu.

324
00:20:35,440 --> 00:20:42,000
So it is, you can just pop a NSMenu into your menu bar app and that will work.

325
00:20:42,000 --> 00:20:49,440
So yeah, this is, I mean, I think SwiftUI now has support for menu bar apps as of the

326
00:20:49,440 --> 00:20:50,560
latest release.

327
00:20:50,560 --> 00:20:51,280
It does.

328
00:20:51,280 --> 00:20:55,680
And I'm actually, I've written one recently, but the reason I'm asking is you can't,

329
00:20:55,680 --> 00:21:00,800
there you can't mix like text menu items and views.

330
00:21:00,800 --> 00:21:01,600
Oh, interesting.

331
00:21:01,600 --> 00:21:05,520
So I used another package we talked about in the past to work around that.

332
00:21:05,520 --> 00:21:10,800
And the way it works around it is it recreates like text menu items on its own.

333
00:21:10,800 --> 00:21:12,720
So it's not using standard controls.

334
00:21:12,720 --> 00:21:16,080
It just mimics them and has like a control center look.

335
00:21:16,640 --> 00:21:21,120
And I was wondering if this package would allow the same thing, but using actually,

336
00:21:21,120 --> 00:21:25,840
I don't know what to call them, native menu items, you know, like buttons render into

337
00:21:25,840 --> 00:21:30,080
menu items like you would expect, which is other packages working around in different

338
00:21:30,080 --> 00:21:30,400
ways.

339
00:21:30,400 --> 00:21:31,040
I'm not sure.

340
00:21:31,040 --> 00:21:33,120
I might try it out and report back.

341
00:21:33,120 --> 00:21:33,360
Great.

342
00:21:33,360 --> 00:21:34,320
Right.

343
00:21:34,320 --> 00:21:39,840
My second package is called ContributorUI by Zia Scotti.

344
00:21:39,840 --> 00:21:46,560
And that's the one I thought you might've picked because it is a great UI to show

345
00:21:47,120 --> 00:21:48,160
GitHub contributors.

346
00:21:48,160 --> 00:21:53,600
And it looks a bit like the grid of avatars that we have on the Swift package index home

347
00:21:53,600 --> 00:21:53,920
page.

348
00:21:53,920 --> 00:21:56,960
You know, this little grid where you have the round avatars.

349
00:21:56,960 --> 00:22:00,320
You're correct that I would have picked this one if I'd have seen it, but it's right

350
00:22:00,320 --> 00:22:01,120
past me.

351
00:22:01,120 --> 00:22:03,280
Well, there's something for you then.

352
00:22:03,280 --> 00:22:08,000
So this shows the little round avatars, GitHub avatars.

353
00:22:08,000 --> 00:22:11,600
And I think this pulls mainly from code contributors.

354
00:22:11,600 --> 00:22:16,080
I'm not sure if you can actually configure that to have other contributor lists like

355
00:22:16,080 --> 00:22:21,120
from sponsors, but if it doesn't, perhaps that's extensible or I mean, it is open source

356
00:22:21,120 --> 00:22:24,640
might be something that could be added on, but it looks really nice.

357
00:22:24,640 --> 00:22:27,280
It's available on all platforms.

358
00:22:27,280 --> 00:22:34,720
So iOS, macOS being all in this case, I'm not sure there's a lot of use for that on

359
00:22:34,720 --> 00:22:41,120
to VOS, but although I suppose it could be, and yeah, it's a really nice little thing

360
00:22:41,120 --> 00:22:42,000
to pop in.

361
00:22:42,000 --> 00:22:48,160
I would also compliment this package on a great opening screenshot, which is always

362
00:22:48,160 --> 00:22:48,880
very important.

363
00:22:48,880 --> 00:22:53,600
If your package has any kind of visual element to it at all, this screenshot, if you haven't

364
00:22:53,600 --> 00:22:57,760
had a look at this package, go to package index and search on contributor UI.

365
00:22:57,760 --> 00:23:01,280
And that opening screenshot is really well designed.

366
00:23:01,280 --> 00:23:06,400
It shows one, two, three, three different uses of it on different platforms in light

367
00:23:06,400 --> 00:23:13,040
and dark mode, all in the space of what would be, you know, maybe 15 to 20 lines of text.

368
00:23:13,040 --> 00:23:15,840
That is a great opening image.

369
00:23:15,840 --> 00:23:19,520
Tells me almost everything I need to know before I even started reading the readme.

370
00:23:19,520 --> 00:23:20,320
Yeah, absolutely.

371
00:23:20,320 --> 00:23:22,320
And it's, you know, color matched.

372
00:23:22,320 --> 00:23:27,440
So the title color is like a brown, light brown, nice little gradient.

373
00:23:27,440 --> 00:23:29,040
It's like very tastefully done.

374
00:23:29,040 --> 00:23:30,560
It's a great readme intro.

375
00:23:30,560 --> 00:23:31,360
Yeah, it is.

376
00:23:31,360 --> 00:23:31,600
Yeah.

377
00:23:31,600 --> 00:23:32,080
So there you go.

378
00:23:32,080 --> 00:23:35,120
That's a contributor UI by Sirius Scottie.

379
00:23:35,120 --> 00:23:37,920
I hope I've got the first name pronounced correctly.

380
00:23:37,920 --> 00:23:44,400
So my last package for this week is one that's actually been around for a very long time.

381
00:23:44,400 --> 00:23:50,160
It's been in development for seven years and it's GeoSwift by the organization GeoSwift.

382
00:23:50,160 --> 00:23:56,400
But I can see that the primary authors are Andrew Kirschberger and Andrea Cremasi.

383
00:23:57,040 --> 00:24:05,920
And GeoSwift is a package that helps you handle geometric objects in code.

384
00:24:05,920 --> 00:24:12,720
So you can define areas, you can define points, you can define all sorts of different bits of

385
00:24:12,720 --> 00:24:17,520
geometry, and then you can do interesting things with those bits of geometry.

386
00:24:17,520 --> 00:24:22,720
So the example from the readme file is if you have two geometries, one, which is an

387
00:24:22,720 --> 00:24:28,880
outline of the country of Italy, and another one is a fairly arbitrary set of polygons,

388
00:24:28,880 --> 00:24:34,400
that, you know, there's an outer polygon and then an inner polygon cut out of the middle of it.

389
00:24:34,400 --> 00:24:41,040
You can, for example, intersect those two geometries to get just a new geometry, which is

390
00:24:41,040 --> 00:24:42,640
the intersection of those two.

391
00:24:42,640 --> 00:24:46,800
You could buffer a geometry, so you could expand it by a certain amount.

392
00:24:46,800 --> 00:24:49,200
You could difference a geometry.

393
00:24:49,200 --> 00:24:50,960
You can boundary a geometry.

394
00:24:50,960 --> 00:24:56,080
You can do all sorts of stuff that is quite tedious to do if you don't have some kind

395
00:24:56,080 --> 00:24:57,280
of library to help you do it.

396
00:24:57,280 --> 00:25:02,880
Yeah, I can imagine this can get super fiddly really fast if you want to do this on your own.

397
00:25:02,880 --> 00:25:05,680
That kind of stuff is fiendishly complicated.

398
00:25:05,680 --> 00:25:11,040
Yeah, and it's the kind of thing that you're not going to need to do this very often.

399
00:25:11,040 --> 00:25:16,000
But for example, if you're dealing with core location geofencing or something like that,

400
00:25:16,000 --> 00:25:21,760
a package like this where you just have that problem solved for you by this package,

401
00:25:21,760 --> 00:25:26,320
and the fact that it's been developed for seven years means it's on major version 10,

402
00:25:26,320 --> 00:25:30,320
which is why it popped into my feed this week.

403
00:25:30,320 --> 00:25:34,960
I did have a quick look at the release notes for 10, and there's nothing particularly notable.

404
00:25:34,960 --> 00:25:37,280
It's added some new functions.

405
00:25:37,280 --> 00:25:42,960
Looking at the history of the releases, it seems to be a release every year or so,

406
00:25:42,960 --> 00:25:46,320
something like that, and then maybe a couple of bug fixes after it.

407
00:25:46,320 --> 00:25:50,240
But certainly the last major version was 9, and that was a year ago.

408
00:25:50,240 --> 00:25:53,920
So yeah, it's a package that probably doesn't need updating every single week,

409
00:25:53,920 --> 00:25:58,560
which is also good, but it's the kind of thing that you might find useful if you need to do that job.

410
00:25:58,560 --> 00:25:58,880
Great.

411
00:25:58,880 --> 00:26:05,520
And my third pick is called Swift CLI version by Michael Lujuch.

412
00:26:05,520 --> 00:26:09,200
And this caught my eye because it actually does something that

413
00:26:09,200 --> 00:26:17,280
I've sort of manually been doing in a couple of packages, and that is the issue of a executable,

414
00:26:17,280 --> 00:26:22,000
and let's talk about command line executables maybe as an example, reporting its version.

415
00:26:22,000 --> 00:26:27,520
So for instance, you might have written a CLI command and you wanted to spit out its version,

416
00:26:27,520 --> 00:26:31,040
and that should typically be the latest git tag or whatever

417
00:26:31,040 --> 00:26:35,120
the revision was at the time of building that package.

418
00:26:35,120 --> 00:26:37,520
And that is a bit tricky to do, right?

419
00:26:37,520 --> 00:26:40,320
You don't want to do this manually, update some sort of file,

420
00:26:40,320 --> 00:26:43,200
and the way I've been doing that is run git describe,

421
00:26:43,200 --> 00:26:49,040
which gives you sort of the git version of your history and pipe it into a Swift file.

422
00:26:49,040 --> 00:26:53,680
So I have a template in my binary with a template version,

423
00:26:53,680 --> 00:26:56,560
you know, that just says something, you know, version not saved.

424
00:26:56,560 --> 00:27:02,160
And then from a make file, I sort of pipe the git describe over this file,

425
00:27:02,160 --> 00:27:06,880
sort of replacing that version so that it can be used in code to spit out the version.

426
00:27:06,880 --> 00:27:12,080
But obviously, that is all tied into having to run the builds,

427
00:27:12,080 --> 00:27:16,400
you know, the release builds through this make file to make sure that this is created

428
00:27:16,400 --> 00:27:18,800
in time for the build to absorb.

429
00:27:18,800 --> 00:27:21,600
So it can be done, but it can be a bit fiddly.

430
00:27:21,600 --> 00:27:26,080
And what this tool does, it is a build plugin that does all of that automatically.

431
00:27:26,080 --> 00:27:30,320
So you add the build plugin to your tool, and that can be a tool, it can be an app.

432
00:27:30,320 --> 00:27:35,680
And what it does, it creates that version.swift file as part of the build process

433
00:27:35,680 --> 00:27:39,680
every time, reliably, and then you have access to a variable,

434
00:27:39,680 --> 00:27:44,160
a global variable, just all caps version that you can use.

435
00:27:44,160 --> 00:27:46,640
And it's a string, an optional string, I think,

436
00:27:46,640 --> 00:27:52,560
that you can use in your, in all the places you might want to show exact version details.

437
00:27:52,560 --> 00:27:53,360
So that's really nice.

438
00:27:53,360 --> 00:27:58,080
It takes away, you know, the pain of having to set up that sort of make file based

439
00:27:58,080 --> 00:28:04,800
or whatever mechanism you use to mechanism to create this version file and does it for you.

440
00:28:04,800 --> 00:28:10,160
A really nice way, really nice use of a build tool plugin to get this result.

441
00:28:10,160 --> 00:28:12,080
But surely make files will last forever.

442
00:28:12,080 --> 00:28:13,280
I'm confident of that.

443
00:28:13,280 --> 00:28:17,760
Yeah, so that's Swift CLI version by Michael Husch.

444
00:28:17,760 --> 00:28:18,980
Great.

445
00:28:18,980 --> 00:28:21,600
So maybe we should wrap it up there.

446
00:28:21,600 --> 00:28:24,160
It's a slightly shorter than normal episode,

447
00:28:24,160 --> 00:28:26,560
but I think last time was a slightly longer than normal.

448
00:28:26,560 --> 00:28:29,360
So they do differ slightly.

449
00:28:29,360 --> 00:28:34,880
But what we'll do is we will be back in two weeks with some more news,

450
00:28:34,880 --> 00:28:38,080
hopefully some more significant news in a couple of weeks,

451
00:28:38,080 --> 00:28:41,440
and some more package recommendations, of course.

452
00:28:41,440 --> 00:28:44,400
Yeah, I'm sure we managed to balance it out with a longer episode again.

453
00:28:44,400 --> 00:28:45,760
So here we go.

454
00:28:45,760 --> 00:28:46,320
Exactly.

455
00:28:46,320 --> 00:28:46,820
Yeah.

456
00:28:46,820 --> 00:28:47,920
All right.

457
00:28:47,920 --> 00:28:48,720
So we'll see you then.

458
00:28:48,720 --> 00:28:49,600
See you in two weeks.

459
00:28:49,600 --> 00:28:50,240
Bye bye.

460
00:28:50,240 --> 00:28:50,800
Bye bye.