-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: TypeScript declaration for lib/core/s3; add retry option #1989
base: master
Are you sure you want to change the base?
fix: TypeScript declaration for lib/core/s3; add retry option #1989
Conversation
cc8658a
to
af39cae
Compare
@SinghSukhdeep can you take a peek at this? |
@rnicholus Sure I'll take a look |
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 will take another deeper look soon. Following is what I've noticed so far.
/** | ||
* RetryOptions | ||
*/ | ||
retry?: RetryOptions; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
client/typescript/fine-uploader.d.ts
Outdated
/** | ||
* Retry options | ||
*/ | ||
retry?: UIRetryOptions & RetryOptions; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -1,3 +0,0 @@ | |||
"use strict"; | |||
|
|||
module.exports = require("../fine-uploader/fine-uploader"); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We should also update the azure module similarly as that is also missing the core module declaration. |
@bradleyayers Just wanted to check your thoughts on possibility of |
@SinghSukhdeep I've pushed up a couple of commits attempting to add |
@SinghSukhdeep let me know if you're aware of any other issues, else I think this is good to go. |
client/typescript/fine-uploader.d.ts
Outdated
@@ -2691,6 +2693,14 @@ declare module "fine-uploader" { | |||
|
|||
} | |||
|
|||
declare module "fine-uploader/lib/all" { | |||
import { azure } from 'fine-uploader/lib/azure'; | |||
export * from 'fine-uploader/lib/core'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Hey sorry I was away for couple days. I think it all looks great except for one line I mentioned above |
@rnicholus this should be good to go. |
Everything looks fine here, but I'm not sure I understand the documentation changes. You shouldn't have to explicitly reference an index.js file when importing a module, unless I'm missing something. If that is the case here, then this would be a very significant breaking change, and we'll have to figure out how to update the code to prevent that. |
Fair call, this might be better suited for |
Is it really necessary to reference index.js directly? I’ve never had to do that myself. |
The file extension references are only for the bundler configurations, which I don't have direct experience with (e.g. rollup). Nothing will change with respect to standard JavaScript imports. |
So, does this there are no breaking changes then? |
"Breaking change" is a subjective term, so I think this boils down to being a judgment call. I'm happy to call this not a breaking change, even though if people are relying on exact file locations for custom build configurations they'll need to make some changes when upgrading. If you'd rather err on the side of calling that a breaking change, then I can target this to Without an unambiguous definition for breaking change this decision just needs to be a judgement call made by a maintainer. |
If any user using the library in an expected/documented manner needs to adjust their code to upgrade, then the version contains breaking changes, and that must always be avoided in minor or patch releases, per semver spec. I’ll take a closer look at these changes soon to better determine if the documentation changes are necessary and if any breaking changes are present or necessary. |
Just to weigh in, we only need to specify file extensions for module loaders like SystemJS (not sure about Webpack) and module bundlers like Rollup (again not sure about Webpack). So only a slight modification is required in the bundler/loader configs. And in our |
@SinghSukhdeep does |
I think i'm ok with this provided the documentation changes are reverted. But I do want to do a bit of manual testing myself first. Thanks both of you for all of your hard work. |
Reverting the documentation changes would also require reverting the code changes that move |
I’m personally fine with just leaving the docs as-is (before any changes). It’s common to use the index.js pattern (I’m using it in several closed and open source projects) and I’ve never seen docs explicitly reference the index file. |
I’m fairly certain everything will just work without making any code changes in webpack environments. I’ll have to confirm though. But if indeed this does break for users of rollup, then without reverting the breaking code changes, this will have to sit and wait to go out with 6.0 |
To ensure we don't break backwards compatibility, can't we just keep the traditional.js, s3.js, etc files? |
Yeah I considered that, but I wasn't sure if the module resolution spec includes whether to try directory or file first when resolving. It seemed like a risky approach that could be broken in the future. It's probably worth checking though. |
Well, if both /traditional/traditional.js and traditional/index.js point to the same location, there shouldn't be an issue, unless I'm missing something. We could eliminate traditional.js in 6.0, but this allows us to ensure there are no breaks in 5.x. |
I'm assuming that for |
I've tested this and leaving the |
Hi @bradleyayers are you still pursuing this PR. We did a lot of work on this and it would be great if we could merge this. |
@SinghSukhdeep I'm not actively working on it, but I am still using my FineUploader fork in production (it includes this change + using native promises), so I'm still invested in seeing this succeed. |
Awesome! |
Brief description of the changes
lib/core/s3
.retry
option toFineUploaderBasic
.Resolves #1988.
Extra
package.json
files have been added tocommonJs
to associate types with nested modules, this follows the pattern used by date-fns.What browsers and operating systems have you tested these changes on?
n/a
Have you written unit tests? If not, explain why.
fine-uploader.test.ts
has been extended.