Browse Source

Bump version to 3.9.0

Caleb Porzio 3 years ago
parent
commit
63b28e11f5

+ 1 - 1
packages/alpinejs/package.json

@@ -1,6 +1,6 @@
 {
     "name": "alpinejs",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "description": "The rugged, minimal JavaScript framework",
     "author": "Caleb Porzio",
     "license": "MIT",

+ 3 - 2
packages/alpinejs/src/directives/x-for.js

@@ -136,10 +136,11 @@ function loop(el, iteratorNames, evaluateItems, evaluateKey) {
         for (let i = 0; i < removes.length; i++) {
             let key = removes[i]
 
-            //Remove any queued effects that might run after the DOM node has been removed.
-            if (!!lookup[key]._x_effects) {
+            // Remove any queued effects that might run after the DOM node has been removed.
+            if (!! lookup[key]._x_effects) {
                 lookup[key]._x_effects.forEach(dequeueJob)
             }
+            
             lookup[key].remove()
 
             lookup[key] = null

+ 2 - 1
packages/alpinejs/src/directives/x-if.js

@@ -30,9 +30,10 @@ directive('if', (el, { expression }, { effect, cleanup }) => {
                     node._x_effects.forEach(dequeueJob)
                 }
             })
+            
             clone.remove();
+
             delete el._x_currentIfEl
-            
         }
 
         return clone

+ 3 - 4
packages/alpinejs/src/scheduler.js

@@ -11,10 +11,9 @@ function queueJob(job) {
     queueFlush()
 }
 export function dequeueJob(job) {
-    const index = queue.indexOf(job)
-    if (index !== -1) {
-        queue.splice(index, 1)
-    }
+    let index = queue.indexOf(job)
+
+    if (index !== -1) queue.splice(index, 1)
 }
 
 function queueFlush() {

+ 1 - 1
packages/collapse/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@alpinejs/collapse",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "description": "Collapse and expand elements with robust animations",
     "author": "Caleb Porzio",
     "license": "MIT",

+ 1 - 1
packages/docs/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@alpinejs/docs",
-    "version": "3.8.1-revision.1",
+    "version": "3.9.0-revision.1",
     "description": "The documentation for Alpine",
     "author": "Caleb Porzio",
     "license": "MIT"

+ 1 - 1
packages/docs/src/en/essentials/installation.md

@@ -33,7 +33,7 @@ This is by far the simplest way to get started with Alpine. Include the followin
 Notice the `@3.x.x` in the provided CDN link. This will pull the latest version of Alpine version 3. For stability in production, it's recommended that you hardcode the latest version in the CDN link.
 
 ```alpine
-<script defer src="https://unpkg.com/alpinejs@3.8.1/dist/cdn.min.js"></script>
+<script defer src="https://unpkg.com/alpinejs@3.9.0/dist/cdn.min.js"></script>
 ```
 
 That's it! Alpine is now available for use inside your page.

+ 1 - 1
packages/focus/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@alpinejs/focus",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "description": "Manage focus within a page",
     "author": "Caleb Porzio",
     "license": "MIT",

+ 1 - 1
packages/intersect/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@alpinejs/intersect",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "description": "Trigger JavaScript when an element enters the viewport",
     "author": "Caleb Porzio",
     "license": "MIT",

+ 1 - 1
packages/morph/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@alpinejs/morph",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "description": "Diff and patch a block of HTML on a page with an HTML template",
     "author": "Caleb Porzio",
     "license": "MIT",

+ 1 - 1
packages/persist/package.json

@@ -1,6 +1,6 @@
 {
     "name": "@alpinejs/persist",
-    "version": "3.8.1",
+    "version": "3.9.0",
     "description": "Persist Alpine data across page loads",
     "author": "Caleb Porzio",
     "license": "MIT",

+ 4 - 5
tests/cypress/integration/directives/x-if.spec.js

@@ -52,7 +52,7 @@ test('x-if initializes after being added to the DOM to allow x-ref to work',
     }
 )
 
-//If x-if evaluates to false, the expectation is that no sub-expressions will be evaluated.
+// If x-if evaluates to false, the expectation is that no sub-expressions will be evaluated.
 test('x-if removed dom does not evaluate reactive expressions in dom tree',
     html`
     <div x-data="{user: {name: 'lebowski'}}">
@@ -66,10 +66,9 @@ test('x-if removed dom does not evaluate reactive expressions in dom tree',
     ({ get }) => {
         get('span').should(haveText('lebowski'))
         
-        /** Clicking button sets user=null and thus x-if="user" will evaluate to false. 
-            If the sub-expression x-text="user.name" is evaluated, the button click  
-            will produce an error because user is no longer defined and the test will fail
-        **/
+        // Clicking button sets user=null and thus x-if="user" will evaluate to false. 
+        // If the sub-expression x-text="user.name" is evaluated, the button click  
+        // will produce an error because user is no longer defined and the test will fail
         get('button').click()
         get('span').should('not.exist')
     }