• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

preactjs / preact / 5574
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 04 Oct 2019 09:50AM UTC
Jobs 1
Files 20
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5574

push

travis-ci

JoviDeCroock
Reduce size of adding hooks to core (-117 B) (#1976)

* Add a couple missing types to index.d.ts

* Replace globalHookState with resetHookState function (-70 B)

Our terser config only mangles properties that begin with "_" so the
globalHookState properties weren't being mangled. Adding "_" before each
property name reduced the size by 28 B.

However instead of just mangling the property names, I made the variables local
to the hooks file and exposed the functionality that diff/index.js needs
as a function to modify the hook state. Since the variables are now
local to hooks, they can be minified like local variables bringing
additional savings

* Fix bug introduced by descturcturing useImperativeHandle hook state (+2 B)

Destructuring an object's properties does not propagate changes to the
local variable to the original object which broke useImperativeHandle.
Add test to verify behavior

* Reuse vnode._component null check in unmount to call hook cleanup callbacks (-5 B)

Actually increases our compat with React cuz refs are nullified before calling hook cleanup functions:
https://codesandbox.io/s/unmounting-refs-and-effects-jo4g2

* Move pendingLayoutEffects flush into component diff to reuse "c" variable (-12 B)

* Minify useImperativeHandle hook state props (-10 B)

* Schedule imperative handle creation as a layout effect (-31 B)

Technically this is slightly different than React cuz layout effects and imperative handle creation within a component will be inter-mixed. In React, imperative handle always comes before layout effects. I think this compromise is okay though, cuz I don't think imperative handles are supposed to be used by the component that creates them, but rather by the parent component that owns the ref useImperativeHandle is modifying.

* Fix useContext args change check (+9 B)

The previous change to destructure the args of getHookState broke because `state._value` was no longer modified. Instead ... (continued)

810 of 837 branches covered (96.77%)

35 of 35 new or added lines in 2 files covered. (100.0%)

837 of 841 relevant lines covered (99.52%)

788.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5574.1 04 Oct 2019 09:50AM UTC 0
99.52
Travis Job 5574.1
Source Files on build 5574
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5574
  • 22e051d4 on github
  • Prev Build on feat/hooks-in-core (#5546)
  • Next Build on feat/hooks-in-core (#5578)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc