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

[core] Support MutationObserver behind a flag #44

Closed
RangerMauve opened this issue Jan 30, 2021 · 5 comments 路 Fixed by #53
Closed

[core] Support MutationObserver behind a flag #44

RangerMauve opened this issue Jan 30, 2021 · 5 comments 路 Fixed by #53
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@RangerMauve
Copy link

As per #34 we talked about how MutationObserver isn't necessary for the actual games but is a nice to have.

Just wanted to make sure this feature was being tracked. 馃榿

In this comment it was suggested to have an observe toggle in three-game which would enable this functionality.

@hmans hmans added the enhancement New feature or request label Jan 30, 2021
@hmans hmans added this to the 0.4 milestone Jan 30, 2021
@hmans
Copy link
Owner

hmans commented Jan 30, 2021

Also from my side let me voice my commitment to re-enable this in some fashion in a future (ideally the 0.4) release. Things I want to explore:

  • making it opt-in by setting an observe attribute (or similar) either on three-game or individual elements (or element branches.)
  • finding out if we can use a single MutationObserver for a full tree (and not just individual elements)
  • possibly implementing our own logic that we can configure to not run every frame, but only every n frames.

@hmans
Copy link
Owner

hmans commented Jan 30, 2021

I've done some experimenting (see the extremely WIP Draft PR above).

The good news is that it's possible to just have one MutationObserver observing the entire tree of a <three-game> instance (instead of having one MutationObserver instance per element.)

The bad news is that this doesn't seem to have any noticeable impact on the kind of bad performance we've had with MutationObservers enabled.

Still, as a purely opt-in feature, this is okay, and I will continue to work on it.

@RangerMauve
Copy link
Author

Is there a way to import this version of the library using skypack?

@RangerMauve
Copy link
Author

Trying to place some models in a scene, and it's a little frustrating to have to edit the source and reload each time. 馃槄

@CodyJasonBennett
Copy link
Contributor

If nothing else, the parcel setup on codesandbox works very well for this (https://js.new).

@hmans hmans changed the title Support MutationObserver behind a flag [core] Support MutationObserver behind a flag Feb 4, 2021
@hmans hmans self-assigned this Feb 4, 2021
@hmans hmans closed this as completed in #53 Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants