Skip to content

Commit

Permalink
📃New Blog Post - Velaptor Release v1.0.0-preview.35 (#74)
Browse files Browse the repository at this point in the history
* 📃New Blog Post - CASL Release v1.0.0-preview.18 (#72)

* 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

* Start work for issue #73

* chore: improve component to check for unused attrs

* docs: add blog images

* cleanup: remove extra copy of the blog post

* docs: rename component

* docs: improve spelling, grammar, etc, of news post

* docs: improve links in join community doc

* chore: change link color

* docs: improve 'join-comm' page

* docs: add contribution shout outs

* docs: change date of blog post
  • Loading branch information
CalvinWilkinson authored Apr 20, 2024
1 parent 4787053 commit c90b30a
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 25 deletions.
8 changes: 4 additions & 4 deletions news/2024-01-16-vel-release/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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";
import Image from "@site/src/components/Image";

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

Expand Down Expand Up @@ -39,7 +39,7 @@ This release of **Velaptor** brings you the following:

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

<GIF url="https://media.giphy.com/media/fBEMsUeGHdpsClFsxM/giphy.gif"/>
<Image 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 Down Expand Up @@ -149,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.

<GIF url="https://media.giphy.com/media/EmSCxtcjQCmXK/giphy.gif"/>
<Image 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 @@ -180,7 +180,7 @@ We would love to hear from you.

Until the next release!!

<GIF url="https://media.giphy.com/media/rHR8qP1mC5V3G/giphy.gif"/>
<Image url="https://media.giphy.com/media/rHR8qP1mC5V3G/giphy.gif"/>

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

Expand Down
6 changes: 3 additions & 3 deletions news/2024-04-17-casl-release/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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";
import Image from "@site/src/components/Image";

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

Expand Down Expand Up @@ -60,7 +60,7 @@ perfectly fine, it comes with some downsides. The downside is the amount of time
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" />
<Image 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.
Expand Down Expand Up @@ -103,7 +103,7 @@ 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"/>
<Image url="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYW5mZjJmODU3OGwyZGpnOG9iMzRxbjFvNWk0anQ2YW1tZmgwY3ZkbyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/hXDrTueJWAscK3xWQ2/giphy.gif" isCentered="true"/>

## Quick example

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
228 changes: 228 additions & 0 deletions news/2024-4-19-vel-release/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
---
slug: velaptor-release-v1.0.0-preview.35
title: Velaptor Release v1.0.0-preview.35
authors: kinson
tags: [releases, velaptor]
---

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

Hello again!! This release is a good one. 😉

## Quick Overview

This release contains various changes like a bug fix related to flipping images vertically and
horizontally, dependency updates, refactorings, code cleanup, and most importantly, the new stream audio
playback feature inherited from <GHProj owner="KInsonDigital" projName="CASL"/>.

The Velaptor release _**v1.0.0-preview.35**_ also contains breaking changes related to the public API.
These breaking changes are necessary and help solidify the public API before the version `v1.0.0` final release.

This release is a good one. 🤘🏻

:::info Release Notes
Check out the <ReleaseNotes projName="Velaptor" version="v1.0.0-preview.25"/>!!

If you are interested in seeing some of the features of _**Velaptor**_, check out the
<URL link="https://www.youtube.com/watch?v=LxeVcUZw_WQ" text="Demo Video"/>!!

Quick shout out to the following contributors for their contributions to this release:
- Thanks <URL link="https://github.com/AndreBonda" text="@AndreBonda"/> for his contribution with <URL link="https://github.com/KinsonDigital/Velaptor/issues/868" text="issue #868"/>!
- Thanks <URL link="https://github.com/thestbar" text="@thestbar"/> for his contribution with <URL link="https://github.com/KinsonDigital/Velaptor/issues/783" text="issue #783"/>!
:::


Let's get into the details!!

## Bug Fix

The bug fix in this release is related to flipping images vertically and horizontally when using
the `ImageData` struct. If you were using a variable of type `ImageData` in the past where the creation
of the variable when using the default constructor or the `default` keyword, and you tried to flip
the image using the `FlipHorizontally()` or `FlipVertically()` methods, then you would get an exception.

Here is an example of the code that would throw an exception:

```csharp
// ImageData imgData = default; 👈🏻 or this
// var imgData = new ImageData(); 👈🏻 or this
var imgData = default(ImageData); 👈🏻 or this

imgData.FlipHorizontally(); 👈🏻 Would cause an exception
imgData.FlipVertically(); 👈🏻 Would cause an exception
```

## Dependency Updates

The main dependency update was an update to the latest version of <GHProj owner="KInsonDigital" projName="CASL"/>.
We will get into this later.

:::info CASL Release Notes
If you want the details, check out the <ReleaseNotes projName="CASL" version="v1.0.0-preview.18"/>.
:::

Another dependency update was upgrading <GHProj owner="KinsonDigital" projName="Carbonate"/> from version _**v1.0.0-preview.16**_ to _**v1.0.0-preview.18**_.


## Refactorings and Code Cleanup

As always, we are continuously looking for ways to improve the codebase. This release contains code cleanup in areas such
as the main Velaptor project, the unit tests, spelling and grammar throughout the code docs, and more.

The improvement of the code docs directly impacts the developer experience as well as on the <URL link="https://docs.velaptor.io/docs" text="API documentation"/>.


## API Changes

The breaking changes in this release are related to the public API. The changes are necessary to make the API more consistent,
easy to use, and as less confusing as possible.

### Removal of concrete loader types

This change is about being more opinionated and producing less confusion for the user when loading content.
Currently, the best and easiest way to load content is to use the `ContentLoaderFactory` to create
the content loaders. Use the desired loader throughout the lifetime of the scene and then use that loader to load that specific kind of content.

Let's show you an example:

```csharp
public override void LoadContent()
{
// Most common way to load content
this.textureLoader = ContentLoaderFactory.CreateTextureLoader();
this.texture = this.textureLoader.Load("my-texture");
}
```

Another way that you "could" load content is by manually creating a loader object.

```csharp
public override void LoadContent()
{
// Used to be able to do this, but not anymore
this.textureLoader = new TextureLoader();
this.texture = this.textureLoader.Load("my-texture");
}
```

We are getting close but have yet to reach _**v1.0.0**_. The _**NEED**_ for creating content loaders via constructors is not necessary, and it is better to have APIs closed and then opened up as needed for a good reason. This practice helps keep the API
more consistent, and reduce breaking changes.

### Sound class changes

1. We have changed the name of the `Sound` class to `Audio` and the `ISound` interface to `IAudio`. This change better reflects the purpose of the class as
well as better alignment with the latest version of the CASL library.

```csharp
// Before v1.0.0-preview.35
var music = new Sound("my-music.ogg");


// After v1.0.0-preview.35
this.audioLoader = ContentLoaderFactory.CreateAudioLoader();

var music = this.audioLoader.Load("my-music.ogg", AudioBuffer.Stream);
// or
var music = this.audioLoader.Load("my-music.ogg", AudioBuffer.Full);
```

2. We have also changed the data type of the `Position` and `Length` properties to `TimeSpan`. Using `TimeSpan` means using what is provided by dotnet instead
of creating and maintaining a type to represent time. The previous type, `SoundTime` was a type from _**CASL**_ and was not intended to be exposed or used
in _**Velaptor**_. The `TimeSpan` API data type provides more power and flexibility than the old `SoundTime` API.

3. We have replaced the `State` property from the `ISound` interface and `Sound` class with the following bool properties to represent the state of the audio.
- `IsPlaying`
- `IsPaused`
- `IsStopped`
- The `State` property was removed due to the unintentional exposure of the _**CASL**_ API.

Here is an example of how to check the state of the audio before and after the changes:
```csharp
// Before v1.0.0-preview.35
var music = new Sound("my-music.ogg");
var isPlaying = music.State == AudioState.Playing;
var isPaused = music.State == AudioState.Paused;
var isStopped = music.State == AudioState.Stopped;

// After v1.0.0-preview.35
this.audioLoader = ContentLoaderFactory.CreateAudioLoader();
var music = this.audioLoader.Load("my-music.ogg", AudioBuffer.Stream);

var isPlaying = music.IsPlaying;
var isPaused = music.IsPaused;
var isStopped = music.IsStopped;
```

4. We removed the `Reset()` method. The functionality provided by this method is the same as
the `Stop()` method and was unnecessary. Both methods existed when we first brought **CASL**_
into __**Velaptor**__. In the world of <URL link="https://openal.org/" text="OpenAL"/>,
there is a difference between the different operation types, and they were brought into the API
by mistake. When it comes to user expectations and experience, a single method is the better way to go.

5. We removed the `public` constructor from the `Audio` class. (it used to be `Sound`).
Removal reduces the number of different ways to load content further and keeps the API
opinionated and consistent.

### Naming Changes

We went through the entire code base, refactored all types and code docs using the terms `Sound`
and `Sounds`, and replaced them with `Audio`.
Here is a list of the naming changes we did on various types and methods:

1. Refactored the name of the `LoadSoundException` to `LoadAudioException`.

2. Refactored the name of the `SoundLoader` class to `AudioLoader`.

3. Refactored the name of the `PathResolverFactory.CreateSoundPathResolver()` method to `PathResolverFactory.CreateAudioPathResolver()`.

4. Refactored the name of the `ContentLoaderFactory.CreateSoundLoader()` method to `ContentLoaderFactory.CreateAudioLoader()`.

5. Refactored the `ILoader<IAudio>.Unload()` method parameter named `sound` to `audio`.

## Default Audio Content Folder

The default content folder name where _**Velaptor**_ will search for audio content has been
changed from `Sounds` to `Audio`. Again, as we get closer to `v1.0.0`, we are starting to make
changes that make more sense to how the entire library works and to the expectations of its users.

![before](./images/before-casl-update.jpg)

VS

![after](./images/after-casl-update.jpg)

## Performance Improvements

We have introduced a slight performance improvement to loading fonts. We discovered that the font
data was loading multiple times when it should not have been.

## Othe breaking changes

These changes relate to our effort to tighten up and improve the public API.

1. The name `LoadFontException` was renamed to `LoadFontException`.
2. We removed the `public` constructors from the `Texture` class.
3. We have removed the deprecated UI control API.
- We recommend using ImgUi or another UI library or creating your UI, depending on your requirements.
4. We have removed the `width` and `height` parameters from the `ImageData` struct constructor.
- The `width` and `height` parameters were unnecessary when creating an `ImageData` object.

## Conclusion

It is always a good feeling to release a new version of _**Velaptor**_!!

We have further solidified the public API, making it more consistent and easier to use. We have also
improved the codebase, fixed bugs, and made the library more performant.

That's it, everybody! What a good release! The introduction of the audio improvements
such as streaming, improvement on the public API, and other changes mentioned before, have been coming for a long time.

See you in the next release!!

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

<JoinComm />
24 changes: 18 additions & 6 deletions src/components/GHProj.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,29 @@ interface Params {
* @returns The component.
*/
const GHProj: React.FC<Params> = ({ owner, projName }: Params) => {
//github.com/KinsonDigital/CASL/releases/tag/v1.0.0-preview.18
const forgotOwnerAttr = owner === undefined || owner === "";
const forgotProjNameAttr = projName === undefined || projName === "";

const url = `https://github.com/${owner}/${projName}`;

return (
<a href={url} target="_blank" rel="noopener noreferrer" className="link">
if (forgotOwnerAttr) {
return (
<span style={{color: 'red'}}>'missing-owner-attribute'</span>
);
} else if (forgotProjNameAttr) {
return (
<span style={{color: 'red'}}>'missing-projName-attribute'</span>
);
} else {
return (
<a href={url} target="_blank" rel="noopener noreferrer" className="link">
{projName}
<OpenNewTab
style={{ paddingTop: "10", paddingLeft: "0.25%", width: "2%" }}
/>
</a>
);
/>
</a>
);
}
};

export default GHProj;
4 changes: 2 additions & 2 deletions src/components/GIF.tsx → src/components/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface Params {
isCentered?: string;
}

const GIF: React.FC<Params> = ({ url, isCentered }: Params) => {
const Image: React.FC<Params> = ({ url, isCentered }: Params) => {
const classValue = isCentered === undefined || isCentered === "true"
? "center-horiz"
: "";
Expand All @@ -22,4 +22,4 @@ const GIF: React.FC<Params> = ({ url, isCentered }: Params) => {
);
};

export default GIF;
export default Image;
2 changes: 1 addition & 1 deletion src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

.link {
color: #a384ee;
color: #3EBFE8;
}

.color-section {
Expand Down
20 changes: 11 additions & 9 deletions src/join-comm.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import URL from "@site/src/components/URL";

We believe that everyone has something unique to offer, and we invite you to contribute to [Velaptor](https://github.com/KinsonDigital/Velaptor)
and the [KinsonDigital](https://github.com/KinsonDigital) organization.

Expand All @@ -6,18 +8,18 @@ and the [KinsonDigital](https://github.com/KinsonDigital) organization.
Interested?
</summary>

1. **Contribute Your Skills**: Whether you're a seasoned developer or just starting, your skills can make a difference. You can contribute by:
- Picking up [issues](https://github.com/KinsonDigital/Velaptor/issues) and submitting pull requests with code improvements, bug fixes, or new features.
- Providing feedback, reporting [issues](https://github.com/KinsonDigital/Velaptor/issues/new/choose), or suggesting enhancements through GitHub issues.
1. Contribute Your Skills: Whether you're a seasoned developer or just starting, your unique skills can truly make a difference. Your power to contribute is immense, and you can do so by:
- Picking up <URL link="https://github.com/KinsonDigital/Velaptor/issues" text="issues"/> and submitting pull requests with code improvements, bug fixes, or new features.
- Providing feedback, <URL link="https://github.com/KinsonDigital/Velaptor/issues/new/choose" text="reporting issues"/>, or suggesting enhancements through GitHub issues.

2. **Support Us Financially**: If you're in a position to do so, consider supporting us financially. Your contributions can help us cover expenses
like hosting and infrastructure costs, and support the ongoing development and maintenance of all [KinsonDigital](https://github.com/KinsonDigital) projects.
2. **Support Us Financially**: Consider supporting us financially if you can. Your contributions can help us cover expenses
like hosting and infrastructure costs, and support the ongoing development and maintenance of all <URL link="https://github.com/KinsonDigital" text="KinsonDigital"/> projects.
You can donate or sponsor us on:
- [GitHub Sponsors](https://github.com/sponsors/KinsonDigital)
- [Open Collective](https://opencollective.com/kinsondigital)
- <URL link="https://github.com/sponsors/KinsonDigital" text="GitHub Sponsors"/>
- <URL link="https://opencollective.com/kinsondigital" text="Open Collective"/>

Remember, every contribution, no matter how small, is valuable and appreciated. By contributing, you're
not just helping us, you're helping the entire community by making game development better and more efficient.
Come, join us on this and be involved in making something amazing together!
not just helping us; you're helping the entire community by making game development better and more efficient.
Join us on this and be involved in making something amazing and unique together!

</details>

0 comments on commit c90b30a

Please sign in to comment.