Semver: Can a function be removed without a major version bump? - semantic-versioning

When using semantic versioning, can a function be removed from a project without a major version bump if that function isn't intended to be part of the public API?
Ref: http://semver.org/

Major version increment comes when you make incompatible API changes. If your function do not affect the API, then you shouldn't go for it.

If the function was ever a part of the public API, intentionally or not, then removing it is a breaking change and thus a major version increment.

Related

Fabric Js requestRenderAll() method vs renderAll() method

With the new 3.0.0 version of Fabric JS we have to apply requestRenderAll() in order to see the handles when one objects is active.
My question is:
does requestRenderAll() replace some kind renderAll() method. Are there any important differences between both methods. When we have to use each of them and do we have to use them together?
I now that Canvas.renderall is a sync operation and requestRenderAll() method is regarded as improvemnt. But do we still need renderAll() and if "yes", when. And also - is renderAll() going to be deprecated in near future?

What do I use to replace ToNullSafeString() removed from AutoMapper 3?

I have code using AutoMapper 3.2.1.0 that uses the method ToNullSafeString().
I upgraded the NUGet package to 4.1.1.0, and I can no longer find the method in their package.Does anyone know the recommended approach to replacing the function? Is there a new construct that is functionally equivalent? If so, I cannot figure what it is. Nor can I find any mention of why it was removed.
This question has actually been answered pretty well in a couple of comments below it. For completeness, here are a couple of actual implementations of solutions.
Short answer
Probably both the simplest and the best solution: Replace all instances of .ToNullSafeString() with ?.ToString(). This does the same, but uses functionality built into newer versions of .Net instead of relying on an external extension method.
Alternative answer
If you've got a bunch of calls to the ToNullSafeString() method from the earlier version Automapper, and for some reason or other you can't or don't want to go through all your code and edit it away right now, you can use this instead.
Add the following class to your project, and make sure it can be reached from any classes that previously called the Automapper-method. Those calls will then automatically point to this instead.
public static class NullSafeStringHelper
{
public static string ToNullSafeString(this object value)
{
return value?.ToString();
}
}

Why is the compiler optimizing out the parameters when using Postsharp with an async method

I started using a Web API cache which I add to particular methods by using an aspect [Cache]. Everything worked great. Later on I changed this method to be async, but since then the compiler started throwing following warnings:
The parameter 'region' of method 'GetTree(System.String,
System.String, System.String[])' has been optimized out by the
compiler and will not be available to the aspect. Disable compiler
optimizations to access the parameter.
Here you can see an example of how I am using Postsharp:
[Cache]
public async Task<IEnumerable<Node>> GetTree(
[FromUri] string region,
[FromUri] string language,
[FromUri] string[] networks)
{
...
await ...
}
What do I need to do in order to get rid of the warning?
The C# compiler optimizations remove the parameters from the state machine class if these parameters are not used anywhere inside the async method. This happens regardless of whether you use PostSharp or not. PostSharp shows you the warning to notify that the removed parameters cannot be accessed inside the aspect.
It's recommended to upgrade to the latest build of PostSharp - the newer versions can handle this issue by re-introducing the missing parameters back into the state machine.
If you cannot upgrade, then the workaround is to disable "Optimize code" in the build page of the project properties for release builds (it's disabled for debug builds by default).

SPListItem.UpdateOverwriteVersion creates minor version?

In a document library in which minor version is enabled, UpdateOverwriteVersion() creates a minor version.
The thread - http://social.technet.microsoft.com/Forums/en-US/sharepointgeneral/thread/e0d1af63-3705-4b58-95c5-f0f92f86a23f - explains the similar problem and proposes the solution as turn-off the minor versioning, update the item and turn-on the minor versioning.
But, I cannot temporarily turn-off the minor versioning setting, since the same library may be in use by other users to upload/change their documents and the turning-off the setting might affect their operations.
Is there any-other solution?
Thanks and Regards,
Arjabh
If the goal is to update the fields without creating multiple versions see the code:
Microsoft.SharePoint.Client.File lp_newFile = lp_web.GetFileByServerRelativeUrl(lp_uri.LocalPath);
lp_context.Load(lp_newFile);
lp_context.ExecuteQuery();
//check out to make sure not to create multiple versions
lp_newFile.CheckOut();
ListItem lp_item = lp_newFile.ListItemAllFields;
listItem["Created"] = info.SourceFile.CreationTime;
listItem["Modified"] = info.SourceFile.LastWriteTime;
listItem.Update();
// use OverwriteCheckIn type to make sure not to create multiple versions
lp_newFile.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
Try listItem.SystemUpdate(false) instead of listItem.UpdateOverwriteVersion()
Use something like this (it works for me) :
//Disable minor versions on your list or library, if your item is in a major version (maybe use a file.Publish before)
list.EnableMinorVersions = false;
list.Update();
//Update item and overwrite your major version
ListItem lp_item = lp_newFile.ListItemAllFields;
lp_item["Created"] = info.SourceFile.CreationTime;
lp_item["Modified"] = info.SourceFile.LastWriteTime;
lp_item.UpdateOverwriteVersion();
//Enable minor versions
list.EnableMinorVersions = true;
list.Update();

ThreadPool.QueueUserWorkItem delegate never gets called

I am using MonoTouch 4.03. I have some code like this:
ThreadPool.QueueUserWorkItem (delegate
{
Debug.WriteLine("Making connect request");
client.Connect();
});
About one in 10 times it doesn't get fired. I'm only making very light use of ThreadPool.
NOTE (added 19th July): Currently I have turned LLVM optimisation off and that appears to have cured it.
This is fixed in MonoTouch 4.06 (or possibly the version before - in any case, it's fixed). I suspect the LLVM optimiser. The MonoTouch release notes show a number of bug fixes in that area.

Resources