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

fix type declaration with "bundler" moduleRes #47

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

danirdd92
Copy link
Contributor

Hi @jonathanlurie

following up on our conversation with my last issue regarding type discoverability,
I did some research and found some mistakes we've made regarding the issue.

Vite's default module resolution is set to "bundler" which comes with typescript 5.0, source.
it is not legacy and should be the way forward.

some other maintainers have encountered this issue, and solved it

I have attempted the same solution from source and it worked like a charm.
in regard to backwards compatibility, I have, of course, left everything else like it was although it seems to introduce some duplication.

@jonathanlurie
Copy link
Collaborator

Hello @danirdd92 ,
thanks for looking into this! I will test this in different bundling conditions (Vite, Rollup, NextJS, etc.)! Thanks for the links as well!

@danirdd92
Copy link
Contributor Author

@jonathanlurie hi, any update on the matter? it could pose a problem especially with ci

@danirdd92
Copy link
Contributor Author

Hi, I'm pinging this again, this PR could really help for CICD when pulling the package.

@navidevongit2
Copy link

Just came here to create this very same merge request, but I see danirdd92 already was first here. I use exactly the same code like him and I can confirm this makes Maptiler-SDK conform with TypeScript 5 and module resolution with bundler.

Copy link

@navidevongit2 navidevongit2 left a comment

Choose a reason for hiding this comment

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

Everything fine, works with TypeScript 5 and module resolution with bundler.
I came up with the same solution independently of the author, which proves somehow its correctness.

@jonathanlurie
Copy link
Collaborator

Hey @danirdd92 @navidevongit2 , after some more tests, it looks fine to do bundler. We are currently working on v1.2.0 that should be released within the next week or two and we'll add the bundler setting as part of it.
Thanks for you patience!

@LoiKos
Copy link

LoiKos commented Oct 17, 2023

Hey,

These changes on types are working but you also need to do the same changes on @maptiler/client in order to make client re-exported api correctly typed.

@toniopelo
Copy link

@LoiKos I did the follow-up PR on the @maptiler/client package as mentioned above
@jonathanlurie The client part should probably be merged and released before this one so the sdk can take the fixed client version in its package.json to get all the types working at once :)

@pr0ton
Copy link

pr0ton commented Oct 22, 2023

It'd be great if this is merged and released soon. The advertised typescript support is unusable on newer node versions because of this.

@jonathanlurie
Copy link
Collaborator

@toniopelo yes, definitely going to update the Client lib first, thanks!

@toniopelo
Copy link

I've hit this issue again, this should be merged and released no @jonathanlurie ? Or something is blocking this ?

@jonathanlurie
Copy link
Collaborator

Hey @toniopelo , no major blocker, but on our side we are preparing the v1.2 release and this involves doing fairly deep code reviews. We plan to merge this very PR the last because we have tested it locally and it's no longer causing issues.
We are targeting next week for the release, thanks for your patience! (the SDK team is a small team)

@jonathanlurie jonathanlurie merged commit 41e7436 into maptiler:main Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants