Skip to content

Bump SmartFormat from 3.3.0 to 3.6.2 - #226

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/eng/SmartFormat-3.6.2
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/nuget/eng/SmartFormat-3.6.2

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Oct 28, 2026

Copy link
Copy Markdown

Updated SmartFormat from 3.3.0 to 3.6.2.

Release notes

Sourced from SmartFormat's releases.

3.6.2

What's Changed

New Contributors

Full Changelog: axuno/SmartFormat@v3.6.1...v3.6.2

3.6.1

What's Changed

Full Changelog: axuno/SmartFormat@v3.6.0...v3.6.1

3.6.0

Release Notes

Thread Safety Enhancements

  1. Parser:

    • The parsing logic in Parser has been refactored by replacing stateful instance variables.
    • The Parser.ParseFormat(...) method is now thread-safe, ensuring safe operations in multi-threaded environments.
  2. SmartFormatter:

    • All SmartFormatter.Format... methods are thread-safe.
    • Removed the ThreadStatic attribute from the Smart.Default instance of SmartFormatter.
    • Added parallel unit tests to ensure thread-safe operations with shared SmartFormatter instances using different Smart.Extensions.
    • Updated documentation in Parser, Smart, and SmartFormatter classes to clarify the thread safety of methods.

Also see further remarks regarding thread-safety in the Wiki

Heads Up

  • Removal of ThreadStatic Attribute for Smart.Default:
    • The ThreadStatic attribute for the Smart.Default instance of SmartFormatter has been removed.
    • This change addresses user feedback regarding their lack of favor and the increased GC pressure it caused in multi-threaded environments like ASP.NET Core.
    • The removal is intended to enhance usability and performance in multi-threaded environments. It may, however, break existing code.

User Feedback

image

Sample Usage: Using One SmartFormatter Instance with Several Threads in Parallel

The following example demonstrates how to use a single SmartFormatter instance with multiple threads in parallel. This ensures thread-safe operations and efficient resource utilization.

using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using SmartFormat;

