penthouse

Generate critical css for your web pages

MIT License

Downloads
138.5K
Stars
2.6K
Committers
34

Bot releases are visible (Hide)

penthouse - 1.6.2 - tweak default forceInclude

Published by pocketjoso over 6 years ago

ForceInclude not only * (and body, html) but now also *:before and *:after, as they are quite common, and always "present" on the page. This avoids querying the DOM to test if these selectors are in the critical viewport, which will bring a (very small) speed improvement.

penthouse - 1.6.1 - explicit error when page unloads during critical css generation

Published by pocketjoso over 6 years ago

#265 has the details.

penthouse - 1.6.0

Published by pocketjoso over 6 years ago

Minor Changes

  • [email protected]: e56bb88d043d11d1738e20f33b754bba23e306e7
  • MaxElementsToCheckPerSelector option, can be used to improve performance, in case of a really large, repetative DOM: 62ac3d5e58188af513a9bf862b6bad60f9989354

Patches

  • Make async condition more clear: bd820b4ab529387fe12fd612a157f916f3a244f8
  • Debug: fix sandboxed debug message not coming through: d29ce5b7e542ee765d1026e9ef33a1cad809fc6c
  • Bugfix: default forceInclude not in use: eb9c0a26a6277b4e5b878a9eaefe6b1b566d37ff
penthouse - 1.5.0

Published by pocketjoso over 6 years ago

Minor Changes

  • Always force include rules with grid-area property: b1b3c1e82d54cddaf9aaa8303ac728bf2a5b2c68

Patches

  • Code style: 11ba55b73321c9357e3cfddb5395642e2b5517a6
  • Rm puppeteer launch arg for docker, causes problems: 392609c4c2e13d82b15b19be96212fcf4f12a7e6
  • Core: clear up async sequence: bfe45e3e83831d1d1bd737b01f7269a487214e38
penthouse - 1.4.5

Published by pocketjoso over 6 years ago

#261 - Take latest version of Puppeteer.
#260 - bugfix for createBrowser option

penthouse - 1.4.2

Published by pocketjoso over 6 years ago

Patches

  • Update deps: aa835070d11cb4dfb99c3d78cf9f4a0ee4dcc077
  • Updated dependencies: 924f6c99b7c532ada2d2114196819fdcddbe21a7
  • Core: make pageLoad function logic more clear, as non async: 5200c40f510480795f77258a4d017968e0fae54e
  • Update deps: 9f5f6af53828961a4aca35eb0884d86506de4033
  • Ci: test node 10 instead of 7: 9842f77a539e33565253938c0d114973c100840a
  • Required dep upgrade for node 10: 9bf9143fe08a91cd953cae16d39e82009a90b8e9
  • Update deps: 1d9f580ee28a6c980758fe15e6b9a263e23991f7
penthouse - 1.4.1

Published by pocketjoso over 6 years ago

#244 - Upgrade to puppeteer 1.0.0. Still not the latest version, as chromium seems to have regressed regarding the file protocol issue..

#224, #229, #240 - Do more execution in parallel instead of synchronously in sequence. In theory this should be faster, but in practice page load time (and sceenshots, if used) are big bottlenecks, so in the end performance after this changes is more or less the same, for now.

#241 - Readme update: separate simple usage examples and exhaustive options list (now in a table). Also added a separate examples folder to demonstrate how to do perform common tasks: take screenshots, use custom puppeteer browser, launch many jobs (with good performance).

#228 - Some error handling improvements, credit to @hummal

See all changes:
https://github.com/pocketjoso/penthouse/compare/v.1.4.0...v.1.4.1

penthouse - 1.4.0 - improved performance

Published by pocketjoso over 6 years ago

#222 - refactoring of css-tree usage ended up bringing roughly a 65% performance improvement over the previous version. πŸš€

The test suite was also updated in this release, now using Jest.

penthouse - 1.3.0 - fully fault tolerant

Published by pocketjoso almost 7 years ago

Removed last piece of code using non fault tolerant css (ast parser), which was used for property removal (via apartment dependency).
Made full postformatting process work on ast format, and fix issue of converting back and forth between ast and css string.

Patches

  • [BUG] return value of debuglogger expected to be an error or empty string. If no empty string debuglogger returns undefined: a54d7b5237bebfbe09d6baac778f80033f99070e
  • Clean up (dev) dependencies: d0f8ff419c3ca39197972bb19914f2fd4a3feba6
  • Rm legacy workaround for missing Array.find: 7c1120841459d2304312336a52306220875ef3b7
  • Postformatting: avoid extra parse/translate css ast step: 1bb0752408b3f462d41a11178a3a95eacbce2695
  • Postformatting: perform properties removal inside penthouse: 6c5f6e4d25e9b7c679c79554f6eadb941b09a23f
  • Postformatting: do font-face removal on ast instead of string: 94e3d24e31563c5899149f3221842621e533bf1e
  • All postformatting now work on ast: 58d242f89c3fd2d1fe16cf561ed8676c11854117
  • Postformatting: ensure font-face removal ignores qoutation differences: a5bb79207579b854ed05b21bd136407757a66dce
