Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create mock asts for message bundle component | Message Component #2793

Conversation

felixhaeberle
Copy link
Contributor

Copy link

changeset-bot bot commented May 15, 2024

⚠️ No Changeset found

Latest commit: adcde5c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@felixhaeberle felixhaeberle requested a review from jldec May 15, 2024 15:46
@felixhaeberle
Copy link
Contributor Author

felixhaeberle commented May 15, 2024

@jldec It would be nice if you could have a look at the mock message format to verify if we are going in the right direction here and add a additional mock message mockMessageBundleMinimal with the minimal number of properties.

Or better yet, do we have a real project (multiple messages in messageBundle format, query possibility) to test with the Message Component?

@jldec
Copy link
Contributor

jldec commented May 15, 2024

Thanks @felixhaeberle - src/stories/inlang-message-bundle.ts is showing typescript errors during build.

I just added you to also review #2795 which should help create simple mocks more easily. I'm looking for suggestions for how to easliy mock messages with selectors and variants using a createMessage() function.

Using v2 MessageBundlers with a test project is on the roadmap (MESDK-104), but we first have to be able to persist using the new v2 structure.

@jldec
Copy link
Contributor

jldec commented May 16, 2024

@felixhaeberle
I think we should put these mocks into sdk/v2/mocks instead, so that they can be re-used for testing etc across apps.
Please see #2795 (comment)

@jldec
Copy link
Contributor

jldec commented May 17, 2024

@felixhaeberle - I merged a slightly simplified and corrected plural example message bundle ast with #2795

@NilsJacobsen
Copy link
Member

@jldec you can start making the review.

@NilsJacobsen NilsJacobsen added the type: feature New feature or request label May 29, 2024
Copy link
Contributor

@jldec jldec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes needed for function annotations and clarification needed for "formal".

type: "expression",
arg: {
type: "variable",
name: "formal: bool",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool should be an annotation (function) as well right?
Do you know how this function would be defined ?
I could not find it in https://github.com/unicode-org/message-format-wg/blob/main/spec/registry.md
cc: @martin-lysk @LorisSigrist for clarification of how the "formal" selector is expected to work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might also affect how the formal selectors are expressed in other parts of the AST.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it like the plural. Can we make a separate discussion about it, so we can merge this PR.

@NilsJacobsen NilsJacobsen requested a review from jldec May 30, 2024 10:40
Copy link
Contributor

@jldec jldec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @NilsJacobsen

@NilsJacobsen NilsJacobsen merged commit d2b5263 into main May 31, 2024
3 checks passed
@NilsJacobsen NilsJacobsen deleted the felixhaeberle/inlmc-88-create-mock-asts-for-message-bundle-component branch May 31, 2024 10:17
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants