@lisergia/core 16.0.1 → 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.
@@ -0,0 +1,20 @@
1
+
2
+ 
3
+ > @lisergia/core@17.0.0 build
4
+ > tsup src/index.ts --format cjs,esm --dts
5
+
6
+ CLI Building entry: src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.5.0
9
+ CLI Target: node16
10
+ CJS Build start
11
+ ESM Build start
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
+ DTS Build start
17
+ DTS ⚡️ Build success in 763ms
18
+ DTS dist/index.d.cts 5.82 KB
19
+ DTS dist/index.d.ts 5.82 KB
20
+ ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
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
+
14
+ ## 17.0.0
15
+
16
+ ### Major Changes
17
+
18
+ - Fix bug with pushState.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @lisergia/config-tsconfig@17.0.0
24
+
3
25
  ## 16.0.0
4
26
 
5
27
  ### 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.
@@ -437,7 +439,7 @@ var ApplicationManager = class extends Component {
437
439
  }
438
440
  this.routePushState = false;
439
441
  this.route = document.location.pathname;
440
- this.routePushState = false;
442
+ this.routePushState = true;
441
443
  }
442
444
  //
443
445
  // Scroll.
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.
@@ -394,7 +396,7 @@ var ApplicationManager = class extends Component {
394
396
  }
395
397
  this.routePushState = false;
396
398
  this.route = document.location.pathname;
397
- this.routePushState = false;
399
+ this.routePushState = true;
398
400
  }
399
401
  //
400
402
  // Scroll.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lisergia/core",
3
- "version": "16.0.1",
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": "16.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
  //
@@ -278,7 +281,7 @@ export class ApplicationManager extends Component {
278
281
 
279
282
  this.routePushState = false
280
283
  this.route = document.location.pathname
281
- this.routePushState = false
284
+ this.routePushState = true
282
285
  }
283
286
 
284
287
  //