public class Program
{
    public static void Main()
    {
        // Create a single instance of SmartFormatter
        var smartFormatter = Smart.CreateDefaultSmartFormat();

        // Concurrent dictionary to store results
        var results = new ConcurrentDictionary<long, string>();
        var options = new ParallelOptions { MaxDegreeOfParallelism = 100 };

        // Run parallel tasks
 ... (truncated)

## 3.5.3

## What's Changed
* Add support for specifying separator between units when using TimeFormatter by @​hakksor in https://github.com/axuno/SmartFormat/pull/459
* Bump version to v3.5.3 in https://github.com/axuno/SmartFormat/pull/463

#### Example:
`TimeFormatter` allows for nested formats:
```cs
var ci = CultureInfo.GetCultureInfo("en");

// Using standard:
_ = Smart.Format(ci, "{1:time:", new TimeSpan(1,1,1,1,1));
// Output: "1 day 1 hour 1 minute 1 second"

// Using ListFormatter:
_ = Smart.Format(ci, "{1:time: {:list:|, | and }}", new TimeSpan(1,1,1,1,1));
// Output: "1 day, 1 hour, 1 minute and 1 second"

New Contributors

Full Changelog: axuno/SmartFormat@v3.5.2...v3.5.3

3.5.2

What's Changed

Backstage Changes

New Contributors

Full Changelog: axuno/SmartFormat@v3.5.1...v3.5.2

3.5.1

What's Changed

Full Changelog: axuno/SmartFormat@v3.5.0...v3.5.1

3.5.0

What's Changed

Feature: Add interface IFormattingExtensionsToggle to skip formatting (#​436)

  • Added the IFormattingExtensionsToggle interface to allow skipping formatting by IFormatter extensions.
  • This interface is primarily used by ISource extensions that receive it with the ISelectorInfo parameter.
  • By setting IFormattingExtensionsToggle.DisableFormattingExtensions to true, formatting can be skipped. This can be useful when the ISource found a value in ISource.TryEvaluateSelector where default formatting cannot reasonably be done.

Security: Update of System.Text.Json (#​435)

  • Bumped System.Text.Json to v8.0.4
  • Fixed a vulnerability in .NET when calling the JsonSerializer.DeserializeAsyncEnumerable method against an untrusted input using System.Text.Json, which could result in Denial of Service.

Feature: Implement ISpanFormattable for DefaultFormatter (#​434)

  • Implemented ISpanFormattable for DefaultFormatter
  • ISpanFormattable is 5% faster than IFormattable, with 24% less allocations
     // Performance test case
     Smart.FormatInto(output, null, _placeholder0005Format, 1234567.890123f, 1234567.890123f, 1234567.890123f, 1234567.890123f, 1234567.890123f);
     BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3737/23H2/2023Update/SunValley3)
     13th Gen Intel Core i7-13700K, 1 CPU, 24 logical and 16 physical cores
     .NET SDK 8.0.302
       [Host]   : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX2
       .NET 8.0 : .NET 8.0.6 (8.0.624.26715), X64 RyuJIT AVX2
    
     Job=.NET 8.0  Runtime=.NET 8.0
    
     | Method                   | N     | Mean          | Error       | StdDev      | Ratio | RatioSD | Gen0       | Allocated    | Alloc Ratio |
     |------------------------- |------ |--------------:|------------:|------------:|------:|--------:|-----------:|-------------:|------------:|
     | ISpanFormattable         | 100   |     74.502 us |   0.3693 us |   0.3273 us |  8.52 |    0.05 |     4.0283 |      62.5 KB |        2.76 |
     | IFormattable             | 100   |     77.927 us |   0.5760 us |   0.5388 us |  8.91 |    0.07 |     5.2490 |      82.0 KB |        3.62 |
    

Feature: ReflectionSource (#​426)

  • Made ReflectionSource.TypeCache static for better performance.
  • If the static cache has undesired effects on your code logic, consider to disable the cache (ReflectionSource.IsTypeCacheEnabled = false).
  • Implemented a mechanism to control the size of ReflectionSource.TypeCache and remove the oldest item first.

Enhancement: DictionarySource (#​426)

  • Dynamics in DictionarySource now use case-sensitivity setting
  • Cache for IReadOnlyDictionary now has instance scope

Refactor: Split off classes Registry and Evaluator from SmartFormatter (#​424)

SmartFormatter

... (truncated)

3.4.0

What's Changed

.NET Framework 4.6.2

SmartFormat has transitioned to using .NET Framework 4.6.2 (net462) as its target framework, replacing the now unsupported .NET Framework 4.6.1 (net461). The support for net461 ended in 2022, while net462 will continue to receive support until January 2027.

Switching to a different patch version of a target framework is generally not considered a breaking change. This is referred to as an in-place update by Microsoft. In the case of SmartFormat, we have not encountered any runtime issues with the existing API after this transition.

The same holds true for the new netstandard2.0 reference to ZString.

.NET 6.0 and .NET 8.0

SmartFormat has expanded its compatibility by adding .NET 6.0 (net60) and .NET 8.0 (net80) as additional target frameworks. You can find details about their end of support here.

All Target Frameworks

We have removed the SmartFormat.ZString assembly and replaced it with a reference to the ZString package. This change does not affect the API.

Commits in detail

Thanks to @​thompson-tomo for his first contribution with axuno/SmartFormat#377

Full Changelog: axuno/SmartFormat@v3.3.2...v3.4.0

3.3.2

Reasoning for the Update

What's Changed

Full Changelog: axuno/SmartFormat@v3.3.1...v3.3.2

3.3.1

Fix

PluralRule for DualFromZeroToTwo: Now a value of 2 is covered and will not throw. Frend is one of the affected languages. Closes #​369 in axuno/SmartFormat#370

Enhancement

Dictionary<string, PluralRuleDelegate> PluralRule.IsoLangToDelegate holds delegates with the pluralization rule per language. Changing a value of this dictionary will change the pluralization rules globally. This is not recommended, but possible. After a change calling PluralRules.RestoreDefault() will restore the default rules.

Other Changes

Full Changelog: axuno/SmartFormat@v3.3.0...v3.3.1

Commits viewable in compare view.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

---
updated-dependencies:
- dependency-name: SmartFormat
  dependency-version: 3.6.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added .NET Pull requests that update .NET code dependencies Pull requests that update a dependency file labels Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants