-
-
Notifications
You must be signed in to change notification settings - Fork 859
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
fix: changed index.d.ts imports to reference typescript definitions instead of ts files #2529
Conversation
…nstead of ts files Fixes rnmapbox#2528
@mattijsf thanks much. Does our the example app still works without the |
Ah that is a good one. I guess it might not without running bob build first... |
This requires more work I'm afraid. Good to have these checks in place! |
This change causes the type checking to happen on the actual generated definition files instead of the inferred javascript types which is generating some extra errors. I'm trying to fix those but it not so easy in some cases. For example. Here and there we tend to use |
…tationManager which does not include id
|
||
return ( | ||
<PointAnnotation | ||
id={id} | ||
coordinate={coordinate} | ||
title={title} | ||
draggable | ||
onDrag={(feature: Feature<Point, { id: string }>) => |
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.
The id
currently not sent by PointAnnotationManager
so I removed it from the typescript definitions.
coordinate: [number, number]; | ||
coordinate: number[]; |
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.
I like the tuple typing in theory but in practice libs like geojson offer points as number[]
and these can't be assigned to [number, number]
so it ends up being more of a burden.
For me it worked fine after the above changes within the example project because the |
Yep but switching git branches, etc. doesn't rerun the |
Ah yes that could be causing some annoyances. I'm not sure on how to solve that problem properly except for migrating all javascript files to typescript more quickly but that is not feasible either. Ideas? |
# Conflicts: # index.d.ts
79ed03f
to
6737b38
Compare
With #2663, we should be really good with js => ts conversion. Then what remains are those:
so we're close to removing index.d.ts |
Looks like good progress! I think Actually, I started migrating some files some time ago here: https://github.com/mattijsf/rnmapbox-maps/tree/typescript-migration I did do |
I think we can close this PR in favor of the gradual migration of JS > TS and no longer needing index.d.ts. Which should ultimately fix #2528 |
Fixes #2528