Skip to content

Commit

Permalink
📃New Blog Post - CASL Release v1.0.0-preview.18 (#72)
Browse files Browse the repository at this point in the history
* Start work for issue #71

* config: add create pr script to project

* config: add csharp as an additional language for code blocks

* config: add more news items for various releases

* ide: add code snippets for release front matter

* chore: create join community custom component

* chore: update blog posts to use new component

* refactor: cleanup code to meet coding standards

* chore: create github url component

* chore: create github project url component

* chore: create github issue component

* chore: create release notes component

* docs: improve blogs and news posts

* chore: create casl release blog post

* chore: rename blog post folder

* chore: create center css and format code

* chore: create gif component

* docs: update release news post gifs

* docs: improve spelling and grammar for casl release post

* chore: improve grammar and spelling with funding blog post

* chore: add single empty line
  • Loading branch information
CalvinWilkinson committed Apr 17, 2024
1 parent 5d6ee83 commit 4787053
Show file tree
Hide file tree
Showing 17 changed files with 507 additions and 67 deletions.
24 changes: 24 additions & 0 deletions .vscode/mdx-snippets.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,28 @@
],
"description": "A new URL component with text."
},
"Velaptor Release Frontmatter": {
"scope": "mdx",
"prefix": "velap-release-frontmatter",
"body": [
"---",
"slug: velaptor-release-${1: version}",
"title: Velaptor Release ${1: version}",
"authors: kinson",
"tags: [releases, velaptor]",
"---"
]
},
"CASL Release Frontmatter": {
"scope": "mdx",
"prefix": "casl-release-frontmatter",
"body": [
"---",
"slug: casl-release-${1: version}",
"title: CASL Release ${1: version}",
"authors: kinson",
"tags: [releases, casl]",
"---"
]
}
}
5 changes: 5 additions & 0 deletions blog/2023-07-10-deno-cicd/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tags: [deno, cicd, scripting, workflow, github action]
---

import URL from "@site/src/components/URL";
import JoinComm from "@site/src/components/JoinComm";

<br/>
<div align="center">
Expand Down Expand Up @@ -335,3 +336,7 @@ jobs:
If you have any questions, want to chat, or contribute to any of my open-source projects, feel free to reach out
to me on our discord channel or X located at the top right.
## <span class="color-section">Join Our Community</span>
<JoinComm />
50 changes: 50 additions & 0 deletions create-pr.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Clear-Host;

Write-Host -NoNewline "Please enter an issue number: " -ForegroundColor Cyan;
$issueNumber = Read-Host;

if ($issueNumber -notmatch '^\d+$') {
Write-Error "User input is not a number";
exit 1;
}

Write-Host -NoNewline "Please enter a branch name: " -ForegroundColor Cyan;
$branchDescrip = Read-Host;

$branchDescrip = $branchDescrip.ToLower();
$branchDescrip = $branchDescrip.Replace(" ", "-").Replace("_", "-");
$branchDescrip = $branchDescrip.TrimStart("-");
$branchDescrip = $branchDescrip.TrimEnd("-");

$headBranch = "feature/$issueNumber-$branchDescrip";
$commitMsg = "Start work for issue #$issueNumber";

$destBranch = "not-set";

$baseBranches = @("main", "preview");
Write-Host -NoNewline "Please choose a base branch from the list [$($baseBranches -join ', ')]: " -ForegroundColor Cyan;
$chosenBaseBranch = Read-Host;

if ($baseBranches -contains $chosenBaseBranch) {
$destBranch = $chosenBaseBranch;
} else {
Write-Error "Invalid base branch.";
exit 1;
}

Write-Host "`n--------------------------------`n";

Write-Host "Creating branch. . ." -ForegroundColor Yellow;
git checkout -B "$headBranch";
Write-Host "";

Write-Host "Creating empty commit. . ." -ForegroundColor Yellow;
git commit --allow-empty -m $commitMsg;
Write-Host "";

Write-Host "Pushing branch to remote. . ." -ForegroundColor Yellow;
git push --set-upstream origin "$headBranch";
Write-Host "";

