bippy 0.2.24 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/{chunk-N23WFCSF.js → chunk-5A4BJBVW.cjs} +4 -7
- package/dist/chunk-7YG3CYCA.js +2240 -0
- package/dist/chunk-AQ674A4M.cjs +38 -0
- package/dist/chunk-EPG3GO3H.js +35 -0
- package/dist/{chunk-HQYIPSLJ.cjs → chunk-I3GVATOW.js} +2 -9
- package/dist/{chunk-347RWTP3.js → chunk-MSOPLAJ4.js} +58 -14
- package/dist/chunk-MVK3AG63.cjs +2246 -0
- package/dist/{chunk-GVWERSAB.cjs → chunk-QHE5F4UP.cjs} +60 -13
- package/dist/core.cjs +80 -67
- package/dist/core.d.cts +15 -70
- package/dist/core.d.ts +15 -70
- package/dist/core.js +2 -1
- package/dist/experiments/inspect.cjs +26 -14
- package/dist/experiments/inspect.js +14 -2
- package/dist/experiments/shrinkwrap.cjs +375 -0
- package/dist/experiments/shrinkwrap.d.cts +10 -0
- package/dist/experiments/shrinkwrap.d.ts +10 -0
- package/dist/experiments/shrinkwrap.js +370 -0
- package/dist/index.cjs +81 -68
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.global.js +1 -1
- package/dist/index.js +3 -2
- package/dist/jsx-dev-runtime.cjs +47 -0
- package/dist/jsx-dev-runtime.d.cts +8 -0
- package/dist/jsx-dev-runtime.d.ts +8 -0
- package/dist/jsx-dev-runtime.js +37 -0
- package/dist/jsx-runtime-LhDmw-G0.d.cts +71 -0
- package/dist/jsx-runtime-LhDmw-G0.d.ts +71 -0
- package/dist/jsx-runtime.cjs +15 -0
- package/dist/jsx-runtime.d.cts +3 -0
- package/dist/jsx-runtime.d.ts +3 -0
- package/dist/jsx-runtime.js +4 -0
- package/dist/shrinkwrap.global.js +9 -0
- package/dist/source.cjs +289 -0
- package/dist/source.d.cts +15 -0
- package/dist/source.d.ts +15 -0
- package/dist/source.global.js +22 -0
- package/dist/source.js +4 -0
- package/package.json +29 -7
- package/dist/sw.cjs +0 -56
- package/dist/sw.js +0 -54
package/README.md
CHANGED
|
@@ -397,6 +397,30 @@ import { isValidFiber } from 'bippy';
|
|
|
397
397
|
console.log(isValidFiber(fiber));
|
|
398
398
|
```
|
|
399
399
|
|
|
400
|
+
## getFiberFromHostInstance
|
|
401
|
+
|
|
402
|
+
returns the fiber associated with a given host instance (e.g., a DOM element).
|
|
403
|
+
|
|
404
|
+
```typescript
|
|
405
|
+
import { getFiberFromHostInstance } from 'bippy';
|
|
406
|
+
|
|
407
|
+
const fiber = getFiberFromHostInstance(document.querySelector('div'));
|
|
408
|
+
console.log(fiber);
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## getLatestFiber
|
|
412
|
+
|
|
413
|
+
returns the latest fiber (since it may be double-buffered). usually use this in combination with `getFiberFromHostInstance`.
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
import { getLatestFiber } from 'bippy';
|
|
417
|
+
|
|
418
|
+
const latestFiber = getLatestFiber(
|
|
419
|
+
getFiberFromHostInstance(document.querySelector('div'))
|
|
420
|
+
);
|
|
421
|
+
console.log(latestFiber);
|
|
422
|
+
```
|
|
423
|
+
|
|
400
424
|
## examples
|
|
401
425
|
|
|
402
426
|
the best way to understand bippy is to [read the source code](https://github.com/aidenybai/bippy/blob/main/src/core.ts). here are some examples of how you can use it:
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQHE5F4UP_cjs = require('./chunk-QHE5F4UP.cjs');
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* @license bippy
|
|
@@ -10,9 +12,4 @@ import { isClientEnvironment, getRDTHook } from './chunk-347RWTP3.js';
|
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
// src/index.ts
|
|
13
|
-
|
|
14
|
-
if (isClientEnvironment()) {
|
|
15
|
-
getRDTHook();
|
|
16
|
-
}
|
|
17
|
-
} catch {
|
|
18
|
-
}
|
|
15
|
+
chunkQHE5F4UP_cjs.safelyInstallRDTHook();
|