-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor!: move import progress from HTTP API to JS API #125
Conversation
This is the next step in [a larger refactor][0] where we replace the HTTP API with a JS one. [0]: #111 BREAKING CHANGE: `GET /imports/progress/:importId` replaced with `getImportProgress()`
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 converted this file to TypeScript because of the following problem:
- The external API now depends on
PortMessage
. - Therefore, the external API needs to import
PortMessage
. dist/lib/mbtiles_import_worker.d.ts
is the compiled version ofsrc/lib/mb_tiles_import_worker.js
and src/lib/mb_tiles_import_worker.d.ts` is lost.
I might have been able to solve this another way, such as duplicating (or moving?) the types elsewhere. However, I think this is a good solution given that the rest of the repo already uses TypeScript.
@@ -18,7 +18,7 @@ exports.createFastifyServer = createFastifyServer | |||
|
|||
/** | |||
* @param {import('tape').Test} t | |||
* @returns {import('../../src/map-server.ts')} | |||
* @returns {ReturnType<import('../../src/map-server.ts')>} |
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.
Not strictly related, but fixes these types.
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.
Yeah I think it should technically point to app.ts
, which is where createMapServer()
is imported from. What you have here returns the same thing though
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 stuff! left a few comments but nothing noticeably blocking
@@ -18,7 +18,7 @@ exports.createFastifyServer = createFastifyServer | |||
|
|||
/** | |||
* @param {import('tape').Test} t | |||
* @returns {import('../../src/map-server.ts')} | |||
* @returns {ReturnType<import('../../src/map-server.ts')>} |
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.
Yeah I think it should technically point to app.ts
, which is where createMapServer()
is imported from. What you have here returns the same thing though
This is the next step in a larger refactor where we replace the HTTP API with a JS one.