-
Notifications
You must be signed in to change notification settings - Fork 80
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
5.2.0
introduces a breaking change
#116
Comments
Arg, painful. PR welcome or I'll need to rollback. @TrySound what do you think we should do here? |
It feels like we cannot win with the imports 😅 |
Also, @TheKas what do you think we should do here? |
If the current common situation is the ideal situation, but we think it is a breaking change: I am happy to deprecate 5.2.0 and release a 6.0.0 |
I'm happy to deprecate 5.2.0 for now while we decide if people think that is best |
You can do ugly and use module.exports in sources |
Is the current 5.2.0 commonjs setup what we want to carry forward into 6.0.0? |
Yeah, looks fine to me. I tend to avoid umd these days. ESM in browser is good enough alternative. |
Ideally, people would not need to change their existing memoize-one commonjs usage for 6.0.0. I am not sure why the changes in 5.2.0 would have broken bundlers. netlify/cli#2202 |
Because rollup produces "module.exports = () => {}" when only default export is present by default. When named export is added it produces "exports.default;exports.named". The latest rollup version requires this configuration (exports: default | named) explicitly with warning. |
Okay. How do you think we should proceed? rollback named import support for 5.x and just use the default? |
This is the plan unless there are objections:
I'll do these steps in a few hours |
@ehmicky the addition of a named import in https://github.com/alexreardon/memoize-one/releases/tag/v5.2.1 |
@JGAntunes I created a PR to |
Thanks for fixing all of this @alexreardon I am wondering whether it might have been better for > memoizeOne
<ref *1> [Function: memoizeOne] {
default: [Circular *1],
memoizeOne: [Circular *1]
} This would have made However, now that this has been released in That being said, thanks a lot for being so proactive on this issue and for opening a PR in our repository ❤️ |
Also don't be afraid to release a 6.0.0! Cleaning the duplicated import makes sense. |
With this issue, there were no great options. Sometimes we are choosing between bad options.
Unfortunately, there were no good options for consumers. Keep in mind that if consumers continued to use their existing code which used the default import on Some options:
→ I am open to charting a different course here. I thought the approach I took was the least harm. The only other path I think we could take is release |
I'm open to releasing a
I'm keen to know what others think |
My thoughts... Do this:
Then make the change which alters the export.
|
Just to ensure shared understanding:
I have no good solution to allow a named import right now @jesstelford. The strategy @ehmicky might work, but it would take a good amount of time to validate well. So releasing a 6.0.0 would simply be a guard for people on 5.2.0 that they would need to modify their code to move to 6.0.0 (which does seem worthwhile) |
So the current problem is that some people did upgrade to So it feels like we might have to deprecate |
I'm now pretty convinced doing a |
I will aim to do this pretty soon if I can. I'm just waiting for more input to validate this is the correct course of action. @danieldelcore and I think this is the right approach, but I want to get somebody else's thoughts before proceeding |
I say you leave it as-is right now:
Edit to add: 40hrs isn't long for folks to have upgraded their imports. Those who have can easily revert their commits. Sucks for them, but that's the nature of software development. If they can upgrade to For those with dependabot setup, they'll get the I would definitely classify this as a bug because it broke behaviour in a minor release. But you fixed it in a patch release. @alexreardon you semver'd correctly 👍 |
Yep, my stance on this is very similar to @jesstelford and @ehmicky . Stuff like this happens from time to time - we need to be pragmatic here, the current versions are OK - and whoever has adjusted their code already with the named export in mind... can just revert their changes (there shouldn't be that many of such people anyway). Semver is just a human-based guideline anyway - somebody's bug fix is always somebody's breaking chance if we consider software at scale so it's not worth stressing things like this too much. |
Hi, I made a wrong comment #117 (comment) and @alexreardon inferred that I was in this situation. This is not true, don't bother keeping the broken 5.2.0 |
Okay, based on feedback I think I have acted correctly and followed SemVer. I will close this issue for now. This whole issue was super stressful! The last thing I want to do is cause anybody friction in their consumption. Thanks everybody for your input |
The
5.2.0
release accidentally introduced a breaking change when using CommonJSrequire()
.5.1.1
:5.2.0
:The text was updated successfully, but these errors were encountered: