-
Notifications
You must be signed in to change notification settings - Fork 136
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 in fusionConfig: jsExtPattern, resolveExtensions (enable typescript) #411
base: master
Are you sure you want to change the base?
Add in fusionConfig: jsExtPattern, resolveExtensions (enable typescript) #411
Conversation
|
bc8c284
to
1af5ddb
Compare
71fdfb1
to
0ae280d
Compare
4ce9f0f
to
ee0b7e9
Compare
fusion-cli/docs/fusionrc.md
Outdated
|
||
```js | ||
module.exports = { | ||
jsExtPattern: \[jt]sx?$\, |
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.
Should this be forward slashes?
fusion-cli/docs/fusionrc.md
Outdated
|
||
## `resolveExtensions` | ||
|
||
By default this is webpack default witch is: `['.wasm', '.mjs', '.js', '.json']` |
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.
Spelling: witch
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.
Grammar nitpick:
By default this is the Webpack default which is:
fusion-cli/docs/fusionrc.md
Outdated
|
||
By default this is `/\.jsx?$/` | ||
|
||
For example, this enables to handle typescript files with addition to Babel plugins/preset: |
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.
Grammar nitpick:
For example, this enables Typescript support by adding the appropriate Babel preset:
any update for this PR? really need typescript support |
I'll try to update this PR this week. Regarding those changes they do not cover running tests of typescript files. We have it working out of our own fork. I could update this PR with those changes or should I propose separate PR ? |
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.
Bump FYI @Monar
ee0b7e9
to
be48fc1
Compare
I was a little bit overload recently, but here I am back to work with this PR. This change also incorporates minimal changes that allows us to have tests up and running for typescript code base. |
: process.env.TEST_REGEX || | ||
(process.env.TEST_MATCH || '**/__tests__/**/*.js').split(','); | ||
(process.env.TEST_MATCH || `**/__tests__/**/*${testFileExt}`).split(','); |
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'm not sure using testFileExt
will work within a glob here since jsExtPattern
is regex
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.
Yep you are right, I'll address this, there will be case where source out of regexp wont work. Good catch thx, I've overlooked this.
dd89df7
to
5e57cef
Compare
This change is enabling test configuration for typescript projects.
5e57cef
to
b404074
Compare
!import Edit: Opening a mirrored internal PR. |
This pull request has been imported. If you have access to the parent repo, you can view the imported change here. |
A canary release ( |
Thank you @Monar for the contribution and thanks to @AlexMSmithCA for cutting the canary release. My team has been using it for our migration from Flow to Typescript and that has been very useful. One small thing to note - |
|
||
```js | ||
module.exports = { | ||
jsExtPattern: /[jt]sx?$/, |
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.
Add a dot before [jt]
please.
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 don't know what should be a flow now, as this PR was forked (imported) to the internal github repository... is updating this PR still something valuable ? @AlexMSmithCA
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.
Feel free to make these changes in this PR. We can re-import any additional commits once this has been fully reviewed.
|
||
```js | ||
module.exports = { | ||
resolveExtensions: ['.wasm', '.mjs', '.js', '.json', '.ts', '.tsx'], |
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.
Add the following to enable Typescript-compatible tests.
jest: {
globFileExt: '!(.d).(ts|tsx)'
}
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 don't know what should be a flow now, as this PR was forked (imported) to the internal github repository... is updating this PR still something valuable ? @AlexMSmithCA
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.
(See above)
I just now found this PR and realized there's some overlap with the PR I'm working on #736. As this PR is much nicer in terms of changing the file extensions I'd like to build upon this and then add the ability to override the entry point on top. What's the procedure here? It's kind of hard to know what to expect if part of the work is being done behind closed doors. What needs to happen for this to land on the master branch on this public repo? |
This is change proposed in here: fusionjs/fusion-cli#705
We are using typescript with fusionjs for last 3 month and its working smoothly, this is minimal (generic) change that allows to embrace typescript for the app code.