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

[v2] adjust createLocation calls after #4714 #4805

Merged
merged 1 commit into from
Apr 3, 2018

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Apr 2, 2018

gatsby-link changes in #4714 broke this component for me, reverting them fixes it

@jquense was those changes intentional? I can look more in depth into it, just let me know

@ghost ghost assigned pieh Apr 2, 2018
@ghost ghost added the review label Apr 2, 2018
@jquense
Copy link
Contributor

jquense commented Apr 2, 2018

The change was intentional, but untested. The idea was that the prefix is set on the router, so the Link component doesn't need to do anything, since the router should automatically add the prefix.

@@ -17,6 +17,12 @@ function normalizePath(path) {
return path.replace(/^\/\//g, `/`)
}

function createLocation(path, history) {
var location = cL(path, null, null, history.location)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the problem was i just assuming we were calling these two functions with the same arguments. but it looks like the RR createLocation has a different signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it seems that this local createLocation signature is different than one imported from history, I will update this PR and instead of reverting your changes will adjust params in createLocation calls

@pieh pieh changed the title [v2] revert gatsby-link change from #4714 [v2] adjust createLocation calls after #4714 Apr 2, 2018
@pieh
Copy link
Contributor Author

pieh commented Apr 2, 2018

updated this PR

@KyleAMathews KyleAMathews merged commit 8ff0414 into gatsbyjs:v2 Apr 3, 2018
@ghost ghost removed the review label Apr 3, 2018
@KyleAMathews
Copy link
Contributor

Thanks for looking into this @pieh!

m-allanson added a commit to m-allanson/gatsby that referenced this pull request Apr 4, 2018
* v2:
  Docgen improvements (gatsbyjs#4757)
  adjust createLocation calls after gatsbyjs#4714 (gatsbyjs#4805)
  Update breaking changes doc
  use basename for router instead of prefixing in link (gatsbyjs#4714)
  Fix inlined styles with path-prefixing (gatsbyjs#4717)
  Publish
  Upgrade & format
  [v2][wip] Upgrade Gatsby v2 to webpack 4 (gatsbyjs#4588)
  fix some jsdoc parsing bits (gatsbyjs#4675)
  [v2] fix wrong merge
  Publish
  Migrate to React Hot Loader v4 (gatsbyjs#4500)
  [v2] Fix deleteNodes deprecation (gatsbyjs#4453)
  Publish
  Switch to latest version of sharp to prevent yarn/npm errors (gatsbyjs#4417)

# Conflicts:
#	packages/gatsby/package.json
#	packages/gatsby/src/utils/webpack-utils.js
#	yarn.lock
@pieh pieh mentioned this pull request Apr 12, 2018
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