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

Question: Hard-coded absolute paths and dev instance #194

Open
jonasbn opened this issue Oct 2, 2019 · 2 comments
Open

Question: Hard-coded absolute paths and dev instance #194

jonasbn opened this issue Oct 2, 2019 · 2 comments

Comments

@jonasbn
Copy link
Contributor

jonasbn commented Oct 2, 2019

I can get the site running locally using the basic information from the README.

$ npm run dev

But the source is scattered with hard-coded absolute paths, I have tried to change them, but the changes are not reflected in the running instance.

Do you need to rebuild the contents or the GraphQL instance?

@jonasbn
Copy link
Contributor Author

jonasbn commented Oct 2, 2019

Okay, I hacked my fork to replace the hard-coded domain names in links with localhost, so I can run on localhost solely.

This is by no means a good approach since the it manipulates with the data from the GraphQL, unless the GraphQL is regarded as a general service - is it :-)

Anyway do you want a PR from my branch (localhost_ftw) it would just be for inspection, based on my above comment.

@kevinsimper
Copy link
Member

Great issue open, I knew it wasn't a great experience.

Okay two things 😄

In graphql like the github graphql api links are absolute because the link to resources, this so you could build thirdparty apps and still link to the correct issues. So in theory it is correct that it goes to copenhagenjs.dk even in development. But in reality it would be nice if it stayed in localhost for ease of testing.

Second, I would really encourage development with Storybook as that removes the need for any API interaction and for really smooth and fast front-end development.


Regarding the graphql instance, yes everything has finally been refactored to work fetching from graphql.
Running a instance can be done by $ bazel run //runs/graphql:run


What we can do:
I could see we could have a function that takes a link and then sees if it is in development and then converts it from absolute to relative 😄

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

No branches or pull requests

2 participants