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

Upgrade to Gatsby V3 #66

Merged
merged 11 commits into from
Mar 29, 2021
Merged

Upgrade to Gatsby V3 #66

merged 11 commits into from
Mar 29, 2021

Conversation

daugsbi
Copy link
Contributor

@daugsbi daugsbi commented Mar 15, 2021

Upgraded dependencies to new versions.
Load browserslist config from package.json via import instead of node's fs module. Fallback to default config from gatsby.

I couldn't find a way to use .browserslistrc config or gatsby's helper function without reading from the filesystem.

Closes #65

@creotip
Copy link

creotip commented Mar 18, 2021

Tried your solution, but it's breaking SSR injection

@daugsbi
Copy link
Contributor Author

daugsbi commented Mar 18, 2021

@creotip Did you get an error?

You probably need to build the plugin first, because the generated js files are not in the repository itself

cd node_modules/gatsby-plugin-material-ui
yarn install --frozen-lockfile
yarn run build

@creotip
Copy link

creotip commented Mar 18, 2021

Getting the same error:
warning WebpackError: Unsafe builtin usage fs.existsSync

@iDVB
Copy link

iDVB commented Mar 24, 2021

Any updates on this? I can support in testing if needed. We're trying to upgrade to Gatsby 3 and having the same issue.

@daugsbi
Copy link
Contributor Author

daugsbi commented Mar 24, 2021

To test it, I've used https://gitpkg.now.sh/.

yarn add 'https://gitpkg.now.sh/daugsbi/gatsby-plugin-material-ui/gatsby-plugin-material-ui?master'

If you have a theme, you can add it to resolutions in your package.json:

 "resolutions": {
        "gatsby-plugin-material-ui": "https://gitpkg.now.sh/daugsbi/gatsby-plugin-material-ui/gatsby-plugin-material-ui?master",
    }

Then I've manually build it in the package folder, because the final js files are not part of the repository:

cd node_modules/gatsby-plugin-material-ui
yarn install --frozen-lockfile
yarn run build

Let me know if this works

@pepijn-vanvlaanderen
Copy link

Tested it and works for me!

@daugsbi
Copy link
Contributor Author

daugsbi commented Mar 29, 2021

@hupe1980 Any news on this one? Upgrade node in CircleCI is also necessary

@hupe1980
Copy link
Owner

@daugsbi I just updated the node version. Can you update your PR please?

@hupe1980
Copy link
Owner

@daugsbi The unittest will run again if you add the following:

// gatsby-plugin-material-ui/package.json
 "moduleNameMapper": {
      "material-ui-plugin-cache-endpoint": "<rootDir>/src/__tests__/dummy-styles-provider-props.js",
      "/package.json": "<rootDir>/src/__tests__/dummy-pkg.json"
    }

@hupe1980
Copy link
Owner

@daugsbi The e2e tests run on my local pc after I've updated all the dependencies

@daugsbi
Copy link
Contributor Author

daugsbi commented Mar 29, 2021

@hupe1980 Thanks a lot 👍

Can you fix the e2e tests then?

@hupe1980
Copy link
Owner

@daugsbi You just have to run yarn upgrade in the root project to update the yarn.lock.

@hupe1980 hupe1980 self-requested a review March 29, 2021 21:09
Copy link
Owner

@hupe1980 hupe1980 left a comment

Choose a reason for hiding this comment

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

LGTM! Thx

@hupe1980 hupe1980 merged commit cbd3cf2 into hupe1980:master Mar 29, 2021
@daugsbi
Copy link
Contributor Author

daugsbi commented Mar 29, 2021

Yeah, green looks much better 😄

Thanks for your instant help

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.

Webpack warnings on build after upgrade to gatsby v3
5 participants