Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to publish 0.9.0, concurrency support, rss fixes #1

Open
wants to merge 24 commits into
base: Multi-Language
Choose a base branch
from

Conversation

CoolONEOfficial
Copy link

No description provided.

MaxDesiatov and others added 22 commits December 30, 2020 14:49
Current code formatting in the themes snippet requires horizontal scrolling. If it's slightly reformatted, horizontal scrolling can be avoided improving readability.
- Publish now uses the Swift 5.4 toolchain.
- Since Swift 5.4 now enables automatic test discovery on all supported platforms, all of the
   infrastructure that was previously used to maintain Linux unit testing compatibility has now
   been removed.
- Bump Ink to version 0.5.1, which includes a fix for Swift 5.4 compatibility.
- Bump Plot to version `0.9.0`.
- Publish now ships with a few implementations of Plot's new `Component` protocol - specifically
   `Markdown` (for rendering Markdown inline within a component hierarchy), `VideoPlayer` (for
   rendering an inline video player), and an extension that makes it possible to directly use Plot's
  `AudioPlayer` component with Publish's `Audio` model.
- The `Content.Body` type now also conforms to `Component`, which makes it possible to place
   such instances directly within a component hierarchy. That type has now also been fully documented,
   since it was previously missing documentation for some of its properties and initializers.
- The built-in Foundation theme as been rewritten using the new component API. While it remains functionally
   identical to the previous implementation, it should act as a nice example of how this new API can be used.
- Because Publish now ships with a type called `Markdown`, it's possible that some API users might need
   to disambiguate between this new type and Ink's `Markdown` type. However, that tradeoff was considered
   worth it, since using the new `Markdown` component will likely be a much more common use case.
* Checkout target deployment destination
* Init git repository with intended branch
* Create branch if it doesn't exist
* Add test master branch switch
Make the Publish CLI use version 0.8.0 of Publish.
This change adds initial support for running certain publishing operations concurrently
using Swift's new built-in concurrency system. This doesn't involve any breaking changes
to the public API, apart from now requiring all Publish users to ensure that their HTML theme
and multi-item mutation code can be executed in a concurrent manner.

The following key changes were made as part of this:

- Bump the project's Swift version to `5.5`, and update the CLI's project template accordingly.
- Add CollectionConcurrencyKit as a new package dependency, which adds concurrent
   versions of the various sequence mapping functions that Publish makes heavy use of.
- Make `PublishingStep` use an `async` closure type as its body, which in turn enables
   asynchronous calls to be made within any step, both built-in and custom ones.
- Each publishing pipeline is still performed in sequence, just like before. So it's only the
   internal operations within each step that may now be parallelized.
- The top-level `Website.publish` APIs are still completely synchronous, and uses an internal
   `DispatchSemaphore` to await the completion of the website's publishing pipeline before
   returning.
- A new built-in `mutateAllItems(in sections:)` API has been added, to make it convenient
   to iterate over all items within a certain set of sections in a concurrent manner.
- `HTMLGenerator` now executes concurrently, meaning that it can output a large number
   of HTML files in parallel, rather than writing all files one-by-one.
- `MarkdownFileHandler` now also runs concurrently, and processes all of its Markdown files
   in parallel, rather than doing so sequentially.
- `RSSFeedGenerator` and `PodcastFeedGenerator` now generates their respective feeds
   concurrently.

Overall, this set of changes results in a 4x speed improvement when generating Swift by Sundell
using the M1 Max chip.

As part of this, Publish now requires macOS 12, to be able to use Swift Concurrency in a
predictable way. macOS version 12.0 has been out for quite a while now, so it's safe to require
it at this point.
Since Publish now requires macOS 12, we can safely require Python 3 when using
the CLI's `run` command to start a local web server.
@CoolONEOfficial CoolONEOfficial changed the title Update to publish 0.9.0, concurrency support Update to publish 0.9.0, concurrency support, rss fixes May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants