pdfgen 0.4.2 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e28174877f0b28647fd1653c187ecf4bd0fe3b7
4
- data.tar.gz: 98e2bbed6e8f2d4bf6252432f612e2cabee4540f
3
+ metadata.gz: b15e1c362c296f17ef5cced91eb85d3771ae1bf7
4
+ data.tar.gz: b559a21a82d92ca01bfbec59a7847e43a786a38e
5
5
  SHA512:
6
- metadata.gz: a47ffc3ad2f07bee137731ec1187da17e3c5b601ba0797ff6cf3b6613037f096bf8ca217dcf23165fa3a9a16a24a861e810c281dab84279b972bf332247351ac
7
- data.tar.gz: 4bdb05250de0ec74f63dbf913387957add058f2c82d693c5a12a5237cf324389631da9bb848d82f288a529f74117addaca8c73519937c927cbcb9c88aff1434e
6
+ metadata.gz: 8e1199a39edd356c000e58064ff09cc8473aaf800cccb6daa5e2bd6f39fc1418eee0caed69930b6ac98bb2d2459dd34b5aa75d0b8e6a040da4969852ec50613b
7
+ data.tar.gz: 700f05c1e96c61fb424f6c43a05aec1456ed6922da8272683c2ab139167e2b94b54f411dd5b95a7ab3e56c19dcff520dbd040725fd061ded4514dcd91531994e
@@ -1,3 +1,24 @@
1
+ ## Pdfgen 0.5.0 (September 3, 2018)
2
+
3
+ * Changes how the wait for timeout works slightly.
4
+
5
+ This new way starts the wait prior to putting the HTML in the page. Now that we can
6
+ utilize the waitUntil navigation feature in Puppeteer, we might as well start the
7
+ clock before waiting for that amount of time. This way, the maximum wait time should
8
+ be roughly the timeout instead of the timeout + how long the page takes to load.
9
+
10
+ * Changes how static HTML is put into the page.
11
+
12
+ This new method allows us to use the navigation wait helpers so there should be
13
+ almost no need for timeout waiting if passing Pdfgen HTML instead of a URL.
14
+
15
+ Sadly, this still does not load assets on the page so inlining your assets is still
16
+ required.
17
+
18
+ * Moves emulateMedia and setViewport steps to be before setting content or navigation
19
+ so that the browser won't need to rerender the content and hopefully we improve
20
+ performance some.
21
+
1
22
  ## Pdfgen 0.4.2 (June 8, 2018)
2
23
 
3
24
  * Adds checking of minimum Node version required.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.5.0
@@ -41,12 +41,7 @@ stdin.on('end', function () {
41
41
  (async() => {
42
42
  const browser = await puppeteer.launch(launch_options);
43
43
  const page = await browser.newPage();
44
-
45
- if (typeof url !== 'undefined' && url) {
46
- await page.goto(url, url_options);
47
- } else {
48
- await page.setContent(html);
49
- }
44
+ let wait_promise = null;
50
45
 
51
46
  if (typeof media_type !== 'undefined' && media_type) {
52
47
  await page.emulateMedia(media_type);
@@ -57,7 +52,21 @@ stdin.on('end', function () {
57
52
  }
58
53
 
59
54
  if (typeof wait_for_timeout !== 'undefined' && wait_for_timeout) {
60
- await page.waitFor(wait_for_timeout);
55
+ wait_promise = page.waitFor(wait_for_timeout);
56
+ }
57
+
58
+ if (typeof url !== 'undefined' && url) {
59
+ await page.goto(url, url_options);
60
+ } else {
61
+ await page.goto("data:text/html," + html, { waitUntil: 'networkidle0' });
62
+ }
63
+
64
+ // If we were given a wait timeout, we should wait for the rest of the timeout now. That way,
65
+ // the timeout will act as a minimum amount of time to wait for the page. If it's greater than
66
+ // how long the waitUntil idle took, it will wait for the extra time. If it is shorter than how
67
+ // long the page actually needs, then it will not add any time.
68
+ if (typeof wait_promise !== 'undefined' && wait_promise) {
69
+ await wait_promise;
61
70
  }
62
71
 
63
72
  if (typeof debug_mode === 'undefined') {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdfgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Fox