-
Notifications
You must be signed in to change notification settings - Fork 4
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
fix/load hypercerts from root #13
Conversation
Remix gives us the also please check out the failing test, i can't see how my changes would have caused it to fail ?? |
thanks, just a few suggestions:
|
@baumstern right, each route can have its own loader. maybe i misunderstood but i thought we were trying to load HC data independently of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- think you can remove
.DS_Store
and add it to our gitignore. -
useRouteLoader
can use any loader based on its route, including "root"! as per here - seems your commit failed a check, please investigate it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
answer here
it wasn't tracked or added to my file structure. now i know 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol apple has built in trolling 💀
import "./tailwind.css"; | ||
|
||
export const loader = async ({ request }: LoaderFunctionArgs) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetch /impact-reports
instead - which does basically what this function does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the intention is to use the loader in root
instead of impact-reports.tsx
, and delete that file.
maybe i am still missing a piece but i am not able to get data into _index
route from impact-reports
route. using fetch(/impact-reports)
doesn't trigger its loader. with the code from impact-reports.tsx
moved into root.tsx
i am able to use the data in _index
route because the loader inroot
is already active.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somehow missed this but I gave it a shot just now and I ran into the same issue! Turns out just fetching /impact-reports
won't work as its an incomplete URL. Here's what worked (in _index.tsx
):
export const loader = async ({ request }: LoaderFunctionArgs) => {
const url = new URL(request.url);
const response = await fetch(`${url.protocol}//${url.host}/impact-reports`);
const data = await response.json();
return json(data);
};
This allows the fetch to work dynamically on localhost and when its deployed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const response = await fetch(
${url.protocol}//${url.host}/impact-reports
);
cool ✨
did you find this referenced in remix docs somewhere? i couldn't find it. i had tried hardcoding the full path couldn't get it to resolve.
}; | ||
|
||
// custom hook to pass the loader's type to other routes | ||
export function useRootLoaderData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to export a custom hook. in any other route just use useRouteLoaderData<typeof loader>("root")
and it will work. this custom hook would cause confusion as it hijacks the original hook.
A loader can be in a route, and when it is, any |
@thebeyondr as daehyun noted above, the test has been removed in #10. |
I see. The backend branch is new to me. I think you started working from something that is also in progress. You can continue to make the additional changes on your end and when #10 is merged to main, you can merge main into this branch and then merge wherever from there |
When I say "to work from it", I mean add features based on the PR. I wouldn't advise this until the PR is merged. If you're trying to review a PR or update the existing feature being proposed, vscode/cursor allows you to pull PRs and the github cli offers a command for it. We can do a call if you think that would be helpful |
I don't usually work from PRs as they are volatile. In this case, I'd wait until merges are complete or I've spoken to the person responsible for the pr for a timeline for merging their work so I can do mine |
ok. but as i am being asked to review and approve the contents of #10, i was trying to see if i could get it to deliver the data it is supposed to be retrieving. |
Gotcha. That context was entirely lost on me as this PR seems to be proposing a use for what is in #10, not a test of its functionality. |
yes i was trying to suggest updates to the existing feature because i don't think the this is pretty cool ✨✨ vsCode extension for github PRs |
@CJ-Rose @baumstern thinking more about this and I think the loader should be moved to the While the implementation is allowed in Remix, I don't think its right for our use case. |
PR #10 has been merged into the You can use this commands to rebase PR:
|
@baumstern @thebeyondr closing this PR and removing |
No description provided.