wesbos / master-gatsby

slick slices eh
358 stars 388 forks source link

Slow build and hot reloading #133

Open ecodoc opened 3 years ago

ecodoc commented 3 years ago

I am an amateur and I don't know any other way to make a comment so I apologize if this is the wrong way to do it.

I realize that I am way behind in this course and a lot has changed. On my iMac running macos Big Sur, the build step for the simplest possible index.js as described in Module 2 Step 4 Pages takes a minimum of 3 - 5 minutes whereas the video makes it seem much faster. Secondly, there is no hot loading and the website does not update until the file is saved in vs code. I have followed all the steps as described in the videos, but maybe I missed something about build speed and hot loading.

Asjas commented 3 years ago

Hey @ecodoc

the build step for the simplest possible index.js as described in Module 2 Step 4 Pages takes a minimum of 3 - 5 minutes

Yes, that is quite slow. Running a build with npm run build shouldn't take more than a minute at most if you only have a index.js file.

Can you try npm run build on any small Gatsby starter project to see if those build that slow as well? If it also takes a lot of time then it could be your computer that is the issue.

You can download any basic starter here to test https://www.gatsbyjs.com/starters/

the website does not update until the file is saved in vs code

That is the default way to update the page during development, you have to save the code in the file before the website will show what you typed. There is an experimental fast-refresh loader that you can enable by setting this in your .env file, fast-refresh will update the page as you type without you needing to save the file.

I don't know if you have that enabled or not? Wes shows this at some later point in the course. 🙂

GATSBY_HOT_LOADER=fast-refresh
ecodoc commented 3 years ago

Thanks very much for your reply.

Was it proper for me to use Git 'issues' or is there preferred way to make comments and ask questions? I'll see if I can try an npm build on another simple site. My first thought is my computer. I'm still learning.

I should have known that you have to save the vs code file first because that is the way Go Live works. When I reviewed the video I caught Wes Bos saying the word 'save', which went by very fast and casually, and the video made it look like the updating was happening in real time.

I have tried everything I could find to make emmet work as the video suggests, but not able to make it work. The Ctrl-E setting did not work. So I am just typing the code in.

Cheers and thanks again,Ed

On Saturday, October 23, 2021, 10:29:38 AM PDT, A-J Roos ***@***.***> wrote:  

Hey @ecodoc

the build step for the simplest possible index.js as described in Module 2 Step 4 Pages takes a minimum of 3 - 5 minutes

Yes, that is quite slow. Running a build with npm run build shouldn't take more than a minute at most if you only have a index.js file.

Can you try npm run build on any small Gatsby starter project to see if those build that slow as well? If it also takes a lot of time then it could be your computer that is the issue. https://www.gatsbyjs.com/starters/

the website does not update until the file is saved in vs code

That is the default way to update the page during development, you have to save the code in the file before the website will show what you typed. There is an experimental fast-refresh loader that you can enable by setting this in your .env file, fast-refresh will update the page as you type without you needing to save the file.

I don't know if you have that enabled or not? Wes shows this at some later point in the course. 🙂 GATSBY_HOT_LOADER=fast-refresh — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Asjas commented 3 years ago

Was it proper for me to use Git 'issues' or is there preferred way to make comments and ask questions?

It's usually easier and faster to help if you join the Wesbos Slack community, you should have received an email with an invite link when you bought the course. Most of Wes' students are on the Slack community so you'll have many people who will see your questions. 🙂

I have tried everything I could find to make emmet work as the video suggests, but not able to make it work.

Emmet does not work in JavaScript files by default, it something you must enable yourself. These are the settings you have to add to your settings.json file in VS Code.

"emmet.includeLanguages": { 
  "javascript": "javascriptreact", 
}, 
"emmet.triggerExpansionOnTab": true,
ecodoc commented 3 years ago

I found the Slack channel with a "Magic" sign in link that is only good for 24 hours. Will I need a password for the Slack channel? Emmet is working now - Thanks!

On Sunday, October 24, 2021, 03:32:14 AM PDT, A-J Roos ***@***.***> wrote:  

Was it proper for me to use Git 'issues' or is there preferred way to make comments and ask questions?

It's usually easier and faster to help if you join the Wesbos Slack community, you should have received an email with an invite link when you bought the course. Most of Wes' students are on the Slack community so you'll have many people who will see your questions. 🙂

I have tried everything I could find to make emmet work as the video suggests, but not able to make it work.

Emmet does not work in JavaScript files by default, it something you must enable yourself. These are the settings you have to add to your settings.json file in VS Code. "emmet.includeLanguages": { "javascript": "javascriptreact", }, "emmet.triggerExpansionOnTab": true, — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Asjas commented 3 years ago

I found the Slack channel with a "Magic" sign in link that is only good for 24 hours. Will I need a password for the Slack channel?

Yes, you would create an account with an email and password to then log in. 🙂