Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access html via http? #19

Closed
TJkrusinski opened this Issue Jul 22, 2014 · 14 comments

Comments

Projects
None yet
@TJkrusinski
Copy link

TJkrusinski commented Jul 22, 2014

Love this module, however a lot of sites are sourced from templates. This means an additional step of curl-ing the rendered html to disk and then using that as the source for the module. This creates some added complexity that would prevent a lot of folks from using it. Since fs.readFile is async anyhow, would you be open to allowing sourcing the html from the network as opposed to the disk? I can send in a PR if so.

@TJkrusinski

This comment has been minimized.

Copy link
Author

TJkrusinski commented Jul 22, 2014

Also, I suppose you could allow for css to be access via http as well.

@demohi

This comment has been minimized.

Copy link

demohi commented Jul 24, 2014

+1
and command line

@addyosmani

This comment has been minimized.

Copy link
Owner

addyosmani commented Jul 24, 2014

There are two directions we could go here. One is adding support for just throwing raw HTML at Critical so you don't have to write to disk (simpler) and the other is adding support for remote resources. One argument for not going for the latter is that it's not too much additional code to get Critical working with http separately.

If we go down the remote path, I think you'd need to keep in mind that Oust will want to try extracting all of the remote stylesheets and that would need to be factored in as well. If you could talk about how you would solve this in more detail we could consider it further.

cc @sindresorhus for an FYI.

@donaldallen

This comment has been minimized.

Copy link

donaldallen commented Jul 24, 2014

Right now, is it possible to use Critical with a PHP project, like WordPress? All the examples I've seen are reading static HTML files, but for dynamically generated templates, I'm guessing it's not possible.

@thomasplevy

This comment has been minimized.

Copy link

thomasplevy commented Aug 22, 2014

@donaldallen +1 on using this with dynamic content

@almeric

This comment has been minimized.

Copy link

almeric commented Oct 17, 2014

+1 on dynamic content!

Would be awesome if we could parse a xml/json sitemap to determine what pages there are

@leggomuhgreggo

This comment has been minimized.

Copy link

leggomuhgreggo commented Nov 24, 2014

+1 awwww shucky ducky

@marcobiedermann

This comment has been minimized.

Copy link

marcobiedermann commented Apr 22, 2015

I want to integrate critical on a node server which does not have any rendered html files. So +1 from my site for url / http access

@vdclouis

This comment has been minimized.

Copy link

vdclouis commented May 22, 2015

+1

@relhtml

This comment has been minimized.

Copy link

relhtml commented Sep 4, 2015

+1 For this feature.

From my understanding, in order to determine the Critical CSS from a series of partials, you would need some sort of headless browser (PhantomJS?) to render the page as a whole, then determine the "above-the-fold" content from there?

@danimalweb

This comment has been minimized.

Copy link

danimalweb commented Sep 13, 2015

This is a great idea +1.

@bezoerb bezoerb referenced this issue Sep 15, 2015

Merged

Remote critical #100

@marcustisater

This comment has been minimized.

Copy link

marcustisater commented Nov 8, 2015

+1 would love to use this in a WordPress project.

@bezoerb

This comment has been minimized.

Copy link
Collaborator

bezoerb commented Dec 14, 2015

Remote access is available in master.
See #94 for details.
Anyone else willing to test this?

@bezoerb

This comment has been minimized.

Copy link
Collaborator

bezoerb commented Jan 18, 2016

Closing this as the requested feature is released in v0.7.0

@bezoerb bezoerb closed this Jan 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.