Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
add TS support for storybook preview tsx config extension #9309
add TS support for storybook preview tsx config extension #9309
Changes from 19 commits
120702e
d5b9929
26cb17f
737feba
2fabf18
2ca7f25
a20e396
3953f32
a373973
1e3bf75
1904f2a
b57d724
19b6d79
8a292c0
bc74dcf
3f713a4
40aabfd
a476d18
2c5e9d0
6e124df
36a0323
de828f0
44bdd24
b1926bb
79ef0f0
a0f91f6
a91cc77
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind elaborating what this change was for please? I don't really have context, so hard to figure out :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah got it. So questions here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is necessary because
preset-react
won't work with TS files.Without the filename I get this error on the Redwood project. You're right about
@babel/preset-react
- it's not neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, so I think this will fail when using
.js
files, because preset-typescript will only parse jsx when https://babeljs.io/docs/babel-preset-typescript#istsx is forced to true. I'm not 100% sure because of how themerge
is being used.My suggestion here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested both ts and js projects manually, everything's working. I'll add unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh... maybe because the filename has
.tsx
in it, it automatically enables JSX parsing!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have an idea what tests to write? Merge two files and test that the merged file has contents of both files? I.e.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the key thing to check would be that one of the files being merged having JSX in it.
Maybe the easiest way to test it would be to take a snippet of what you're actually merging and just have it as a test. The primary motivation here would be to prevent regression :)
This file was deleted.