Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

fix: cache in item instead of entity #470

Closed
wants to merge 7 commits into from

Conversation

akloeckner
Copy link
Contributor

@akloeckner akloeckner commented Oct 12, 2020

fixes #464
fixes #425

@rchl , I have changed eslint to accept the ?? operator as of ECMA Script 2020. It transpiles just fine. But I am not aware of the issues this might cause on the rest of the linting.

Explanation of that operator:
https://github.com/tc39/proposal-nullish-coalescing

PS: Regarding the breaking change below, we should take a short time and think about which order is more suitable def ?? attrs or attrs ?? def. I tend to think now that def should have priority, because it is user-defined.

BREAKING CHANGE: The order of attrs and def is changed for a few sliders. This should not normally be a problem, because the user would only use one of the possibilities. But... just to give note on that.

this change also makes this the default for a few other funtions, namely sliders.

fixes resoai#425

BREAKING CHANGE: The order of attrs and def is changed for a few sliders. This should not normally be a problem, because user would only use one of the possibilities. But... just to give note on that.
This fixes resoai#464

The solution uses the new nullis coalescing operator `??`.
It's just like `||`, but it allows `0` as output.
Babel traspiles this just fine.
I had to update ESLINT config to use ECMA 2020. Not sure, what are the side effects. @rchl
@rchl
Copy link
Collaborator

rchl commented Oct 12, 2020

@rchl , I have changed eslint to accept the ?? operator as of ECMA Script 2020. It transpiles just fine. But I am not aware of the issues this might cause on the rest of the linting.

That's fine. It only affects linting.

Did you mean to include all those changes in this PR?

@akloeckner
Copy link
Contributor Author

Did you mean to include all those changes in this PR?

It was kind of the same "issue" for me. As you can see, I did the first version of most of the changes in the very first commit...

We could split in three, but it will be some work:

  • fix the background to use cacheInItem
  • consolidate the sliders to use it as well
  • fix the zero-value-error.

Do you prefer that?

@rchl
Copy link
Collaborator

rchl commented Oct 12, 2020

So...

I would be fine with multiple semi-related commits but then I'd avoid squashing all commits together on merging so that they are listed separately in changelog and history. But in this case, those separate commits are not really arranged or formatted properly as you've added something in one commit to remove or change it later. And some commits don't have a summary that follows conventional commit convention.

Basically, when looking at individual commits from oldest to latest, each should be a self-contained change that can work on its own.

So if you think cleaning that up is too much work, then I'd rather squash the changes but I wouldn't want to squash those two separate fixes together so I'd ask you to at least separate it into two commits, one for changing the itemBgStyles stuff and one for fixing the sliders stuff.

@akloeckner
Copy link
Contributor Author

OK! I'll re-open new PRs for that.

@akloeckner akloeckner closed this Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TYPES.SLIDER and 0 values. Scripts with same id overwrite background
2 participants