rytm-webflow 2.2.7 → 2.3.0
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/.claude/settings.local.json +7 -0
- package/.claude/task_notes/WWT3.md +44 -0
- package/CLAUDE.md +7 -7
- package/README.md +3 -2
- package/docs/changelog/2.3.0.md +70 -0
- package/package.json +11 -1
- package/scripts/bootstrap/index.d.ts +8 -0
- package/scripts/bootstrap/index.js +4 -0
- package/scripts/index.d.ts +0 -2
- package/scripts/index.js +0 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# WWT3 — Remove Bootstrap dependency for default use
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
Bootstrap 5 helpers were hardcoded into the main `rytm-webflow` bundle, causing bundler errors in non-Bootstrap projects (e.g. Tailwind CSS). The helpers have been moved to an opt-in sub-path export (`'rytm-webflow/bootstrap'`) and the long-standing export name typo (`bootsrap5` → `bootstrap5`) has been corrected. The main import is now fully Bootstrap-free.
|
|
5
|
+
|
|
6
|
+
## Completed
|
|
7
|
+
- Remove `bootsrap5` import and export from `scripts/index.js`
|
|
8
|
+
- Create `scripts/bootstrap/index.js` as a secondary entry point exporting `bootstrap5`
|
|
9
|
+
- Create `scripts/bootstrap/index.d.ts` with types for the sub-path export
|
|
10
|
+
- Remove `bootsrap5` from the default export shape in `scripts/index.d.ts`
|
|
11
|
+
- Add `exports` field to `package.json` mapping `'.'` and `'./bootstrap'` sub-paths (with `import` + `types` conditions)
|
|
12
|
+
- Rename `bootsrap5` → `bootstrap5` across all source files, types, `CLAUDE.md`, and `README.md`
|
|
13
|
+
- Remove the "Note: the export name has a typo" line from `CLAUDE.md`
|
|
14
|
+
- Update `README.md` Bootstrap integration example to use sub-path import
|
|
15
|
+
- Bump version `2.2.7` → `2.3.0` in `package.json`
|
|
16
|
+
- Create `docs/changelog/2.3.0.md` documenting both breaking changes with upgrade table
|
|
17
|
+
|
|
18
|
+
## Remaining work
|
|
19
|
+
None — task complete.
|
|
20
|
+
|
|
21
|
+
## Key decisions
|
|
22
|
+
- **Option B chosen** (sub-path export) over dynamic import or `window.bootstrap` fallback — cleanest separation, no async complexity, standard pattern for optional peer dependencies
|
|
23
|
+
- **Both breaking changes in one version bump** — the rename and the sub-path move are coupled; doing them together avoids an intermediate version that is still broken for Tailwind projects
|
|
24
|
+
- `bootstrap` is intentionally NOT added to `peerDependencies` in `package.json` — it remains the host project's responsibility, consistent with prior behaviour
|
|
25
|
+
- The old typo name `bootsrap5` is preserved in the changelog for upgrade searchability, but removed from all live code
|
|
26
|
+
|
|
27
|
+
## Gotchas & notes
|
|
28
|
+
- `scripts/bootstrap/v5/Bootstrap5.js` already used the correctly-spelled internal variable `bootstrap5` — only the re-export names needed fixing
|
|
29
|
+
- The `exports` field in `package.json` takes precedence over `main`/`types` in modern bundlers; both are kept for backwards compatibility with older tooling
|
|
30
|
+
- Any legacy project using `RytmWebflow.bootsrap5` will get a runtime error after upgrading — direct them to `docs/changelog/2.3.0.md`
|
|
31
|
+
|
|
32
|
+
## Key files
|
|
33
|
+
|
|
34
|
+
| File | Description |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `scripts/index.js` | Main entry — Bootstrap import removed |
|
|
37
|
+
| `scripts/bootstrap/index.js` | New opt-in sub-path entry point |
|
|
38
|
+
| `scripts/bootstrap/index.d.ts` | Types for sub-path export |
|
|
39
|
+
| `scripts/index.d.ts` | `bootsrap5` removed from default export shape |
|
|
40
|
+
| `scripts/bootstrap/v5/Bootstrap5.js` | Unchanged — internal variable was already correct |
|
|
41
|
+
| `package.json` | Version bump to 2.3.0; `exports` field added |
|
|
42
|
+
| `docs/changelog/2.3.0.md` | Upgrade guide for legacy projects |
|
|
43
|
+
| `CLAUDE.md` | Bootstrap section updated to sub-path usage |
|
|
44
|
+
| `README.md` | Bootstrap integration example updated |
|
package/CLAUDE.md
CHANGED
|
@@ -19,7 +19,7 @@ import RytmWebflow from 'rytm-webflow'
|
|
|
19
19
|
| `View` | Class | Base view — animation hooks |
|
|
20
20
|
| `WebflowView` | Class | View with declarative animations via data attributes |
|
|
21
21
|
| `WebflowListView` | Class | Staggered list animations with scroll triggers |
|
|
22
|
-
| `
|
|
22
|
+
| `bootstrap5` | Object | Bootstrap 5 modal/offcanvas close helpers (import from `'rytm-webflow/bootstrap'`) |
|
|
23
23
|
| `scrollController` | Singleton | ScrollMagic controller manager |
|
|
24
24
|
| `showUp` | Singleton | Standalone scroll-triggered animations (no ASwap needed) |
|
|
25
25
|
| `getWebflowProps(str)` | Function | Parse webflow show/hide syntax |
|
|
@@ -331,12 +331,12 @@ const aswapEvents = {
|
|
|
331
331
|
## Bootstrap 5 helpers
|
|
332
332
|
|
|
333
333
|
```javascript
|
|
334
|
-
|
|
335
|
-
RytmWebflow.bootsrap5.hideModals() // Close modals only
|
|
336
|
-
RytmWebflow.bootsrap5.hideOffcanvases() // Close offcanvases only
|
|
337
|
-
```
|
|
334
|
+
import bootstrap5 from 'rytm-webflow/bootstrap'
|
|
338
335
|
|
|
339
|
-
|
|
336
|
+
bootstrap5.hideFlyovers() // Close all modals + offcanvases
|
|
337
|
+
bootstrap5.hideModals() // Close modals only
|
|
338
|
+
bootstrap5.hideOffcanvases() // Close offcanvases only
|
|
339
|
+
```
|
|
340
340
|
|
|
341
341
|
---
|
|
342
342
|
|
|
@@ -356,7 +356,7 @@ RytmWebflow.scrollController.destroy() // Clean up
|
|
|
356
356
|
2. **Layout shifts from images** — use `ControllerImgLoad` for image-heavy pages
|
|
357
357
|
3. **Nested view element leaks** — filter with `elementBelongsToView()` when querying elements
|
|
358
358
|
4. **ScrollMagic memory leaks** — WebflowView handles cleanup automatically; manual scenes need explicit `destroy()`
|
|
359
|
-
5. **Bootstrap modals persist on navigation** — call `
|
|
359
|
+
5. **Bootstrap modals persist on navigation** — call `bootstrap5.hideFlyovers()` in `onViewHide`
|
|
360
360
|
6. **Event listener accumulation** — always clean up in `removeEventListeners()`
|
|
361
361
|
7. **Stagger not working** — requires `data-webset="selector:..."` attribute
|
|
362
362
|
8. **Easing not applied** — use GSAP v3 syntax: `e:power3.out` (not `e:Power3.easeOut`)
|
package/README.md
CHANGED
|
@@ -210,14 +210,15 @@ RytmWebflow.aswap.init(params, {
|
|
|
210
210
|
|
|
211
211
|
### Bootstrap integration ###
|
|
212
212
|
#### Bootstrap v5 ####
|
|
213
|
-
A common situation is to hide all Bootstrap offcanvases or modals when an ASwap page transition is in made. To do so just call the `
|
|
213
|
+
A common situation is to hide all Bootstrap offcanvases or modals when an ASwap page transition is in made. To do so just call the `bootstrap5.hideFlyovers()` method. You can also hide offcanvases or modals separatly by calling the `bootstrap5.hideOffcanvases()` or `bootstrap5.hideModals()` methods.
|
|
214
214
|
A basic usage example:
|
|
215
215
|
```js
|
|
216
216
|
import RytmWebflow from 'rytm-webflow'
|
|
217
|
+
import bootstrap5 from 'rytm-webflow/bootstrap'
|
|
217
218
|
|
|
218
219
|
RytmWebflow.aswap.init(params, {
|
|
219
220
|
onViewHide: () => {
|
|
220
|
-
|
|
221
|
+
bootstrap5.hideFlyovers()
|
|
221
222
|
},
|
|
222
223
|
})
|
|
223
224
|
```
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# 2.3.0 — Bootstrap 5 helpers made optional
|
|
2
|
+
|
|
3
|
+
**Released:** 2026-03-31
|
|
4
|
+
|
|
5
|
+
## Summary
|
|
6
|
+
|
|
7
|
+
The Bootstrap 5 helper has been moved out of the main bundle into a dedicated sub-path export, and its long-standing export name typo has been corrected. Projects that do not use Bootstrap (e.g. Tailwind CSS projects) no longer have a transitive dependency on the `bootstrap` package.
|
|
8
|
+
|
|
9
|
+
## Breaking changes
|
|
10
|
+
|
|
11
|
+
### 1. Renamed: `bootsrap5` → `bootstrap5`
|
|
12
|
+
|
|
13
|
+
The export name had a typo (missing `t`). It is now correctly spelled `bootstrap5`.
|
|
14
|
+
|
|
15
|
+
### 2. Moved to a sub-path import
|
|
16
|
+
|
|
17
|
+
`bootstrap5` is no longer part of the default `'rytm-webflow'` export. It must be imported from `'rytm-webflow/bootstrap'`.
|
|
18
|
+
|
|
19
|
+
**Before (≤ 2.2.x):**
|
|
20
|
+
```js
|
|
21
|
+
import RytmWebflow from 'rytm-webflow'
|
|
22
|
+
|
|
23
|
+
RytmWebflow.bootsrap5.hideFlyovers()
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**After (≥ 2.3.0):**
|
|
27
|
+
```js
|
|
28
|
+
import bootstrap5 from 'rytm-webflow/bootstrap'
|
|
29
|
+
|
|
30
|
+
bootstrap5.hideFlyovers()
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Upgrade guide for legacy projects
|
|
34
|
+
|
|
35
|
+
1. **Search your codebase** for the old typo name:
|
|
36
|
+
```
|
|
37
|
+
bootsrap5
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
2. **Add the sub-path import** at the top of any file that uses the Bootstrap helpers:
|
|
41
|
+
```js
|
|
42
|
+
import bootstrap5 from 'rytm-webflow/bootstrap'
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
3. **Replace** all `RytmWebflow.bootsrap5.xxx()` calls:
|
|
46
|
+
| Before | After |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `RytmWebflow.bootsrap5.hideFlyovers()` | `bootstrap5.hideFlyovers()` |
|
|
49
|
+
| `RytmWebflow.bootsrap5.hideModals()` | `bootstrap5.hideModals()` |
|
|
50
|
+
| `RytmWebflow.bootsrap5.hideOffcanvases()` | `bootstrap5.hideOffcanvases()` |
|
|
51
|
+
|
|
52
|
+
4. **Verify** `bootstrap` is listed in your project's own `dependencies` or is loaded globally — `rytm-webflow` no longer pulls it in transitively.
|
|
53
|
+
|
|
54
|
+
## Available helpers (unchanged)
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import bootstrap5 from 'rytm-webflow/bootstrap'
|
|
58
|
+
|
|
59
|
+
bootstrap5.hideFlyovers() // Close all modals + offcanvases
|
|
60
|
+
bootstrap5.hideModals() // Close modals only
|
|
61
|
+
bootstrap5.hideOffcanvases() // Close offcanvases only
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Non-Bootstrap projects
|
|
65
|
+
|
|
66
|
+
No action required. The main import is unchanged and carries no Bootstrap dependency:
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import RytmWebflow from 'rytm-webflow'
|
|
70
|
+
```
|
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rytm-webflow",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "rytm webflow pack - ASwap, ShowUp",
|
|
5
5
|
"main": "scripts/index.js",
|
|
6
6
|
"types": "scripts/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./scripts/index.js",
|
|
10
|
+
"types": "./scripts/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./bootstrap": {
|
|
13
|
+
"import": "./scripts/bootstrap/index.js",
|
|
14
|
+
"types": "./scripts/bootstrap/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
7
17
|
"scripts": {
|
|
8
18
|
"update": "git pull",
|
|
9
19
|
"push": "git add . && git commit -a -m \"$m\" && git push"
|
package/scripts/index.d.ts
CHANGED
|
@@ -201,8 +201,6 @@ declare const RytmWebflow: {
|
|
|
201
201
|
View: typeof View;
|
|
202
202
|
WebflowView: typeof WebflowView;
|
|
203
203
|
WebflowListView: typeof WebflowListView;
|
|
204
|
-
/** Note: "bootsrap5" is the original (typo) name in the library */
|
|
205
|
-
bootsrap5: Bootstrap5;
|
|
206
204
|
scrollController: ScrollController;
|
|
207
205
|
showUp: ShowUp;
|
|
208
206
|
getWebflowProps: typeof getWebflowProps;
|
package/scripts/index.js
CHANGED
|
@@ -4,8 +4,6 @@ import ControllerImgLoad from './aswap/ControllerImgLoad'
|
|
|
4
4
|
import View from './aswap/View'
|
|
5
5
|
import WebflowView from './aswap/WebflowView'
|
|
6
6
|
import WebflowListView from './aswap/WebflowListView'
|
|
7
|
-
// Bootstrap v5 helper
|
|
8
|
-
import bootsrap5 from './bootstrap/v5/Bootstrap5'
|
|
9
7
|
// showup
|
|
10
8
|
import scrollController from './showup/ScrollController'
|
|
11
9
|
import showUp from './showup/ShowUp'
|
|
@@ -20,8 +18,6 @@ export default {
|
|
|
20
18
|
View,
|
|
21
19
|
WebflowView,
|
|
22
20
|
WebflowListView,
|
|
23
|
-
// boottstrap
|
|
24
|
-
bootsrap5,
|
|
25
21
|
// showup
|
|
26
22
|
scrollController,
|
|
27
23
|
showUp,
|