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

Remove prop-types definitions from mjml-react #93

Closed

Conversation

IanEdington
Copy link
Contributor

@IanEdington IanEdington commented Sep 28, 2022

opps

henrinormak and others added 29 commits November 4, 2018 21:20
* add align to MjmlTableProps

* table align type


MJML allows setting global values by using elements in the header.
By forcing children types to be defined it restricts the ability to define mjml tags in the header.
This type checking also doesn't provide much value since the resulting error is immediately visible.

Based on this PR #47420 MjmlText has already been changed.
…nts by @tubbo

The `icon-padding` attribute is available for an [mjml social element](https://mjml.io/documentation/#mj-social),
but this is not reflected in the type. Add this attribute to the `MjmlSocialElementProps` type definition.
…eact package by @philipwindeyer

* add mjClass prop to ClassNameProps

* lets try that again, without my auto-formatter modifying the entire file

* include mjClass in maxProps test for MjmlBody
* Add undefined to optional properties, part H

In preparation for exactOptionalPropertyTypes in Typescript 4.4, add undefined to all optional properties. #no-publishing-comment

This PR covers non-widely used packages starting with h- and following.

microsoft/dtslint#335

* shorten line lengths
* Add missing table props

* Remove patch version

* Use ClassNameProps for table
… by @eps1lon

* [mjml-react] Add Explicit types for children

https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-wrapper.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-breakpoint.js#L10
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-font.js#L7
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-button.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-column.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-divider.js#L7
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-group.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-hero.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-image.js#L7
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-navbar.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-navbar-link.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-spacer.js#L7
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-table.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-wrapper.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-carousel.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-carousel-image.js#L10
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-social-element.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-social.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-section.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-column.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-button.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-text.js#L8
https://github.com/wix-incubator/mjml-react/blob/7894e20e52db6340e8bad2cbb731f6a3f2430db4/src/mjml-body.js#L8

* Will only throw once we remove implicit children

* Adjust children after propTypes changes

* Revert MjmlFont test changes
From dtslint/dt.json to @definitelytyped/dtslint/dt.json #no-publishing-comment
…mlSectionProps (#58314)

* Update index.d.ts

Add backgroundPosition props to MjmlWrapperProps and MjmlSectionProps

* Update index.d.ts
…pe and missing props by @philipwindeyer

* [README] 🤖 Update support window diagram

https://github.com/philipwindeyer/DefinitelyTyped/actions/runs/1885659450

* add missing direction prop to MjmlGroup and MjmlSocialElement

* add mjml-html-attributes and its child types

* add missing MjmlHtml ttpe

* correct formatting

* add renderToJson types as well

* add renderToJson fns to test imports

* correct renderToJson return type

* add missing props for mj-accordion and its child components

* make tag prop optional in MjmlHtml def. revert order of props and Title/Text components

* reorder props back to original order to minimize diff

* Update types/mjml-react/index.d.ts

Co-authored-by: Ian Edington <[email protected]>

Co-authored-by: github/workflows/support-window.yml <[email protected]>
Co-authored-by: Ian Edington <[email protected]>
… in buttons by @nahtnam

* Update `mjml-react` to allow `letterSpacing`

`letter-spacing` support was added to `mjml` here: mjmlio/mjml#1732

Looking at `mjml-react`, the button (https://github.com/wix-incubator/mjml-react/blob/261d996d9fb67492bd8168caaec50a11fd5f3a25/src/mjml-button.js) calls `handleMjmlProps` (https://github.com/wix-incubator/mjml-react/blob/261d996d9fb67492bd8168caaec50a11fd5f3a25/src/utils.js#L28) with all the props. That function just proxies all the props to `mjml` which leads me to believe no change is required in the `react-mjml` library. Furthermore, I tested locally and adding a `// @ts-ignore` and providing the `letterSpacing` prop works as expected

* Update mjml-react-tests.tsx
)

* Update the readme to include updated import and Faire's announcement

* Update the announcement

* update slack link

* Apply suggestions from code review

Co-authored-by: Ian Edington <[email protected]>
@IanEdington IanEdington deleted the ian/remove-prop-types-from-build branch September 28, 2022 02:43
@IanEdington IanEdington restored the ian/remove-prop-types-from-build branch September 28, 2022 02:43
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 this pull request may close these issues.

None yet