Write-Host "Creating PR. . ." -ForegroundColor Yellow;
gh pr create -B $destBranch -b "" -t "new pr" -d;
14 changes: 11 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,17 @@ const config = {
to: "/news/tags/kd-org",
},
{
label: "Releases",
label: "Velaptor Releases",
to: "/news/tags/velaptor",
},
{
label: "CASL Releases",
to: "/news/tags/casl",
},
{
label: "All Releases",
to: "/news/tags/releases",
}
},
]
},
{
Expand Down Expand Up @@ -202,7 +210,7 @@ const config = {
copyright: `Copyright © ${new Date().getFullYear()} KinsonDigital`,
},
prism: {
additionalLanguages: ["bash", "diff", "json"],
additionalLanguages: ["bash", "diff", "json", "csharp"],
theme: lightTheme,
darkTheme: darkTheme,
},
Expand Down
17 changes: 11 additions & 6 deletions news/2023-09-25-added-funding/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,32 @@ tags: [kd-org]
---

import URL from "@site/src/components/URL";
import JoinComm from "@site/src/components/JoinComm";

## 🎉Exciting News🎉

We are thrilled to share that we have been approved by <URL link='opencollective.com' text="Open Collective"/>!
We are thrilled to share that we got approval by <URL link='opencollective.com' text="Open Collective"/>!

This approval expands our funding options, providing more ways for supporters to contribute financially.

What is Open Collective?

Open Collective is an innovative platform designed to address the funding challenges faced by open-source projects.
It not only allows individuals to contribute to projects but also provides transparency on how the funds are utilized.
This aligns perfectly with the open-source ethos of transparency and accountability.
It allows individuals to contribute to projects and provides transparency on how the funds are used.
Open collective aligns perfectly with the open-source ethos of transparency and accountability.

We’re delighted to join this platform and look forward to the opportunities it presents.
We are delighted to join this platform and look forward to its opportunities.

In addition to Open Collective, we continue to offer funding options through <URL link="github.com/sponsors" text="GitHub Sponsors"/>.

We’re also exploring additional funding avenues and will keep you updated as we add more options.
We are also exploring additional funding avenues and will keep you updated as we add more options.

If you’re interested in contributing and helping us advance our projects, you can do so through the following links:
If you are interested in contributing and helping us advance our projects, you can do so through the following links:
- <URL link="https://github.com/sponsors/KinsonDigital" text="Sponsor us on GitHub Sponsors"/>
- <URL link="opencollective.com/kinsondigital" text="Sponsor us on Open Collective"/>

Your support is greatly appreciated! 🙏🏻

## <span class="color-section">Join Our Community</span>

<JoinComm />@site/src/components/GHProj@site/src/components/GHUrl
30 changes: 16 additions & 14 deletions news/2024-01-16/index.mdx → news/2024-01-16-vel-release/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ authors: kinson
tags: [releases, velaptor]
---

import JoinComm from "@site/src/components/JoinComm";
import ReleaseNotes from "@site/src/components/ReleaseNotes";
import GHProj from "@site/src/components/GHProj";
import GIF from "@site/src/components/GIF";

Hello and welcome to another _**Velaptor**_ release!!

This release brings you some small performance improvements,
the start of your mocking library migration, some API deprecations, and some bug fixes.

:::info Release notes
You can view the release notes [here](https://github.com/KinsonDigital/Velaptor/releases/tag/v1.0.0-preview.32)
Check out the <ReleaseNotes projName="Velaptor" version="v1.0.0-preview.32"/>
:::

A quick thanks to the following contributors for their contributions to this release:
Expand All @@ -34,7 +39,7 @@ This release of **Velaptor** brings you the following:

## <span class="color-section">Perf Improvements</span>

![fast](https://media.giphy.com/media/fBEMsUeGHdpsClFsxM/giphy.gif)
<GIF url="https://media.giphy.com/media/fBEMsUeGHdpsClFsxM/giphy.gif"/>

In the realm of game development, performance is a perpetual pursuit. We’re constantly on the
lookout for opportunities to boost the performance of Velaptor. This time, we’ve made a couple of minor enhancements.
Expand All @@ -54,15 +59,9 @@ This is not going to affect any users of **Velaptor**, but this will affect cont

### <span class="color-sub-section">Migration Details</span>

This is related to refactoring all of our unit test code from using the [Moq](https://github.com/devlooped/moq)
This is related to refactoring all of our unit test code from using the <GHProj owner="devlooped" projName="moq"/>
library to the [NSubstitute](https://nsubstitute.github.io/) library. This is going to take a while but all of
the issues related to this are created and ready to go. We will be working on releasing at least one of these issues or more per release.
:::note Help Wanted
If you are interested in helping out with this, you can pick any of the issues [here](https://github.com/KinsonDigital/Velaptor/issues?q=is%3Aissue+in%3Atitle+%22%F0%9F%9A%A7Refactor+moq+code+to+nsubstitute%22+-assignee%3ACalvinWilkinson+)
There is a chance by the time you read this that all of the work might be complete.
If so, the list of issues shown on GitHub will be empty.
:::


### <span class="color-sub-section">Rationale Behind the Migration</span>

Expand All @@ -76,8 +75,8 @@ the verbosity and intricacy of the unit tests. While this is not inherently nega
pose challenges in terms of maintenance and comprehension.

Over time, I began exploring _**NSubstitute**_ and found it to be a promising alternative as well
as not as verbose and more readable. A recent incident within the _**Moq**_ community served as the
catalyst for finally deciding to make the switch.
as not as verbose and more readable. A recent incident within the _**Moq**_ community was the
catalyst to finally deciding to make the switch.

For those interested in the specifics of this incident, you can [read about it here](https://medium.com/checkmarx-security/popular-nuget-package-moq-silently-exfiltrates-user-data-to-cloud-service-d1888867406d)
and [watch it here](https://www.youtube.com/watch?v=A06nNjBKV7I).
Expand Down Expand Up @@ -105,7 +104,7 @@ Changes to this project do not affect
_**Velaptor**_ in any way.
:::

To replace the UI in the _**VelaptorTesting**_ project, we decided to use the [ImGui.NET](https://github.com/ImGuiNET/ImGui.NET)
To replace the UI in the _**VelaptorTesting**_ project, we decided to use the <GHProj owner="ImGuiNET" projName="ImGui.NET"/>
library. This library is a popular and battle-tested solution that has been around for a long time, making it an obvious choice for our needs.
With the replacement of the UI API with ImGui.NET in the _**VelaptorTesting**_ project, we are now in a position to fully
remove the deprecated control UI API from the _**Velaptor**_ codebase when the time is right.
Expand Down Expand Up @@ -150,7 +149,7 @@ Let’s be honest, there’s a certain satisfaction in squashing bugs, especiall
It’s like getting a bonus when you discover a bug while working on something else.
This is precisely what happened in our case.

![bug](https://media.giphy.com/media/EmSCxtcjQCmXK/giphy.gif)
<GIF url="https://media.giphy.com/media/EmSCxtcjQCmXK/giphy.gif"/>

Then comes the realization that the bug has been lurking there for a while, making you wonder how it slipped
past you or why no one has reported it. But no matter how minor or improbable the bug, We are always ready to tackle it head-on!
Expand Down Expand Up @@ -181,5 +180,8 @@ We would love to hear from you.

Until the next release!!

![salute](https://media.giphy.com/media/rHR8qP1mC5V3G/giphy.gif)
<GIF url="https://media.giphy.com/media/rHR8qP1mC5V3G/giphy.gif"/>

## <span class="color-section">Join Our Community</span>

<JoinComm />
144 changes: 144 additions & 0 deletions news/2024-04-17-casl-release/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
slug: casl-release-v1.0.0-preview.18
title: CASL Release v1.0.0-preview.18
authors: kinson
tags: [releases, casl]
---

import URL from "@site/src/components/URL";
import JoinComm from "@site/src/components/JoinComm";
import ReleaseNotes from "@site/src/components/ReleaseNotes";
import GIF from "@site/src/components/GIF";

Hello, and welcome to another _**CASL**_ release!!

This release has new features, a bug fix, and many breaking changes.

Breaking changes!! Yes, you read that right. We have made some breaking changes to the API in order
to make it more consistent and easier to use and to help solidify the public API before the release
of version `v1.0.0`.

:::info Breaking Changes Reminder
Remember, we are in preview!! So, breaking changes are expected and also encouraged.
Preview releases are an opportunity to fix any issues and improve the API before the final release.
It's better now than in a production release. 😀

We add all the breaking changes to the release notes for every release. So, if you are
upgrading, check the <ReleaseNotes projName="CASL" version="v1.0.0-preview.18"/>
for any breaking changes. You can also check out the project on <URL link="github.com/kinsondigital/casl" text="GitHub"/>
All issues and associated pull requests are labeled, documented, and organized into
milestones. It is effortless to find what you are looking for.
:::


So, let's get to it!!

{/*truncate*/}


## Ok, let's hear it!!

The biggest feature of this release has been the long-awaited ability to stream audio playback
. Yep, finally. 😴

This feature was a doozy to implement. A decent amount of changes, education, and debugging
had to go into this release so we could implement this.

But what is "audio streaming"? Also, what was it doing before this release? Well, in the world of
audio, there is data and a lot of it. There is a reason why audio and video files are so large
and also why compression formats are so standard in the world of media.

## What was it doing before?

Before this release, full buffering was the only type of buffering performed.
From that point on, the audio hardware was taking over, and the audio was in the audio hardware's memory.
CASL would send various <URL link="https://openal.org/" text="OpenAL"/> commands to tell the audio hardware what to do, and the audio hardware
would do it.

The problem was that _**ALL**_ of the audio data was loaded into memory. Though this works
perfectly fine, it comes with some downsides. The downside is the amount of time it would take
to load all of the audio data if your application had a lot of audio files and were significant in size.
Full buffering leads to bad loading performance and hogs all that precious memory you might need.

<GIF url="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdmZ5eHJuZDlpdG9rbHI3bzRpcXkxeHIxeG5ya3hyaGttb2I3dm8xdSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/wYCmXZ6RvPdIgnisOJ/giphy.gif" />

Think of a video game. You have a scene with many sound effects and various music tracks.
You try to load the scene, and it grinds to a halt because all the audio data is loaded before use.
Uh, it's not fun. Who has time for this?

## What is streaming?

So, what is audio streaming? Audio streaming is the ability to load audio data in chunks.
For example, you could have 1 second worth of audio data loaded. As the audio plays,
it detects when it reaches the end of that chunk of data. At that point, it loads the next chunk
of 1-second data, cleans up the previous chunk, and continues playing.

The benefit of this is that the playback of the audio only loads what is needed when it is required.
Without needing to load 3.5 MB of data, it may only load 1 kb. Stream buffering means
almost instant loading of any audio content.

But this also has some downsides. Nothing comes for free, you know. The downside to streaming
is the performance of the playback operations. For example, let's say
I have an audio file that is 5 minutes long. When I tell the audio to jump from position 30 seconds
to 240 seconds, it has to perform some operations to figure out where in the data it needs to jump to,
as well as other technical things such as decoder operations and more.

Due to this, it is a bit slower to pause, play, or jump around in the audio data than it would be
if it were all loaded and ready to go.

## When should you use full vs stream buffering?

The usual rule of thumb is to use full buffering if the audio is very short and needs to play quickly.
In video games, these are usually sound effects. The player usually wants or needs to fire the weapon
in quick succession. Each weapon fire requires the sound effect to play immediately. It is ideal
to reduce playback lag as much as possible and use full buffering.

If you have an extended audio track, such as background music, it is ideal to use streaming.
This way, when a scene is loaded, you don't have to wait for 99% of the audio to load before it starts playing.
Also, playback operation performance is not required when performing playback operations on background music.

The above examples give you an idea of the use cases for each type. As with all
software, it depends on what you are doing.

:::tip Remember
CASL is not just for games. You can use it to create any audio application!!
:::
<GIF url="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYW5mZjJmODU3OGwyZGpnOG9iMzRxbjFvNWk0anQ2YW1tZmgwY3ZkbyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/hXDrTueJWAscK3xWQ2/giphy.gif" isCentered="true"/>

## Quick example

Playing sound with CASL is a breeze. All you need is a `.mp3` or `.ogg` file, and you're ready.
We've designed CASL to be user-friendly and intuitive so you can focus on creating great audio
applications without any hassle.

Full buffering:
```csharp
// Fully loaded audio data
var filePath = "C:/path/to/audio.mp3";

var audio = new Audio(filePath, BufferType.Full);
audio.Play();
```
Stream buffering:
```csharp
// Stream audio data
var filePath = "C:/path/to/audio.mp3";

var audio = new Audio(filePath, BufferType.Stream);
audio.Play();
```

That is it!! Super easy, right? Just choose what type of buffering you want, and everything
else is handled for you.

All of the other features are easy to use as well. To play around with a sample application
that shows off all of the features, and you can use the <URL link="github.com/KinsonDigital/CASL/tree/preview/Testing/CASLTesting" text="CASLTesting"/> project.

This project is just a CLI application used for manually testing _**CASL**_. But it is great
for trying out the different features from a non-code perspective.

That's it for this release!! Enjoy!!

## <span class="color-section">Join Our Community</span>

<JoinComm />
Loading

0 comments on commit 4787053

Please sign in to comment.