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

Add in fusionConfig: jsExtPattern, resolveExtensions (enable typescript) #411

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Monar
Copy link
Contributor

@Monar Monar commented May 22, 2019

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.

@fusionjs-bot fusionjs-bot bot added the docs label May 22, 2019
@CLAassistant
Copy link

CLAassistant commented May 22, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ Monar
❌ AlexMSmithCA
You have signed the CLA already but the status is still pending? Let us recheck it.

@Monar Monar force-pushed the enable-modification-of-webpack-test-pattern branch 2 times, most recently from bc8c284 to 1af5ddb Compare May 23, 2019 07:57
@Monar Monar force-pushed the enable-modification-of-webpack-test-pattern branch from 71fdfb1 to 0ae280d Compare May 30, 2019 14:00
@Monar Monar force-pushed the enable-modification-of-webpack-test-pattern branch 2 times, most recently from 4ce9f0f to ee0b7e9 Compare June 20, 2019 21:27

```js
module.exports = {
jsExtPattern: \[jt]sx?$\,
Copy link
Contributor

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?

lhorie
lhorie previously approved these changes Jul 9, 2019

## `resolveExtensions`

By default this is webpack default witch is: `['.wasm', '.mjs', '.js', '.json']`
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling: witch

Copy link
Contributor

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:


By default this is `/\.jsx?$/`

For example, this enables to handle typescript files with addition to Babel plugins/preset:
Copy link
Contributor

@derekju derekju Jul 9, 2019

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:

@futurist
Copy link

any update for this PR? really need typescript support

@Monar
Copy link
Contributor Author

Monar commented Jul 22, 2019

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 ?

Copy link
Member

@AlexMSmithCA AlexMSmithCA left a comment

Choose a reason for hiding this comment

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

Bump FYI @Monar

@Monar Monar force-pushed the enable-modification-of-webpack-test-pattern branch from ee0b7e9 to be48fc1 Compare November 13, 2019 13:34
@Monar
Copy link
Contributor Author

Monar commented Nov 13, 2019

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(',');

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

Copy link
Contributor Author

@Monar Monar Nov 19, 2019

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.

@Monar Monar force-pushed the enable-modification-of-webpack-test-pattern branch 2 times, most recently from dd89df7 to 5e57cef Compare November 19, 2019 15:30
This change is enabling test configuration for typescript projects.
@Monar Monar force-pushed the enable-modification-of-webpack-test-pattern branch from 5e57cef to b404074 Compare November 19, 2019 23:18
@AlexMSmithCA
Copy link
Member

AlexMSmithCA commented Dec 26, 2019

!import

Edit: Opening a mirrored internal PR.

@fusionjs-sync-bot
Copy link

This pull request has been imported. If you have access to the parent repo, you can view the imported change here.

@AlexMSmithCA AlexMSmithCA reopened this Dec 26, 2019
@AlexMSmithCA
Copy link
Member

A canary release (0.0.0-canary.39fc7dc.0) has been cut with these changes. I haven't played around with it yet though, but it should avoid having to fork + re-release this for now.

@amarinov
Copy link

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 - jsExtPattern should start with a dot jsExtPattern: /\.[jt]sx?$/ as that is being appended in testPathIgnorePatterns.

ajbogh
ajbogh previously approved these changes Jan 28, 2020

```js
module.exports = {
jsExtPattern: /[jt]sx?$/,
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Member

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'],
Copy link
Contributor

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)'
}

Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

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

(See above)

@pheew
Copy link

pheew commented Apr 22, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet