marko 6.0.0-next.3.83 → 6.0.0-next.3.85

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.
@@ -3183,20 +3183,30 @@ var ServerRendered = class {
3183
3183
  );
3184
3184
  }
3185
3185
  toReadable() {
3186
+ let cancelled = false;
3187
+ let boundary;
3186
3188
  const encoder = new TextEncoder();
3187
3189
  return new ReadableStream({
3188
3190
  start: (ctrl) => {
3189
- this.#read(
3191
+ boundary = this.#read(
3190
3192
  (html) => {
3191
3193
  ctrl.enqueue(encoder.encode(html));
3192
3194
  },
3193
3195
  (err) => {
3194
- ctrl.error(err);
3196
+ boundary = void 0;
3197
+ if (!cancelled) {
3198
+ ctrl.error(err);
3199
+ }
3195
3200
  },
3196
3201
  () => {
3202
+ boundary = void 0;
3197
3203
  ctrl.close();
3198
3204
  }
3199
3205
  );
3206
+ },
3207
+ cancel: (reason) => {
3208
+ cancelled = true;
3209
+ boundary?.abort(reason);
3200
3210
  }
3201
3211
  });
3202
3212
  }
@@ -3101,20 +3101,30 @@ var ServerRendered = class {
3101
3101
  );
3102
3102
  }
3103
3103
  toReadable() {
3104
+ let cancelled = false;
3105
+ let boundary;
3104
3106
  const encoder = new TextEncoder();
3105
3107
  return new ReadableStream({
3106
3108
  start: (ctrl) => {
3107
- this.#read(
3109
+ boundary = this.#read(
3108
3110
  (html) => {
3109
3111
  ctrl.enqueue(encoder.encode(html));
3110
3112
  },
3111
3113
  (err) => {
3112
- ctrl.error(err);
3114
+ boundary = void 0;
3115
+ if (!cancelled) {
3116
+ ctrl.error(err);
3117
+ }
3113
3118
  },
3114
3119
  () => {
3120
+ boundary = void 0;
3115
3121
  ctrl.close();
3116
3122
  }
3117
3123
  );
3124
+ },
3125
+ cancel: (reason) => {
3126
+ cancelled = true;
3127
+ boundary?.abort(reason);
3118
3128
  }
3119
3129
  });
3120
3130
  }
package/dist/html.js CHANGED
@@ -2070,20 +2070,23 @@ var ServerRendered = class {
2070
2070
  );
2071
2071
  }
2072
2072
  toReadable() {
2073
- let encoder = new TextEncoder();
2073
+ let cancelled = !1, boundary, encoder = new TextEncoder();
2074
2074
  return new ReadableStream({
2075
2075
  start: (ctrl) => {
2076
- this.#read(
2076
+ boundary = this.#read(
2077
2077
  (html) => {
2078
2078
  ctrl.enqueue(encoder.encode(html));
2079
2079
  },
2080
2080
  (err) => {
2081
- ctrl.error(err);
2081
+ boundary = void 0, cancelled || ctrl.error(err);
2082
2082
  },
2083
2083
  () => {
2084
- ctrl.close();
2084
+ boundary = void 0, ctrl.close();
2085
2085
  }
2086
2086
  );
2087
+ },
2088
+ cancel: (reason) => {
2089
+ cancelled = !0, boundary?.abort(reason);
2087
2090
  }
2088
2091
  });
2089
2092
  }
package/dist/html.mjs CHANGED
@@ -1991,20 +1991,23 @@ var ServerRendered = class {
1991
1991
  );
1992
1992
  }
1993
1993
  toReadable() {
1994
- let encoder = new TextEncoder();
1994
+ let cancelled = !1, boundary, encoder = new TextEncoder();
1995
1995
  return new ReadableStream({
1996
1996
  start: (ctrl) => {
1997
- this.#read(
1997
+ boundary = this.#read(
1998
1998
  (html) => {
1999
1999
  ctrl.enqueue(encoder.encode(html));
2000
2000
  },
2001
2001
  (err) => {
2002
- ctrl.error(err);
2002
+ boundary = void 0, cancelled || ctrl.error(err);
2003
2003
  },
2004
2004
  () => {
2005
- ctrl.close();
2005
+ boundary = void 0, ctrl.close();
2006
2006
  }
2007
2007
  );
2008
+ },
2009
+ cancel: (reason) => {
2010
+ cancelled = !0, boundary?.abort(reason);
2008
2011
  }
2009
2012
  });
2010
2013
  }
@@ -1,10 +1,10 @@
1
1
  import { type Tag } from "@marko/compiler/babel-utils";
2
2
  import { type Binding } from "../util/references";
3
- export declare const kCommentTagBinding: unique symbol;
3
+ declare const kNodeBinding: unique symbol;
4
4
  declare const kGetterId: unique symbol;
5
5
  declare module "@marko/compiler/dist/types" {
6
6
  interface NodeExtra {
7
- [kCommentTagBinding]?: Binding;
7
+ [kNodeBinding]?: Binding;
8
8
  [kGetterId]?: string;
9
9
  }
10
10
  }
@@ -1,7 +1,10 @@
1
1
  import { type Tag } from "@marko/compiler/babel-utils";
2
+ import { type Binding } from "../util/references";
3
+ declare const kNodeBinding: unique symbol;
2
4
  declare const kGetterId: unique symbol;
3
5
  declare module "@marko/compiler/dist/types" {
4
6
  interface NodeExtra {
7
+ [kNodeBinding]?: Binding;
5
8
  [kGetterId]?: string;
6
9
  }
7
10
  }
@@ -1,7 +1,10 @@
1
1
  import { type Tag } from "@marko/compiler/babel-utils";
2
+ import { type Binding } from "../util/references";
3
+ declare const kNodeBinding: unique symbol;
2
4
  declare const kGetterId: unique symbol;
3
5
  declare module "@marko/compiler/dist/types" {
4
6
  interface NodeExtra {
7
+ [kNodeBinding]?: Binding;
5
8
  [kGetterId]?: string;
6
9
  }
7
10
  }