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

feat: allow dash-case type generation to be optional #6178

Open
3 tasks done
hannahmclarke opened this issue Feb 28, 2025 · 0 comments · May be fixed by #6179
Open
3 tasks done

feat: allow dash-case type generation to be optional #6178

hannahmclarke opened this issue Feb 28, 2025 · 0 comments · May be fixed by #6179

Comments

@hannahmclarke
Copy link

Prerequisites

Describe the Feature Request

The update made in #6158 to support dash casing results in properties being added twice in the components.d.ts, in both camelCase and dash-case (with an added @deprecated comment for dash-case properties). While this solves the initial issue highlighted in #6150, it is not necessarily needed for all projects.

I'm going to open a PR to add a config option (noDashCaseTypes?) that allows for the generation of dash-cased properties to be skipped.

Describe the Use Case

Users who are not using dash-casing in JSX templates do not need dash-cased types to be added to components.d.ts and should be able to skip this if necessary.

In our particular project, we have a script that uses components.d.ts to generate types files for React components - we could update our script to ignore duplicated types in dash-case (also not supported by React), but having the option to switch off this feature for users who were not facing the initial issue (#6150) would be useful.

Describe Preferred Solution

I'm planning on opening a PR that will:

  • Add a noDashCaseTypes? option to the StencilConfig interface
  • Use this to determine whether to skip the generation of dash-case types in components.d.ts
  • Update tests to account for this option

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

hannahmclarke added a commit to hannahmclarke/core that referenced this issue Feb 28, 2025
… generation

Allows for `noDashCaseTypes` to be set in Config to prevent generation of non-camelCase types from attribute names in `components.d.ts` during build.

fixes: stenciljs#6178
feat: allow dash-case type generation to be optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant