Commit f1b645e
committed
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[Stimulus] Fasten lazy loading + add debug `lazy:loading` and `lazy:loaded`
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| Issues | Fix #...
| License | MIT
This PR..
1. improves the controller **lazy loading** by tuning algorithm (early exit, remove await, ...)
2. introduces two **new debug events** in the console to ease DX with lazy controllers
* `my-controller#lazy:loading` when the lazy controller is detected in the DOM
* `my-controller#lazy:loaded` after the file has been downloaded and imported
I would really like some feedback / tests IRL (especially with Webpack i'm not used to)
Commits
-------
3b8e1ce [Stimulus] Fasten lazy loading + add debug `lazy:loading` and `lazy:loaded`
2 files changed
+78
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
37 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
38 | 50 | | |
39 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
40 | 55 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
47 | 65 | | |
48 | 66 | | |
49 | 67 | | |
50 | | - | |
51 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
52 | 72 | | |
53 | 73 | | |
54 | 74 | | |
| |||
58 | 78 | | |
59 | 79 | | |
60 | 80 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | | - | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
83 | 101 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
94 | 112 | | |
95 | | - | |
96 | 113 | | |
97 | 114 | | |
98 | 115 | | |
99 | | - | |
100 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
101 | 122 | | |
102 | 123 | | |
103 | 124 | | |
| |||
107 | 128 | | |
108 | 129 | | |
109 | 130 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 131 | | |
115 | 132 | | |
116 | 133 | | |
| |||
0 commit comments