Skip to content

Conversation

@MendixBart
Copy link
Contributor

Checklist

  • Contains unit tests ✅
  • Contains breaking changes ❌
  • Compatible with: MX 9️⃣
  • Did you update version and changelog? ✅ ❌
  • PR title properly formatted ([XX-000]: description)? ✅

This PR contains

  • [ x ] Bug fix
  • [ x ] Feature
  • Refactor
  • Documentation
  • Other (describe)

What is the purpose of this PR?

PAG added the translate function to the preview props, this adds the appropriate typing. We also noticed that the type for the mode (design, structure, x-ray) was made nullable on accident.

Relevant changes

Generated types for the preview props.

What should be covered while testing?

The updated unit tests should be sufficient.

@weirdwater
Copy link
Collaborator

Hi @MendixBart, you mention that the optionality of renderMode was a mistake. Do I understand correctly that it was always passed to the widget preview component? If not, as of what version of Studio Pro does this happen?

We just merged a feature that conflicts with your change in the Changelog. Can you rebase your branch?

@MendixBart MendixBart force-pushed the PAG-2505-update-generate-preview-types-for-pluggable-widgets-i18n branch from 8ec9eb3 to ef490e3 Compare December 10, 2024 15:45
@MendixBart MendixBart force-pushed the PAG-2505-update-generate-preview-types-for-pluggable-widgets-i18n branch from ef490e3 to 486ca06 Compare December 10, 2024 15:47
@MendixBart
Copy link
Contributor Author

Hey @weirdwater, I've resolved the conflict in the readme. But let me know if this way around isn't ideal.

And you're correct, since the introduction of the renderMode, we always passed a valid string value (not null, undefined or an empty string.)

@weirdwater
Copy link
Collaborator

weirdwater commented Dec 11, 2024

Hi,

The changelog change looks good to me 👍🏻

Do I understand correctly that the renderMode prop was passed to preview widgets prior to 10.11? This commit states that making it optional makes the widget backwards compatible. Wouldn't we be breaking the preview for widgets that expect the prop to be present that are then used in older versions of SP (realistically 9.24 and 10.6)?

@MendixBart
Copy link
Contributor Author

Ah, no the prop wasn't passed before that, so you're correct. Although the same will be true for the translate function that we're introducing in 10.18. Would it make sense to make sure both of them are optional?

@weirdwater
Copy link
Collaborator

We discussed it in the team and came to the consensus that if you are using the pluggable-widgets-tools at version 10.18 the expectation should be that resulting widgets are compatible with SP 10.18+

So we approve the properties being non-optional.

@weirdwater weirdwater merged commit 571c14a into mendix:master Dec 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants