Skip to content
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

Change the extension of generated files to .gen.tsx (TS) and .gen.js (Flow/Untyped).#90

Merged
cristianoc merged 4 commits into
masterfrom
change_generated_file_extension
Nov 9, 2018
Merged

Change the extension of generated files to .gen.tsx (TS) and .gen.js (Flow/Untyped).#90
cristianoc merged 4 commits into
masterfrom
change_generated_file_extension

Conversation

@cristianoc

Copy link
Copy Markdown
Collaborator

Test a breaking change to the extension of generated files.

Change the extension of generated fies to make it uniform across TypeScript and Flow, and independent from webpack plugins.

No need for a special webpack plugin to read .re.js files instead of .re files.

No difference in instructions to specify the current file in bs.value with TypeScript of Flow/Untyped.

Test a breaking change to the extension of generated files.

Change the extension of generated fies to make it uniform across TypeScript and Flow, and independent from webpack plugins.

No need for a special webpack plugin to read `.re.js` files instead of `.re` files.

No difference in instructions to specify the current file in `bs.value` with TypeScript of Flow/Untyped.

@jchavarri jchavarri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉 This is great!

{
loader: "extension-replace-loader",
query: {
exts: [{ from: ".re", to: ".re.js" }]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is removing this loader possible because the new .regen extension has more than 2 characters? I was thinking .gt would be smaller and more representative of genType, just curious if there is any technical reason for picking the 5 chars name :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No special reason, the name of the extension is open. The only problem was "re.js" without ".js" becoming ".re" and confusing webpack.

@cristianoc cristianoc changed the title Change the extension of generated files to .regen.js and .regen.tsx. Change the extension of generated files to .gen.tsx (TS) and .gen.js (Flow/Untyped). Nov 8, 2018
@cristianoc
cristianoc merged commit b64480f into master Nov 9, 2018
@cristianoc
cristianoc deleted the change_generated_file_extension branch November 10, 2018 09:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants