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

Integrate SmartFormat v3.2.1 #38

Merged
merged 14 commits into from
Jun 29, 2023
Merged

Integrate SmartFormat v3.2.1 #38

merged 14 commits into from
Jun 29, 2023

Conversation

axunonb
Copy link
Member

@axunonb axunonb commented Jun 29, 2023

Migrate SmartFormat.NET v2.7.3 to v3.2.1

Heads up

This version is API and source compatible with prior 5.x versions.

In v5.11 the referenced package for SmartFormat.NET is updated from v2.7.3 to v3.2.1. This new major version of SmartFormat.NET incurs breaking changes. MailMergeLib manages breaking API changes under the hood. Other breaking changes are related to using SmartFormat formatter extensions in placeholders:

  1. If you're only using plain placeholders like "{Email}" or even "{Today:yyyy-MM-dd}" there's no need for updating the format strings, and you're fine.
  2. If you're using formatters like "{Fruit:cond:Apple|Pie|Orange|Banana|No fruit}", where the rendered string depends on the Fruit variable, urgently have a look at https://github.com/axuno/SmartFormat/wiki/Migration#2-formatter-differences-from-v2-to-v3 .Required modifications are not extensive, but unavoidable.
  3. On the other side SmartFormat v3 has many advantages:
    • Parsing is 10% faster with 50-80% less GC and memory allocation
    • Formatting is up to 40% faster with 50% less GC and memory allocation
    • Nullable notation inside placeholders
    • much more

See more details here: https://github.com/axuno/SmartFormat/wiki/Why-Migrate

Details

  • Update of SmartFormat.NET to v3.2.1 with at least the same extensions enabled as in prior MailMergeLib 5.x versions
  • Add NET 6.0 as a target framework, reducing the number of dependencies
  • After installation is completed, the above "Heads up" message is displayed
  • Add Sandcastle Help File Builder project folder
  • Resolves Not compatible with MailKit v3.0 #23

axunonb and others added 14 commits June 22, 2023 13:38
* Migrate project MailMergeLib
* MailMergeMessage_Exceptions: Allow null for inner Exception
* Migrate project MailMergeLib.Tests
* New method to get a free TCP port
* SslProtocols: let operating system select the best
* Remove unnecessary OneTimeSetup and FixtureTearDown
* Add method trying to bind an available port
* Removed console message for CanBindPort(int port)
No breaking MailMergeLib API changes from version 5.9.10
However SmartFormat v3 brings breaking changes to v2 (e.g. for formatter names, where name "template" changed to "t" and other)

* Update MailSmartFormatter to load at least the same SmartFormat extensions as before
* Code updates for breaking changes from SmartFormat v2.7.3 to v3.2.1
* MailMergeMessage: A new MailSmartFormatter instance is created after properties of SmartFormatterConfig are changed. This is because SmartFormatter does not allow for changes to the settings, after the instance is created
* Further fixes for NRT
* Minor style refactoring
* Fix some typos
* Update YAXLib to v4.1.0
* Update AngeSharp to v1.0.4
* Update Microsoft.NET.Test.Sdk to v17.6.3"
* Unit test run with net462, netcoreapp3.1 and net6.0
* Disable unit tests console output
* Run unit test for linux under netstandard2.1
@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Patch coverage: 91.66% and project coverage change: -0.11 ⚠️

Comparison is base (b7f0446) 94.40% compared to head (2b9a348) 94.30%.

❗ Current head 2b9a348 differs from pull request most recent head 56c2393. Consider uploading reports for the commit 56c2393 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
- Coverage   94.40%   94.30%   -0.11%     
==========================================
  Files          39       39              
  Lines        1949     1967      +18     
==========================================
+ Hits         1840     1855      +15     
- Misses        109      112       +3     
Impacted Files Coverage Δ
Src/MailMergeLib/MailMergeMessage_Exception.cs 100.00% <ø> (ø)
Src/MailMergeLib/MessageStore/FileMessageStore.cs 96.36% <ø> (ø)
...MailMergeLib/Serialization/IPEndPointSerializer.cs 71.42% <ø> (ø)
Src/MailMergeLib/Settings.cs 100.00% <ø> (ø)
Src/MailMergeLib/SmtpClientConfig.cs 71.42% <68.88%> (ø)
Src/MailMergeLib/Templates/Part.cs 95.00% <75.00%> (+0.55%) ⬆️
Src/MailMergeLib/MailMergeSender.cs 95.72% <85.71%> (-0.74%) ⬇️
Src/MailMergeLib/MailMergeMessage.cs 90.85% <91.37%> (+0.02%) ⬆️
Src/MailMergeLib/HtmlBodyBuilder.cs 93.10% <95.00%> (+0.42%) ⬆️
Src/MailMergeLib/AngleSharpHtmlConverter.cs 100.00% <100.00%> (ø)
... and 22 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@axunonb axunonb merged commit 55ad086 into main Jun 29, 2023
@axunonb axunonb deleted the version/v5.11 branch June 29, 2023 20:35
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.

Not compatible with MailKit v3.0
1 participant