Skip to content
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

Fix interoperability issue regarding Event properties #36235

Closed
wants to merge 2 commits into from

Conversation

alecpl
Copy link
Contributor

@alecpl alecpl commented Apr 27, 2022

Fixes #36207

Fixes twbs#36207

TODO: Decide whether it would make sense to make the props writable,
to make the BC break less impactful.
@alecpl alecpl requested a review from a team as a code owner April 27, 2022 07:53
@alecpl
Copy link
Contributor Author

alecpl commented Apr 27, 2022

The JS Tests failure is probably not related, as it worked with the first commit.

@alecpl
Copy link
Contributor Author

alecpl commented Apr 29, 2022

@GeoSot @mdo What do you think about this? It would be nice to have it included in 5.2.

ps. I see it conflicts with #36171.

@GeoSot
Copy link
Member

GeoSot commented Apr 29, 2022

Hello @alecpl .
Αs the facts show, they just overtook my future plans and our processes speed.
Starting with #36171, - which I would suggest you to wait, in order to keep us both in the same page- I am preparing some changes.

I was intending to boost the hydrate function of #36171, and make it like below:

function hydrateObj(obj, meta) {
  for (const [key, value] of Object.entries(meta || {})) {
    try {
      obj[key] = value
    } catch {
      Object.defineProperty(obj, key, {
        get() {
          return value
        }
      })
    }
  }

  return obj
}

So you may use this 'upgrade' adding configurable: true
and using it like

event = hydrateObj(event, {delegateTarget: element})

However, it will need to support your PR with some tests, to ensure code of future changes

@GeoSot GeoSot marked this pull request as draft May 3, 2022 21:21
@GeoSot
Copy link
Member

GeoSot commented May 16, 2022

@alecpl #36171 is merged. So you can rebase and continue if you still want to continue :)

@alecpl
Copy link
Contributor Author

alecpl commented May 17, 2022

Created #36386.

@alecpl alecpl closed this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: setting getter-only property "delegateTarget"
2 participants