skuid.model.save depreciation

I noticed that skuid.model.save() along with several other functions on skuid.model were depreciated as of Brooklyn.

What does that mean for any of my code that uses soemthing like this:

skuid.model.save([Model1, Model2, Model3])

?

And if that is really gone,  how should I save or query multiple models at the same time?

Hi Matt, it looks like the alternative is skuid.model.Model.save, which I believe handles one model. So, perhaps you can set up the models-to-save in an array, then use a for loop to call this new method on the array?

Where is this identified as deprecated in Brooklyn? Isn’t it still in Millau? https://docs.skuid.com/latest/en/skuid/api/skuid_model.html (11.0.2) still documents it and says nothing about deprecation. Or maybe I missed something on a cursory glance.

What does deprecated mean? We are using this API and we recently upgrade to Brooklyn (10.0.12) and we are not having issues using this API.

Skuid… what’s the story here?

That API actually functions the same as skuid.model.save and takes an Array of models, so it can be a one to one swap. There is no need to loop and call that API multiple times (we actually recommend not doing that).

Thanks, J.

(good to hear from you again!)

Just to clarify, I can do a simple find-and-replace from skuid.model.save to skuid.model.Model.save?

Hi, folks. First, thanks for bringing this to our attention. Our Deprecated APIs page could use a clarifying statement, and it looks like we did miss adding a note about the deprecation status to at least some of our deprecated APIs (thanks, Mike Dwyer). I’ll pass this along to our documentation team, and we’ll get that sorted. Now, as for the original question: what to do about deprecated APIs in existing code.

When we say “deprecated” here at Skuid, we mean:

  1. We discourage the use of the particular API
  2. The API is officially unsupported
  3. The API may be removed in a future version of Skuid
Deprecation notices are meant to be a heads up that this API isn’t officially sanctioned by Skuid anymore, and we recommend you migrate away from using it in your code. To aid in this, we’ve provided alternatives for everything on that list. We don’t take breaking changes lightly, so we hold them for Major versions (e.g. 12.0.0) and call them out in our release notes. Don’t expect these to disappear or stop working in a Maintenance Release (e.g. 11.0.4).

That will probably work, but we’ve all been burned by “Oh, I’ll just find and replace that” before, am I right? If you’ve got multiple instances of skuid.model.save in a single file, you could also consider declaring a var at the top and replacing throughout with that, such as…

 (function(skuid){ var saveModel = skuid.model.Model.save, ... saveModel([Model1, Model2, Model3]); ... })(skuid);

Make sense?

(Also, great to be chatting with you again too! I hope you are doing well.)