Solved: Are these unlisted breaking changes?

I am building against 5.0 and came across two build errors:

  1. import { RenderTargetTextureSize } from '@babylonjs/core/Engines/Extensions/engine.renderTarget.js'
    It’s been moved to Materials/Textures/textureCreationOptions (and renamed).
  2. IFocusableControl was moved from '/gui/2D/advancedDynamicTexture.js' to /gui/2D/controls/focusableControl.ts

The backwards compatibility fails if we are doing explicit imports, which follows the guideline of how we are meant to do imports to allow tree-shaking. I understand that typings are erased at build time and probably not many people will come across these.

I’ve already added some missing exports in 5.0 to make it backwards compatible with 4.2, but I wonder if that is just polluting the code or actually being helpful. I am trying to support a library that works against both versions and supports type safe compile errors. :smile:

1 Like

Great catch :slight_smile:

I ll let @RaananW chose his favorite approach knowing the work he is currently doing :slight_smile:

2 Likes

I couldn’t remember any of those being changed, so I had to dig in a bit.

IFocusableControl was moved in nov. 2020 - Creating a new focusable button gui element. by Flux159 · Pull Request #9408 · BabylonJS/Babylon.js (github.com)
TextureSize - 5 months ago - Order independant transparency by CraigFeldspar · Pull Request #10659 · BabylonJS/Babylon.js (github.com)

In both cases we have not updated the breaking changes section, and you are totally right about it. The first issue can and should be addressed (I will “re-export” the TextureSize with a different name).
The second is a bit trickier, but I assume re-exporting it shouldn’t cause any issues as well.

I’ll look into that! Back-compat is back-compat and we should maintain it in our existing packages.

3 Likes

fixing back-compat removals by RaananW · Pull Request #12024 · BabylonJS/Babylon.js (github.com)

1 Like

Thanks!! That PR looks familiar! :smile: Not sure how I missed those on my back compat one:

Increase backwards compatibility to 4.2 · BabylonJS/Babylon.js@f46f4f8 (github.com)

1 Like