@lisergia/core 17.0.0 → 18.0.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @lisergia/core@16.0.0 build
3
+ > @lisergia/core@17.0.0 build
4
4
  > tsup src/index.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/index.ts
@@ -9,12 +9,12 @@
9
9
  CLI Target: node16
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/index.cjs 16.12 KB
13
- CJS ⚡️ Build success in 16ms
14
- ESM dist/index.js 13.87 KB
15
- ESM ⚡️ Build success in 17ms
12
+ ESM dist/index.js 13.91 KB
13
+ ESM ⚡️ Build success in 41ms
14
+ CJS dist/index.cjs 16.15 KB
15
+ CJS ⚡️ Build success in 41ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 888ms
17
+ DTS ⚡️ Build success in 763ms
18
18
  DTS dist/index.d.cts 5.82 KB
19
19
  DTS dist/index.d.ts 5.82 KB
20
20
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @lisergia/core
2
2
 
3
+ ## 18.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Fix memory leak from DOMParser.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @lisergia/config-tsconfig@18.0.0
13
+
3
14
  ## 17.0.0
4
15
 
5
16
  ### Major Changes
package/dist/index.cjs CHANGED
@@ -406,8 +406,8 @@ var ApplicationManager = class extends Component {
406
406
  nextPage = {};
407
407
  async onRequest({ href, response, pushState }) {
408
408
  var _a, _b;
409
- const domParser = new DOMParser();
410
- const dom = domParser.parseFromString(response, "text/html");
409
+ let domParser = new DOMParser();
410
+ let dom = domParser.parseFromString(response, "text/html");
411
411
  const html = dom.querySelector("html");
412
412
  const app = dom.querySelector(".app");
413
413
  this.nextPage = {
@@ -427,6 +427,8 @@ var ApplicationManager = class extends Component {
427
427
  window.history.pushState({}, this.nextPage.title, href);
428
428
  }
429
429
  this.routeHistory.push(href);
430
+ domParser = null;
431
+ dom = null;
430
432
  }
431
433
  //
432
434
  // Pop State.
package/dist/index.js CHANGED
@@ -363,8 +363,8 @@ var ApplicationManager = class extends Component {
363
363
  nextPage = {};
364
364
  async onRequest({ href, response, pushState }) {
365
365
  var _a, _b;
366
- const domParser = new DOMParser();
367
- const dom = domParser.parseFromString(response, "text/html");
366
+ let domParser = new DOMParser();
367
+ let dom = domParser.parseFromString(response, "text/html");
368
368
  const html = dom.querySelector("html");
369
369
  const app = dom.querySelector(".app");
370
370
  this.nextPage = {
@@ -384,6 +384,8 @@ var ApplicationManager = class extends Component {
384
384
  window.history.pushState({}, this.nextPage.title, href);
385
385
  }
386
386
  this.routeHistory.push(href);
387
+ domParser = null;
388
+ dom = null;
387
389
  }
388
390
  //
389
391
  // Pop State.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lisergia/core",
3
- "version": "17.0.0",
3
+ "version": "18.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -9,7 +9,7 @@
9
9
  "dev": "tsup src/index.ts --format cjs,esm --dts --watch"
10
10
  },
11
11
  "dependencies": {
12
- "@lisergia/config-tsconfig": "17.0.0",
12
+ "@lisergia/config-tsconfig": "18.0.0",
13
13
  "auto-bind": "^5.0.1",
14
14
  "gsap": "^3.13.0",
15
15
  "lenis": "^1.3.1",
package/src/App.ts CHANGED
@@ -238,16 +238,16 @@ export class ApplicationManager extends Component {
238
238
  } = {}
239
239
 
240
240
  async onRequest({ href, response, pushState }: { href: string; response: string; pushState: boolean }) {
241
- const domParser = new DOMParser()
242
- const dom = domParser.parseFromString(response, 'text/html')
241
+ let domParser: DOMParser | null = new DOMParser()
242
+ let dom: Document | null = domParser.parseFromString(response, 'text/html')
243
243
 
244
- const html = dom.querySelector('html')!
245
- const app = dom.querySelector('.app')!
244
+ const html = dom!.querySelector('html')!
245
+ const app = dom!.querySelector('.app')!
246
246
 
247
247
  this.nextPage = {
248
248
  element: app,
249
249
  template: html.dataset.template ?? this.template,
250
- title: dom.title ?? document.title,
250
+ title: dom!.title ?? document.title,
251
251
  }
252
252
 
253
253
  if (this.transition) {
@@ -266,6 +266,9 @@ export class ApplicationManager extends Component {
266
266
  }
267
267
 
268
268
  this.routeHistory.push(href)
269
+
270
+ domParser = null
271
+ dom = null
269
272
  }
270
273
 
271
274
  //