-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Help needed with noProductionJavascript and Disqus Component #288
Comments
You have to include the bundle.js. Why did you decide to turn off
|
Well, the generated bundle.js is 8MB. And the page load is quite fast, so I did not see the benefit of having a SPA. |
Oh wow, that's huge :-) how many pages? How long does it take to generate Turning off JavaScript generation altogether is a blunt tool as you've
|
Yesterday, I wrote a new post with Markdown which had two images.When I built the site, the build.js grew to 12MB. Not good :) I realized I had configured a URL loader:
It thought that the url loader would only be used when I require the images. I did not realize that the url loader would also inline the images I use in my Markdown posts. I remove the loader and the size of the bundle.js went down to 700KB. I'm not sure whether this is the normal behavior, but if it is, please close the issue. |
This is definitely a bug. There's an open issue for it #208 I haven't fixed it yet as I haven't decided on the right pathway forward. The right solution is you add support for "content types" individually with plugins and only they get loaded into the bundle (e.g. add |
@cutemachine just curious if you solved your issue somehow? Instant navigation is not a huge selling point to me either, for large blogs. @KyleAMathews Shouldn't |
@sebastienbarre I don't want to add too much structure to html.js files. You often need to customize it when building out a site. And yes, code splitting is coming and there'll be far less interest I assume in turning off Javascript then. See https://www.bricolage.io/gatsby-open-source-work/ for a loose roadmap. Will be posting more tomorrow. |
Thanks @KyleAMathews. BTW, a RSS feed on https://www.bricolage.io/ would be great, to keep up with the news ;) |
Haha there was one but I broke it when I upgraded to what will be On Tue, Aug 30, 2016 at 6:16 PM Sébastien Barré notifications@github.com
|
@sebastienbarre Sorry for the late reply. My main problem was related to images ending up in the bundle, as outlined above. After several more posts my bundle size is now exactly 1 MB, which is still pretty big. But it is a size I think readers will tolerate. So, in short, I am also looking forward to code splitting :) |
Hi @KyleAMathews; revisiting this thread a few months later. I was wondering what the status of |
@sebastienbarre if you don't need Javascript, just don't load it :-) Then React is just your templating tool. |
Thanks. I'm planning on using 1.0, looks nice, and I guess feedback on 1.0 could help. |
Now this is unrelated, so forgive me for tacking that on. Say you have a blog with a few hundreds page, and you want to tweak the layout, CSS, etc, but not the contents. You probably focus on one single page/post while doing so, to see how the new layout/css looks. Can you prevent Gatsby from regenerating all the other pages while you are doing your adjustments, for better performance? Then regenerate everything once you are happy with the new layout/css? Thanks. |
That's exactly what the development server does — it builds everything than rebuilds only the file(s) you're changing and hot reloads the changes so you can quickly see what's chaned. |
Yes that's the dependency mechanism I'm curious about. In the scenario I'm describing, I would be working on the React components that output the HTML for the layout, I would not be working on the contents per se (the Markdown, for example). They would control how columns are laid out, where the sidebars go, etc. This is HTML that technically go on everything single page of the blog. All the pages depend on these layout components. So it would make sense that everything would be rebuilt if you modify them -- every single page. Don't get me wrong, I wouldn't blame Gatsby for not knowing my intent here: I'm only changing the layout components. Would it make sense to have an option to tell Gatsby: "hey, even though the layout components changed, please don't rebuild hundreds of pages that depend on the corresponding HTML, just this single page that I happen to be looking at because I'm working on the layout for now, not the contents. I don't need you to rebuild everything, just build this page fast so I can tweak the layout fast". Does it make sense? Thank you. |
Congrats on the upcoming 1.0; been keeping an eye on this project, chiming in once a year apparently :) I was wondering if |
Some days ago I decided not to use the bundle.js and set noProductionJavascript to true.
Now, my Disqus Component broke:
var ReactDisqusThread = require('react-disqus-thread');
Which was expected, but what is the best way to make it work?
Thanks
The text was updated successfully, but these errors were encountered: