Skip to content

More deprecation warnings and less breaking changes in google-cloud? #1512

@richardkazuomiller

Description

@richardkazuomiller

I updated to the latest version of the datastore module today because of the v1beta3 deprecation, but I ran into some issues due to breaking changes from a few versions ago. I usually end up skipping a few versions at a time and only upgrade when I need to. It's difficult and time consuming to try to avoid this, because users have to go through every changelog looking for breaking changes even if it's an incremental update.

The particular issue I ran into was runInTransaction not working anymore. It would have been nice to have the function work but log a deprecation warning before eventually being removed, instead of finding out after deploying to production. I think wouldn't be difficult to include something like this:

datastore.runInTransaction = (stuffToDo,callback) => {
  console.log('runInTransaction is deprecated!')
  const transaction = datastore.transaction()
  transaction.run((err) => {
    if(err) {
      callback(err)
    }
    stuffToDo(transaction,() => {
      transaction.commit(callback)
    })
  })
}

Since I was using what was the latest version just three months ago, I didn't expect such a major change without any warning. In other languages, if a function is removed after upgrading a dependency, a compile time error will let the developer know, but since JavaScript doesn't have anything like that and we can't tell if code is broken until it runs, it's even more important here.

Another issue I've had is with too many things being changed at the same time. When I started using Datastore, my app was running on Node v0.10 (which is still being maintained). When the Datastore v1beta1 API was deprecated, I found out that I couldn't use Node v0.10 anymore, because gcloud-node wasn't compatible. I upgraded to Node v4 and found that the API had also been changed significantly, so it turned into a very large refactor. It would be helpful if in the future, google-cloud packages were maintained so upgrading doesn't require as much refactoring.

Now that Datastore is out of beta, can we expect to see some more stability in the functionality of google-cloud?

Metadata

Metadata

Labels

coretype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions