-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(tilesets): Support widget calculations on tilesets #50
Conversation
82c8732
to
2370ee5
Compare
9affa4f
to
d7ff039
Compare
f9e9120
to
9070e96
Compare
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.
Great job @donmccurdy. Some small comments, can you take a look?
@@ -0,0 +1,6 @@ | |||
export * from './Filter.js'; |
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.
Should we export the ts
files instead of js
files? I mean
export * from './Filter.ts';
instead of
export * from './Filter.js';
I've notice other exports like this in other places like https://github.com/CartoDB/carto-api-client/blob/main/src/index.ts#L1
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 can't do .ts
I think, the build process would have to rename the imports in .d.ts
files to .js
at build time, and TypeScript has for a very long time been against allowing that:
The filenames are supposed to be paths that can be resolved after TypeScript compilation, so we are stuck with either ./Filter
or ./Filter.js
. Currently the codebase has a mix of both ... so that is not great, I would like to clean it up to be consistent, I'll do that in a new PR. 😅
While I'm happy with either in an app like Builder, I think that for libraries we may need to use .js
, because that's what should appear in the published .d.ts
files. It's required for customers using certain configurations, particularly moduleResolution: 'nodenext'
. I've had this feedback in some of my personal repositories in the past, discussion here:
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.
For now I've opened a new issue to track this:
I'll wait to make the changes until after this PR and the raster PR are merged, so we don't have a bunch of merge conflicts.
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.
@donmccurdy, why don't we export the file without the extension as Deck.gl does? https://github.com/visgl/deck.gl/blob/master/modules/core/src/index.ts#L90 I mean
export * from './Filter';
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.
So deck.gl is using ... from './Foo'
in source files, but they've written a special build step that adds the .js
extension to the generated .d.ts
files:
Added in:
Admittedly putting the .js
extension in source code is weird/ugly... but without customizing the build process I don't know of another way to solve that problem for customers. Another option would be to bundle the .d.ts
files into one file, so there are no imports in the output, but that will complicate the build step and I haven't found a build setup that I trust for that yet. 😕
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.
Thank you for your comments. I've approved the PR but please check this comment #50 (comment)
9070e96
to
98664a1
Compare
Changes: