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

Image untouched transformer plugin #1513

Closed
wants to merge 3 commits into from

Conversation

chiedo
Copy link

@chiedo chiedo commented Jul 15, 2017

I kept running into issues with Sharp. In my case I didn't really need sharp and things build much faster without it.

This is a plugin I've been using locally to avoid sharp entirely.

@chiedo chiedo changed the title Image untouched plugin Image untouched transformer plugin Jul 15, 2017
@KyleAMathews
Copy link
Contributor

KyleAMathews commented Jul 15, 2017

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 15, 2017

Deploy preview ready!

Built with commit 8a1c8c8

https://deploy-preview-1513--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 15, 2017

Deploy preview ready!

Built with commit 8a1c8c8

https://deploy-preview-1513--gatsbyjs.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 15, 2017

Deploy preview ready!

Built with commit 8a1c8c8

https://deploy-preview-1513--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

So you want to be able to query for images but not process them in any way?

Could you just add this to ability gatsby-transformer-sharp? I think that'd be a lot less confusing and also often what you want as in some parts of your site you could process thumbnails and in others you don't.

Also curious why you're seeing so much overhead from using Sharp? Gatsbygram creates 1000s of thumbnails and finishes within a couple of minutes on the first run and then since images aren't reprocessed on subsequent runs, adds no overhead for incremental builds.

Also, as an FYI, but Node type names should be tied to the name of the plugin that creates them. As this is, it couldn't be installed alongside gatsby-transformer-remark as the two type names would conflict and throw an error.

@chiedo
Copy link
Author

chiedo commented Jul 19, 2017

Hi @KyleAMathews

Exactly! I just want my images references working. Nothing else. I handle all the compression etc ahead of time before I commit my source images.

I'll add this to gatsby-transformer-sharp.

The couple of minutes gets annoying when developing rapidly and clearing the .cache and public folder when needed. Also, images aren't reprocessed on subsequent runs on the local machine but if I have other developers on the project, they have to wait also. I'd rather have all my images processed once and just process my source images. There's no reason for them to ever need to be processed again in exactly the same way in my opinion. Also when I run into Sharp errors that prevent my build, I'd rather not have Sharp involved at all because I don't actually need or want it.

In regards to the node type name, that makes perfect sense! I will remember that for any plugins I create in the future!

Also for what it's worth, I think gatbsy-transformer-sharp won't mean anything to people unless they know what the sharp library is. gatsby-transformer-images seems like a better name. But that's just my opinion. It just seems more clear to the newcomer who doesn't care how images are processed but just wants their images working.

@chiedo chiedo deleted the gatsby-transformer-untouched branch July 19, 2017 12:34
@chiedo
Copy link
Author

chiedo commented Jul 19, 2017

Here you go! #1556

@KyleAMathews
Copy link
Contributor

The couple of minutes gets annoying when developing rapidly and clearing the .cache and public folder when needed. Also, images aren't reprocessed on subsequent runs on the local machine but if I have other developers on the project, they have to wait also.

I think the right solution here is to make GraphQL queries run on demand in development. Right now all queries for the entire site are run when starting the development server. Right now this mostly clearly causes trouble for processing images since that's the slowest data transformation right now but there'll be other slow data transformations + for really large sites, even very fast transformations will start to feel slow.

BTW, you should never need to delete public. Is there a reason you're doing that?

Clearing the .cache directory should only be necessary when building custom transforms and even that should eventually be able to be avoided once we add support for partial cache invalidation e.g. trace a change to a plugin to the nodes it touches.

@chiedo
Copy link
Author

chiedo commented Jul 19, 2017

Haha There's no particular reason at all.

I just knew that stale data was causing me frustration so I deleted anything that could be the culprit. Wasn't sure if it was the .cache or the public folder.

All that makes perfect sense though.

@KyleAMathews
Copy link
Contributor

:-)

Yeah, would love to do a deep dive on improving caching sometime... sigh.

@chiedo
Copy link
Author

chiedo commented Jul 19, 2017

Haha sounds like a lot of work.

Still awesome as-is though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants