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

Update dependencies #674

Merged
merged 14 commits into from
Jul 7, 2022
Merged

Update dependencies #674

merged 14 commits into from
Jul 7, 2022

Conversation

maxcell
Copy link
Contributor

@maxcell maxcell commented Jun 15, 2022

Summary

This project had many versions of dependencies to update so this works to make sure everything is up to date as possible. In the process of doing that we are now on Webpack 5 which should afford quite a huge speed boost.

We've also made sure to utilize the NetlifyCMS through the CDN as opposed to a dependency. This follows more to the patterns established on <netlifycms.org>. The package updates also had a huge amount of inspiration from the previous work we did on victor-hugo from a previous colleague.

A notable upgrade that we had to do is also replace node-sass as it is now through the Dart implementation under sass. This at the surface doesn't change any APIs but the internals are significantly different and require the correct bindings for the project.

Test Plan

For the deploy preview:

  • Validate that you can reach all pages in the deploy preview
  • Go into the Netlify app and invite yourself as a user to the CMS (https://app.netlify.com/sites/master-template-one-click-hugo-cms/identity). My suggestion would to use something like +hugo somewhere in your email before @ so you can filter it out later if you'd like.
  • Accept the invite in your email and set the password
  • Navigate to /admin under the deploy preview
  • Log in with your account
  • Make sure you can reach all pages under there
  • Make sure to not add a new page or edit because I believe that will automatically commit it to the main branch.

For local development:

  • You will need to clone the project down and switch to the different branch
  • Install the dependencies
  • And make sure you can run with ntl dev
  • If you'd like to run and validate the CMS functionality, under static/admin/config.yml under backend, add this line local_backend: true
  • In one terminal run npx netlify-cms-proxy-server and in another run yarn start
  • This should make it all ready to go!

Documentation

@maxcell maxcell changed the title Pw/update deps Update dependencies Jun 22, 2022
@maxcell maxcell requested review from taty2010 and tzmanics June 22, 2022 19:21
@maxcell maxcell marked this pull request as ready for review June 22, 2022 19:21
@maxcell
Copy link
Contributor Author

maxcell commented Jun 27, 2022

You'll notice a TON of files changed and that's because I renamed all the CSS files to SCSS. Especially because many of these files were using Sass it made more sense to rename them. Before, they were just silently failing. Happy to discuss any of these changes more.

@tzmanics
Copy link
Contributor

tzmanics commented Jul 1, 2022

this may just be my machine but whenever i run yarn start i get an un-styled version of the site but with npm start it is perfect. which is fin except when i run ntl dev i only get options for yarn

CleanShot 2022-07-01 at 15 48 40@2x

this could be solved by setting dev settings in the toml to npm start to match the npm preference in the package.json scripts. if i'm the only one seeing this tho maybe it's not necessary.

@maxcell
Copy link
Contributor Author

maxcell commented Jul 6, 2022

Hmmm... I can't seem to reproduce this effect @tzmanics. It could be a timing issue where the build of the HTML finishes first before the CSS is ready and maybe it is a flash unstyled content. Can you try deleting it and trying it again, maybe after installing dependencies let yarn start wait a bit and if nothing happens just refresh the browser page to see if it flashes the content?

@maxcell
Copy link
Contributor Author

maxcell commented Jul 6, 2022

If you never see it with npm start I'd be down for us changing! One thing I am curious on is if you had any issues installing any dependencies? I had some issues with React 18 so I downgraded locally to React 17 but otherwise is all good!

Copy link
Contributor

@tzmanics tzmanics left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IT WORKS!!!!!

@taty2010
Copy link
Contributor

taty2010 commented Jul 6, 2022

If you never see it with npm start I'd be down for us changing! One thing I am curious on is if you had any issues installing any dependencies? I had some issues with React 18 so I downgraded locally to React 17 but otherwise is all good!

Ran into this issue when using npm i but everything installed just fine with yarn
Screen Shot 2022-07-06 at 3 15 33 PM

@maxcell
Copy link
Contributor Author

maxcell commented Jul 6, 2022

Ran into this issue when using npm i but everything installed just fine with yarn Screen Shot 2022-07-06 at 3 15 33 PM

Super interesting! I think I need to downgrade React no matter what because I suspect the lockfile has the right version needed but if you try to swap package managers it might end up breaking. Thank you for testing this @taty2010!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is probably not meant to be committed.

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.

4 participants