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

Convert layout generator to TypeScript #685

Merged
merged 14 commits into from
Jun 19, 2020
Merged

Convert layout generator to TypeScript #685

merged 14 commits into from
Jun 19, 2020

Conversation

kimadeline
Copy link
Contributor

@kimadeline kimadeline commented Jun 11, 2020

For #523

🎩 Ported the layout generator to TypeScript:

Default (JS):

layout generator with default language

JS:

layout generator example with js flag

TS (any idea on what I need to do to make the squiggles under render disappear? #689?):

layout generator example with ts flag

🚮 Cleaned up some of the unnecessary stuff I introduced when I ported the component generator.

@@ -1,4 +1,4 @@
const ${pascalName} = () => {
const ${pascalName}: React.FunctionComponent = () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want to proactively type generated components, in case people want to use FC props like children?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that would be awesome

@kimadeline kimadeline marked this pull request as ready for review June 11, 2020 23:34
@thedavidprice
Copy link
Contributor

@kimadeline Thanks again!

TS (any idea on what I need to do to make the squiggles under render disappear?):

^^ Looping in @peterp. See the TS gif example above. The import { render } from @redwoodjs/testing is throwing a lint error only for TS version.

Here's a screenshot of the error. Possibly a TS issue with the testing package itself?
Screen Shot 2020-06-11 at 5 04 19 PM

@peterp peterp self-assigned this Jun 16, 2020
@peterp
Copy link
Contributor

peterp commented Jun 17, 2020

@kimadeline Thanks for this!

@thedavidprice
Copy link
Contributor

Confirming I checked the output and there's no change from previous. So Tutorial check == ✅

@peterp when you loop back to this, wanted to make sure you saw my question above (which was in response to @kimadeline's original question) ^^

@peterp
Copy link
Contributor

peterp commented Jun 18, 2020

@thedavidprice I could not see the original question? So I'm wondering if it's still relevant @kimadeline?

@thedavidprice
Copy link
Contributor

@peterp Ah, that could be the case. If I recall correctly, is the testing package now supporting TS (and wasn't before)?

@kimadeline
Copy link
Contributor Author

@peterp The original question was

any idea on what I need to do to make the squiggles under render disappear?

Later I saw that #689 turned packages/testing/src/index.ts into a TS file, which I thought might be related (not 100% sure) 😬

@peterp
Copy link
Contributor

peterp commented Jun 18, 2020

Sweet! Hopefully that solved it, we're going to release v0.11.0 soon, but I'll get this merged in time for v0.12.0

@peterp peterp changed the base branch from master to main June 19, 2020 15:32
Copy link
Contributor

@peterp peterp left a comment

Choose a reason for hiding this comment

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

Works great!

@peterp peterp merged commit b317d44 into redwoodjs:main Jun 19, 2020
@thedavidprice thedavidprice added this to the next release milestone Jun 19, 2020
@kimadeline kimadeline deleted the convert-layout-ts branch June 19, 2020 16:57
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.

None yet

3 participants