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

TypeScript infrastructure #2206

Merged
merged 5 commits into from
Jul 3, 2020
Merged

TypeScript infrastructure #2206

merged 5 commits into from
Jul 3, 2020

Conversation

dsevillamartin
Copy link
Member

@dsevillamartin dsevillamartin commented Jun 21, 2020

Will probably want to include some shims

Old example shims in WIP rewrite branch

https://github.com/flarum/core/blob/4c8af1cdf876b9bd3770f76c33eb6c9ac80608f0/js/webpack-flarum-shims.d.ts#L7-L17

https://github.com/flarum/core/blob/4c8af1cdf876b9bd3770f76c33eb6c9ac80608f0/js/shims.d.ts#L3-L7


@askvortsov1
Copy link
Sponsor Member

askvortsov1 commented Jun 21, 2020

@datitisev perhaps we should have this PR be just the setup of Typescript infrastructure, and follow up with the actual typescript changes in a second PR? And merge the first one in now?

Also, agree about putting in the shims 👍

@dsevillamartin
Copy link
Member Author

dsevillamartin commented Jun 21, 2020

@askvortsov1 Ok, done.

EDIT: I won't put the shims here. They aren't necessary (though they do help with typings, but more when typing Mithril stuff so lets wait for mithril v2 there maybe? idk)

@dsevillamartin dsevillamartin changed the title Start converting to TypeScript TypeScript infrastructure Jun 21, 2020
@franzliedke
Copy link
Contributor

Thanks, looks good! Can we undraft this to get it merged?

Just one question: what's the purpose of @babel/plugin-syntax-dynamic-import?
Okay, I kinda understand that from its description on NPM, but how is it related to TypeScript?

@dsevillamartin
Copy link
Member Author

I... don't know what that does. I copied it over from my Mithril branch. Looking at the babel docs for that package did not help in understanding. I think it has something to do with import() functions (not import statements) returning Promises..?

@franzliedke
Copy link
Contributor

Yeah, those allow you to import scripts at runtime, I don't think that's needed for TypeScript at all. Please remove that, then we can merge. 🤗

@franzliedke franzliedke marked this pull request as ready for review July 3, 2020 12:40
Copy link
Contributor

@franzliedke franzliedke left a comment

Choose a reason for hiding this comment

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

Thanks a lot! TS-ing "comon" and "admin" should now be safe. (One file in "common" is changed in #2161, but we will manage.)

@franzliedke franzliedke merged commit d189272 into master Jul 3, 2020
@franzliedke franzliedke deleted the ds/typescript branch July 3, 2020 12:47
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.

3 participants