-
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 typescript declaration files for all public APIs #247
Conversation
(Subset of #172) |
@janpieterz Thanks for submitting a PR in our SDK and we really appreciate your contribution. Our team reviewed your PR and it looks like you are adding typescript definition only in Analytics module. For this to be consistent across, all the modules - appcenter, appcenter-push, appcenter-crashes should have the definitions as well. |
We would also need to make a Typescript version of TestApp before merging to validate the files. |
I'll tackle the Would you prefer me tackling those all at once or pushing the definitions out per package so we keep the stuff to review small? |
If we merge 1 by 1 then the target branch cannot be develop and we can create another hosting branch. Github offers incremental reviews since last time so it's not a problem for me as long as commits for TestApp are separated from the SDK changes it should be ok. |
Changes on analytics are ok so far. |
Should have all typings now, let me know what's wrong and I'll fix it, then move on to the TestApp. |
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.
We would need a test app in same pr to validate the changes. Minor comments otherwise.
Nice progress on this 👍
Looks good, now we would need a clone of the testapp we have in the repo but in typescript version to validate all the changes. |
Great stuff, will start tackling that. |
@guperrot Made some progress with the test app. Couple of questions:
|
TestAppTypescript/android/app/src/main/java/com/testapptypescript/MainApplication.java
Outdated
Show resolved
Hide resolved
Replies to #247 (comment)
I made a first quick review for changes on TestApp and need some fixes before I can deeply review and test. |
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.
Copying comment as github collasped it and link does not work: #247 (comment)
Like in TestApp, make sure firebase is integrated: https://docs.microsoft.com/en-us/appcenter/sdk/push/migration/react-native-android.
When the procedure asks to download google-services.json, pick https://github.com/Microsoft/AppCenter-SDK-React-Native/blob/develop/TestApp/android/app/google-services.json instead and make sure your app has the same package name as TestApp.
@guperrot Google Services added, not sure what else there is atm. |
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.
No matter how I git clean -xdf
and npm cache clean --force
, when I checkout this branch, run ./update-npm-package.sh
and react-native run-android
, the JS server fails to bundle and thus the app is broken:
error: bundling failed: Error: Unable to resolve module `./artifacts/index` from `/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/index.js`: The module `./artifacts/index` could not be found from `/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/index.js`. Indeed, none of these files exist:
* `/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/artifacts/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
* `/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/artifacts/index/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json)`
at ModuleResolver.resolveDependency (/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:158:865)
at ResolutionRequest.resolveDependency (/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:92:16)
at DependencyGraph.resolveDependency (/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/node-haste/DependencyGraph.js:271:4465)
at dependencies.map.relativePath (/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/DeltaBundler/traverseDependencies.js:379:19)
at Array.map (<anonymous>)
at resolveDependencies (/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/DeltaBundler/traverseDependencies.js:378:16)
at /Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/DeltaBundler/traverseDependencies.js:203:33
at Generator.next (<anonymous>)
at step (/Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/DeltaBundler/traverseDependencies.js:296:307)
at /Users/guperrot/git/appcenter-sdk-react-native/TestAppTypescript/node_modules/metro/src/DeltaBundler/traverseDependencies.js:296:467
BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
Please look into this so we can review this PR, none of the search results on Google were helpful for this issue.
The same problem exists for ios.
I'm not sure it's truly the fix for that latest 'bundling' error, but I used to get it when just running the normal react-native android or ios on RN 0.54 or 0.55. But then I would run a separate |
I already tried npm run start as separate but it didn't change anything, same error. |
@guperrot This is because you're not running the Typescript compiler first. You're welcome to change the commands to something more to your liking, running There should be commands for |
|
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.
Tested everything and found some problems, nice job otherwise and looking forward to merging soon after the requested changes 👍
Please also copy .vscode/launch.json
from TestApp
to this app and commit it.
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 typescript declaration files for all public APIs #247 (comment) for Push.
- Please also copy .vscode/launch.json from TestApp to this app and commit it.
- Add typescript declaration files for all public APIs #247 (comment)
- Add typescript declaration files for all public APIs #247 (review)
@guperrot Should all be fixed. |
@janpieterz thanks for this huge contribution 👍 |
Hey @janpieterz, I want to say a big thank you! Your contribution is highly appreciated. 👍 Thanks, |
Thanks for the help gents, happy we landed it :) |
Let me know if this is appreciated, I can add types for the other packages too.