Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace poly variants that use @as with strings #748

Closed
@MoOx

Description

@MoOx

The problem

When using poly variants for string enums, we transformed a lot of "string-with-dash" to camel case stringWithoutDash, relying on ReScript@as annotation.
Now that ReScript allows poly variants to have string syntax, we could change this choice to make it more straight forward to new ReScript user that are familiar with React Native.

Considered solution

We could make this a breaking change. Maybe a codemod will help.

Alternatives solutions

We can also:

  • add strings values (so people can use both syntax (with-dash or withoutDash) and keep both (maintenance++)
  • integrate both & deprecate later withoutDash if that possible (syntax seems to be accepted but it doesn't seems to show the warning - I tested| @deprecated("use #\"plain-text\" instead of #plainText") @as("plain-text") #plainText inAlert.res)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp