cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

[v3.8.5] Reduce package size for spine module

Open dumganhar opened this issue 1 year ago • 4 comments

Re: #17715

Changelog


Continuous Integration

This pull request:

  • [ ] needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • [ ] does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • [ ] changes public API, and have ensured backward compatibility with deprecated features.
  • [ ] affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • [ ] affects file structure of the build package or build configuration which requires user project upgrade.
  • [ ] introduces breaking changes, please list all changes, affected features and the scope of violation.

dumganhar avatar Oct 29 '24 08:10 dumganhar

P.S. Another thing I tried:

Copied use_effect code, including Effect return struct, and renamed to use_update_effect.

  • Commented out first call to queue_effect_for_next_render(); -- result: no callback, ever.
  • Added let did_run = Rc::new(Cell::new(false)) etc. and then checked for it within rc.run_in, wrapping callback. Nothing.
  • Several other things I can't recall which may or may not appear in my o1-preview chat link above.

It seems dioxus is insisting that, whenever I wrap the original user's callback, that it hasn't changed, even though I've introduced a build_count or did_run, etc. "dependency" into the wrapper that should change.

Using use_signal is obviously not an option either, as that causes an infinite loop.

So it is totally unclear even what a "dependency" is in the context of these hooks, how it considers these, and whether anything other than a Signal is even considered.

tgrushka avatar Oct 28 '24 23:10 tgrushka

use_hook does not have dependency tracking. It is the core hook primitive without any state management systems built in. All hooks in dioxus_hooks (use_signal, use_memo, use_resource, etc) do have dependency tracking. The 0.6 docs have a more complete explanation of reactivity including how to deal with non-reactive state here

ealmloff avatar Oct 31 '24 15:10 ealmloff