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

Move Typescript configuration to webpack config from core #11

Merged
merged 1 commit into from
May 12, 2021

Conversation

davwheat
Copy link
Member

This PR enables Typescript support on extensions by shifting the temporary setup from flarum/core to this repo.

tsconfig.json is provided using the new flarum/flarum-tsconfig repo.

This is largely based on @datitisev's draft PR (#3).

Fixes flarum/framework#2343

@davwheat davwheat self-assigned this May 12, 2021
@davwheat davwheat requested a review from askvortsov1 May 12, 2021 00:11
@davwheat davwheat mentioned this pull request May 12, 2021
return entries;
})(),
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
Copy link
Sponsor Member

@askvortsov1 askvortsov1 May 12, 2021

Choose a reason for hiding this comment

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

Why json? Approved since this was in the other PR too, so I assume there's a good reason

Copy link
Member Author

Choose a reason for hiding this comment

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

Webpack/Babel can cleanly handle the importing of JSON.

This could be useful for an extension that wanted to load a large dataset and modify the frontend using that data.

Maybe some data exported from another system which is then used to add a page to the forum, like a leaderboard for a game server?

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Fair enough

return entries;
})(),
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Fair enough

@askvortsov1 askvortsov1 merged commit 3cdb9c1 into master May 12, 2021
@davwheat davwheat deleted the dw/add-typescript branch May 12, 2021 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support TypeScript in extensions
2 participants