Migration Guide: 6.12 to 6.13

We’re excited to bring you You.i Platform version 6.13. As part of this release, there are some changes that may affect your application. For simplicity, we’ve organized the steps below by application type.

All Apps

You.i CLI Changes

We’ve added support for building You.i Platform with Xcode 13. You may get the following error while building in Xcode 13:

error: The Legacy Build System will be removed in a future release.
You can configure the selected build system and this deprecation message in File > Project Settings.

To handle this error, you can either:

  • Switch to the new build system in Xcode, by choosing File > Project Settings > Build System > New Build System (Default), or
  • Remain on the “Legacy Build System (Deprecated)” and ignore further messages by enabling Do not show a diagnostic issue about build system deprecation.

If you’re building with the You.i CLI, you can also pass the option -UseModernBuildSystem=1 to disable the error.

See also our docs on building in Xcode.

Breaking Changes

Removal of unused-parameter flag from compiler options

Previously, some compiler warnings were treated as warnings instead of errors, including the use of the unused-parameter flag.

Now, if an unused parameter is used, the following error is issued:

error: unused parameter [-Werror=unused-parameter]

If you need to change this behavior, you have two options.

  • You can suppress the error by passing the unused parameter as an argument to YI_UNUSED(parameter).
  • You can pass the flag -Wno-unused-parameter as EXTRA_FLAGS to the yi_configure_compile_options function as follows:
  yi_configure_compile_options(PROJECT_TARGET ${PROJECT_NAME} EXTRA_FLAGS -Wno-unused-parameter)

C++ Applications

C++ Breaking Changes

CYITimelineBackingStore now returns marker data for all markers

CYITimelineBackingStore now returns marker data for all markers as a collection, allowing easier access to more information. As part of this change, we’ve removed the GetMarkerNameFromMarkerIndex API.

Prior to 6.13
CYITimelineBackingStore *pBackingStore;
const CYIString &marker = pBackingStore->GetMarkerNameFromMarkerIndex(i);
Now in 6.13
CYITimelineBackingStore *pBackingStore;
const std::vector<CYIMarkerData> &markers = pBackingStore->GetMarkers();
const CYIString &marker = markers[i].GetName();

Deprecated ImportCompositionTemplateFromStream removed from CYIAEViewTemplate

ImportCompositionTemplateFromStream was deprecated in 5.12. We’ve removed it in this release. You must now use ImportCompositionTemplateFromBytes(CYIStringView) instead.

Changes to return value for CYIViewTemplate classes

CYIViewTemplate classes now return glm::vec2 for GetSize(). This API change affects CYIViewTemplate, CYIEmptyViewTemplate, and CYIAEViewTemplate.

Prior to 6.13
CYIAEViewTemplate template;
float width;
float height;
template.GetSize(width, height);
Now in 6.13
CYIAEViewTemplate template;
glm::vec2 size = template.GetSize(width);

Signal parameter change in CYIPlatformViewProxy::PlatformViewHandleSet

The signal parameter provided by PlatformViewHandleSet was previously of type const CYIPlatformViewHandle &. This caused object slicing due to how signals copy their arguments and prevented the signal handler implementation from obtaining the platform-specific subclass of CYIPlatformViewHandle. Now, we provide a pointer to the CYIPlatformViewProxy that emitted the signal. We recommend obtaining the handle by calling GetPlatformViewHandle on the CYIPlatformViewProxy.

Prior to 6.13
std::unique_ptr<CYIPlatformViewProxy> pPlatformViewProxy = CYIPlatformViewProxy::CreateIfSupported();
if (pPlatformViewProxy)
{
  ...
  pPlatformViewProxy->PlatformViewHandleSet.Connect([](const CYIPlatformViewHandle &handle){
    const CYIPlatformViewProxyAndroid &androidHandle = reinterpret_cast<const CYIPlatformViewProxyAndroid &>(handle);
    // Use the handle - although using the handle here previously would have been invalid, due to object slicing introduced by the signal.
  });
  ...
}
Now in 6.13
std::unique_ptr<CYIPlatformViewProxy> pPlatformViewProxy = CYIPlatformViewProxy::CreateIfSupported();
if (pPlatformViewProxy)
{
  ...
  pPlatformViewProxy->PlatformViewHandleSet.Connect([](CYIPlatformViewProxy *pProxy){
    const CYIPlatformViewProxyAndroid &androidHandle = reinterpret_cast<const CYIPlatformViewProxyAndroid &>(pProxy->GetPlatformViewHandle());
    // Use the handle.
  });
  ...
}

Changes To Crash Handling

We’ve made changes to how the crash handling library is included in apps, as part of ongoing work to improve crash handling support in You.i Platform. If your application makes use of crash handling, you must update your CMakeLists.txt.

Prior to 6.13
if (YI_PLATFORM STREQUAL linux)
    set(_PLATFORM_CRASHHANDLER_LIB $<$<BOOL:${LINUX}>:youi::platform-crashhandler>) # only on Linux for now
endif()

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        $<$<BOOL:${YI_BUILD_CLOUD_SERVER}>:youi::cloud>
        youi::engine
        ${_PLATFORM_CRASHHANDLER_LIB}
)

yi_configure_optional_modules(TARGET ${PROJECT_NAME}
    ${_OPTIONAL_MODULES_ARGUMENTS}
)
Now in 6.13
target_link_libraries(${PROJECT_NAME}
    PRIVATE
        $<$<BOOL:${YI_BUILD_CLOUD_SERVER}>:youi::cloud>
        youi::engine
)

yi_configure_optional_modules(TARGET ${PROJECT_NAME}
    INCLUDE_IF_AVAILABLE
        platform-crashhandler
    ${_OPTIONAL_MODULES_ARGUMENTS}
)

We’ve also changed the list of functions that the application must implement. If you want the application to handle crashes as in the previous release, implement the following functions:

bool YiCrashHandler_ConfigureCrashHandler()
{
}

CYIString YiCrashHandler_GenerateCrashReportPayload(const CYIString &metadataJSON)
{
    return metadataJSON;
}

You don’t need to customize the implementation of these functions – they’re only required when using the newer crash handling implementation.