As some of you probably noticed, since Mbed OS 5.15 release we started removing deprecated APIs from the codebase. That's part of our cleanup efforts that will culminate in the next major Mbed release later this year.
Over the past 3 years, we published 90 Mbed OS 5 series releases, including 15 feature releases. During this time we closely worked with the community, partners, and customers. Together we introduced many new features, optimizations, and platforms. We believe that these combined efforts paid off. We are now in a better place than we were 3 years ago.
During these intense 3 years, we weren't always right. Feedback from our partners and community sometimes required us to change the APIs or system's behavior. During the lifetime of Mbed OS 5, we deprecated around 265 classes and functions. This high number of deprecated code became a maintenance burden and source of confusion for our users. We decided that it's the right time to do our spring cleanup. In Mbed OS 6 we'll be removing all the APIs that were marked as deprecated.
We understand that it may require extra work from Mbed OS users to update their code to the new APIs. Nonetheless, we believe it's the right thing to do and it will make everyone's life easier in the longer term. To make this process easier we are publishing monthly previews of Mbed OS 6, which show what we are working on and the direction we are moving. We'll also publish a migration guide to help with porting your application from Mbed OS 5 to 6. As part of changes planned for Mbed OS 6, we'll be rolling out a new API life cycle process. It should help us to avoid so many APIs being deprecated in the future. Stay tuned for more details.
For the reference, you can find the list of PRs with breaking changes that have already been merged on our GitHub.
If you'd like to find all the APIs that are going to be removed simply grep for the `MBED_DEPRECATED` macro.
We received some good feedback from the community saying not everyone can easily use grep and more details are needed. Let me start with short description of deprecation process. To deprecate an API we put a notice in the doxygen and decorate the function/class with the
MBED_DEPRECATED macro. Main purpose of this macro is to return a compile time warning informing user that functionality they are using is not longer supported. Unfortunately to keep this behaviour consistent we need to decorate each member of a class making the output rather verbose. If you don't see any warnings
`function` is deprecated in your compiler output that means you are not using any deprecated function. Details of
MBED_DEPRECATED macro can be found here.
We do our best to provide guidance on what is the recommended way of replacing the to be removed API in the warning message itself. Unfortunately it's not always possible as we want to give people a heads up before the new API is ready and tested. Best example of this is our UART/Serial APIs, which got rather messy over the years. We decided to mark it as deprecated while in parallel we work on the cleaned up version of the subsystem. We'll be publishing a blog post about these change. We'll also create a migration guide with all the APIs across the OS to ease the porting process. In a few cases there's no direct replacement for the deprecated API, it's usually where the API wasn't considered public. If your application depends on this functionality we advise not to update your code to Mbed OS 6.
For people that have difficulties using grep eg. on Windows or don't use the newest Mbed version here are raw grep results of deprecated APIs. Generally if you don't see the deprecation warnings in your compiler output you don't need to worry unless you use older version of Mbed and are considering migration directly to 6. We'll also create a migration guide with all the APIs across the OS to ease the porting process.
You need to log in to post a discussion