refactor: generic function argument#10
Conversation
|
@aduth I tried to not change so much... but it was hard. The only part that doesn't seem to be working is the benchmark script. Let me know what you think. Edit: I change it to |
aduth
left a comment
There was a problem hiding this comment.
Hi again @johnhooks ! Thanks for the pull request.
Would it make the changes any easier if the package were ported fully to ES Modules, and/or if the pre-built UMD file were removed? These would be breaking changes, but I'd be open to them.
|
@aduth this is in a better state for review.
I moved it to ES Modules, and did remove the UMD builds. If that's not the direction you want to go, please let me know and I can revert it. I don't know exactly the purpose the the call to
I'm having trouble figuring out why ESLint isn't flagging semicolons. Could you take a look at it and see how your custom ESLint config is being applied and what we need to do to fix the issue? Additionally
|
We still need to remove the
The TypeScript version didn't make a difference, it was part of how I was trying to track down the issue. I don't know if the rules of your default config are being applied, when I add |
|
While testing this out with in Gutenberg this error happened. Changing FYI: It was also good to know the original issue I was trying to solve is fixed. |
|
@johnhooks Hopefully you don't mind me pushing directly to your branch. I just pushed up some commits. Would you mind taking a look over them and letting me know if you'd have any objections or if I overstepped at all? A few remarks:
|
johnhooks
left a comment
There was a problem hiding this comment.
@aduth this looks great to me and it works beautifully in Gutenberg. It should resolve a few PRs related to improving types. I made a small comment about the name in the rollup config, does it have a purpose now that it being output to dist/index.js?
My reason for changing it was to keep the name the same as the types export, it doesn't really matter but it makes sense to me for them to be named the same.
rollup.config.js
Outdated
| 'file': __dirname + '/dist/memize.js', | ||
| format: 'iife', | ||
| format: 'es', | ||
| name: 'memize', |
There was a problem hiding this comment.
I wasn't sure about this, if outputting to dist/index.js does the name properly do anything?
There was a problem hiding this comment.
Yeah, that's a good call. I think it was only needed for the IIFE version, so we can drop it now.
There was a problem hiding this comment.
That was just a comment, do you want me to remove it?
|
Thanks for another great pull request! I'll try to get this published shortly. |
|
Thank you @aduth, always a pleasure! |
|
This is published now as |
|
That's awesome! |
The current export of the types as
export =is troublesome for importing the module without enabling synthetic defaults, which isn't aways an option.Refactor the
memizefunction to be copy the parameters and return type of the input function to the output memized function.Updated a bunch of deps, added a module export, and CommonJS build output,