@hotwired/turbo 8.0.2 → 8.0.4

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Turbo 8.0.2
2
+ Turbo 8.0.4
3
3
  Copyright © 2024 37signals LLC
4
4
  */
5
5
  /**
@@ -126,7 +126,7 @@ class FrameElement extends HTMLElement {
126
126
  loaded = Promise.resolve()
127
127
 
128
128
  static get observedAttributes() {
129
- return ["disabled", "complete", "loading", "src"]
129
+ return ["disabled", "loading", "src"]
130
130
  }
131
131
 
132
132
  constructor() {
@@ -149,11 +149,9 @@ class FrameElement extends HTMLElement {
149
149
  attributeChangedCallback(name) {
150
150
  if (name == "loading") {
151
151
  this.delegate.loadingStyleChanged();
152
- } else if (name == "complete") {
153
- this.delegate.completeChanged();
154
152
  } else if (name == "src") {
155
153
  this.delegate.sourceURLChanged();
156
- } else {
154
+ } else if (name == "disabled") {
157
155
  this.delegate.disabledChanged();
158
156
  }
159
157
  }
@@ -4806,7 +4804,6 @@ class MorphRenderer extends PageRenderer {
4806
4804
  this.isMorphingTurboFrame = this.#isFrameReloadedWithMorph(currentElement);
4807
4805
 
4808
4806
  Idiomorph.morph(currentElement, newElement, {
4809
- ignoreActiveValue: true,
4810
4807
  morphStyle: morphStyle,
4811
4808
  callbacks: {
4812
4809
  beforeNodeAdded: this.#shouldAddElement,
@@ -5200,8 +5197,7 @@ class Session {
5200
5197
  refresh(url, requestId) {
5201
5198
  const isRecentRequest = requestId && this.recentRequests.has(requestId);
5202
5199
  if (!isRecentRequest) {
5203
- this.cache.exemptPageFromPreview();
5204
- this.visit(url, { action: "replace" });
5200
+ this.visit(url, { action: "replace", shouldCacheSnapshot: false });
5205
5201
  }
5206
5202
  }
5207
5203
 
@@ -5775,20 +5771,12 @@ class FrameController {
5775
5771
 
5776
5772
  sourceURLReloaded() {
5777
5773
  const { src } = this.element;
5778
- this.#ignoringChangesToAttribute("complete", () => {
5779
- this.element.removeAttribute("complete");
5780
- });
5774
+ this.element.removeAttribute("complete");
5781
5775
  this.element.src = null;
5782
5776
  this.element.src = src;
5783
5777
  return this.element.loaded
5784
5778
  }
5785
5779
 
5786
- completeChanged() {
5787
- if (this.#isIgnoringChangesTo("complete")) return
5788
-
5789
- this.#loadSourceURL();
5790
- }
5791
-
5792
5780
  loadingStyleChanged() {
5793
5781
  if (this.loadingStyle == FrameLoadingStyle.lazy) {
5794
5782
  this.appearanceObserver.start();
@@ -6213,13 +6201,11 @@ class FrameController {
6213
6201
  }
6214
6202
 
6215
6203
  set complete(value) {
6216
- this.#ignoringChangesToAttribute("complete", () => {
6217
- if (value) {
6218
- this.element.setAttribute("complete", "");
6219
- } else {
6220
- this.element.removeAttribute("complete");
6221
- }
6222
- });
6204
+ if (value) {
6205
+ this.element.setAttribute("complete", "");
6206
+ } else {
6207
+ this.element.removeAttribute("complete");
6208
+ }
6223
6209
  }
6224
6210
 
6225
6211
  get isActive() {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Turbo 8.0.2
2
+ Turbo 8.0.4
3
3
  Copyright © 2024 37signals LLC
4
4
  */
5
5
  (function (global, factory) {
@@ -132,7 +132,7 @@ Copyright © 2024 37signals LLC
132
132
  loaded = Promise.resolve()
133
133
 
134
134
  static get observedAttributes() {
135
- return ["disabled", "complete", "loading", "src"]
135
+ return ["disabled", "loading", "src"]
136
136
  }
137
137
 
138
138
  constructor() {
@@ -155,11 +155,9 @@ Copyright © 2024 37signals LLC
155
155
  attributeChangedCallback(name) {
156
156
  if (name == "loading") {
157
157
  this.delegate.loadingStyleChanged();
158
- } else if (name == "complete") {
159
- this.delegate.completeChanged();
160
158
  } else if (name == "src") {
161
159
  this.delegate.sourceURLChanged();
162
- } else {
160
+ } else if (name == "disabled") {
163
161
  this.delegate.disabledChanged();
164
162
  }
165
163
  }
@@ -4812,7 +4810,6 @@ Copyright © 2024 37signals LLC
4812
4810
  this.isMorphingTurboFrame = this.#isFrameReloadedWithMorph(currentElement);
4813
4811
 
4814
4812
  Idiomorph.morph(currentElement, newElement, {
4815
- ignoreActiveValue: true,
4816
4813
  morphStyle: morphStyle,
4817
4814
  callbacks: {
4818
4815
  beforeNodeAdded: this.#shouldAddElement,
@@ -5206,8 +5203,7 @@ Copyright © 2024 37signals LLC
5206
5203
  refresh(url, requestId) {
5207
5204
  const isRecentRequest = requestId && this.recentRequests.has(requestId);
5208
5205
  if (!isRecentRequest) {
5209
- this.cache.exemptPageFromPreview();
5210
- this.visit(url, { action: "replace" });
5206
+ this.visit(url, { action: "replace", shouldCacheSnapshot: false });
5211
5207
  }
5212
5208
  }
5213
5209
 
@@ -5781,20 +5777,12 @@ Copyright © 2024 37signals LLC
5781
5777
 
5782
5778
  sourceURLReloaded() {
5783
5779
  const { src } = this.element;
5784
- this.#ignoringChangesToAttribute("complete", () => {
5785
- this.element.removeAttribute("complete");
5786
- });
5780
+ this.element.removeAttribute("complete");
5787
5781
  this.element.src = null;
5788
5782
  this.element.src = src;
5789
5783
  return this.element.loaded
5790
5784
  }
5791
5785
 
5792
- completeChanged() {
5793
- if (this.#isIgnoringChangesTo("complete")) return
5794
-
5795
- this.#loadSourceURL();
5796
- }
5797
-
5798
5786
  loadingStyleChanged() {
5799
5787
  if (this.loadingStyle == FrameLoadingStyle.lazy) {
5800
5788
  this.appearanceObserver.start();
@@ -6219,13 +6207,11 @@ Copyright © 2024 37signals LLC
6219
6207
  }
6220
6208
 
6221
6209
  set complete(value) {
6222
- this.#ignoringChangesToAttribute("complete", () => {
6223
- if (value) {
6224
- this.element.setAttribute("complete", "");
6225
- } else {
6226
- this.element.removeAttribute("complete");
6227
- }
6228
- });
6210
+ if (value) {
6211
+ this.element.setAttribute("complete", "");
6212
+ } else {
6213
+ this.element.removeAttribute("complete");
6214
+ }
6229
6215
  }
6230
6216
 
6231
6217
  get isActive() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotwired/turbo",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "The speed of a single-page web application without having to write any JavaScript",
5
5
  "module": "dist/turbo.es2017-esm.js",
6
6
  "main": "dist/turbo.es2017-umd.js",