penthouse - 1.2.0 - fault-tolerant ast parser - faster and more accurate!

Published by pocketjoso almost 7 years ago

yarn add penthouse / npm install penthouse (@1.2.0)

swaps CSS ast parser to css-tree which is fault tolerant:
https://github.com/pocketjoso/penthouse/pull/209

More accurate πŸ”

The critical css generation will now work work regardless of any errors in the original css. If a browser can understand it, Penthouse will. No more incorrect critical css files due to missed semi colons or closing braces!

Faster 🐎

With this change penthouse never has to run it's own normalisation step for the original css, which was both slow and led to some unwanted side effects.

Note

the propertiesToRemove is temporarily in a try/catch statement now, as it will fail if the critical css contains (i.e. preserves) errors from the original css, since this part of Penthouse is not fault tolerant yet. This just means that those properties will remain. On average this seems to add about 0.5% weight to generated critical css files, and this will be fixed in an upcoming release.

Resolves

https://github.com/pocketjoso/penthouse/issues/201
https://github.com/pocketjoso/penthouse/issues/194
https://github.com/pocketjoso/penthouse/issues/105
https://github.com/pocketjoso/penthouse/issues/104

penthouse - 1.1.4 - downgrade puppeteer

Published by pocketjoso almost 7 years ago

Patches

penthouse - 1.1.0 - pageLoadSkipTimeout option

Published by pocketjoso almost 7 years ago

Fixes timeout issues for some sites.

Since switching to Chrome headless via puppeteer some websites started timing out, sites that were working previously with PhantomJS. I debugged it and via https://github.com/GoogleChrome/puppeteer/issues/662 realised it's because these sites continuously fire requests (f.e. for tracking) in such a way that the load event never fires.

Here the solution is a new pageLoadSkipTimeout option, that can be set to skip the load waiting after a certain time, and continue onwards with the critical css generation.

For most use cases this option should not be needed, as the regular load even should fire in time.

penthouse - 1.0.6 - keepLargerMediaQueries option

Published by pocketjoso about 7 years ago

Patches

  • Actually use keepLargerMediaQueries option: 79be68f3ae5ab3a4e2f8910fd7030cbf68dd1470
  • add keepLargerMediaQueries option: 152163cfa420df7a876f007fad1d712f004f8e0b
penthouse - 1.0.4 - fix options.blockJSRequests

Published by pocketjoso about 7 years ago

Patches

  • Fixed options.blockJSRequests always getting default value (true): b9ac617953ea767e8938760d31b5a9d8baa366f3
penthouse - 1.0.3 - 1.0.1 - minor fixes

Published by pocketjoso about 7 years ago

Most important was 9b83c97f4233c6b2158dad6e3eb7e8ee39a715c4 which resolves a memory leak via chrome pages that were never closed in some circumstances.

Patches

  • Rm redundant guard: 73520f81b55645028a80630a88b1055066b06b55
  • Bug: fix failed-to-open pages never closed: 9b83c97f4233c6b2158dad6e3eb7e8ee39a715c4
penthouse - 1.0.1 - propertiesToRemove

Published by pocketjoso about 7 years ago

Patches

  • [feature] propertiesToRemove: 014338a32269e8d5bf1141615e46d209fbde1dcc
penthouse - 1.0.0 β€” Better, Faster, Strongerβ€Šβ€”β€Šβœ¨,πŸ‡,πŸ’ͺ

Published by pocketjoso about 7 years ago

Release post:
https://medium.com/@pocketjoso/penthouse-1-0-official-release-ece995b0d29e

TLDR:

  • Move from PhantomJS to Chrome headless
  • Much faster execution
  • Parallel calls now work (still resource limited though)
  • screenshots option for before/after images

See #174 for details.

penthouse - 0.11.13 - avoid github dependency

Published by pocketjoso about 7 years ago

Patches

  • Use npm published css fork: 820c16629d5806f1f4faec2fd4a2116930e30e43
penthouse - 0.11.12 - support regex flags for forceInclude

Published by pocketjoso about 7 years ago

Patches

  • Pass through and use forceInclude regex flags: 6eaf7ac87bf43e4cf57f2c120e7c5cdd4fc8c9ec
penthouse - 0.11.11 - 0.11.7 - minor fixes

Published by pocketjoso about 7 years ago

  • Fix missing config.json file in lib folder on install
  • Fix problem install css fork via yarn
  • catch crashes in apartment invocation in cases when critical css has (maintained) errors.
  • Stop checking in lib folder to git
Package Rankings
Top 1.1% on Npmjs.org
Top 6.75% on Proxy.golang.org
Badges
Extracted from project README
NPM version Build Status Downloads
Related Projects