Skip to content

fix(p2p-editor): use raw file bytes and unique Hyperdrive keys for uploads #71

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

akhileshthite
Copy link
Contributor

@akhileshthite akhileshthite commented Apr 30, 2025

Each publish creates a new Hyperdrive, so uploading index.html won’t overwrite the previous site.

Before:
Screenshot 2025-04-30 at 4 14 52 AM

After (ignore the styling):
Screenshot 2025-04-30 at 4 14 17 AM

Copy link
Member

@RangerMauve RangerMauve left a comment

Choose a reason for hiding this comment

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

Ty for tacking a crack at it. I was actually thinking about this recently and I think it'd be better if we did the following instead of what's there now:

  • Have a "title" field used to derive the file name
  • Always publish to the same IPNS/Hyper collection but under different files
  • Make sure we base the styles off of theme/style.css
  • Update the tutorial to reflect these changes

The benefit here is we'd have an easier time managing published sites and have an easy way to showcase all your fiddles. Should also make pinning more straightforward for those that want it.

IMO if we want to get rid of the form data method here for uploading we should do so for both protocols. In this case we're only ever uploading one file so we might as well do the simple PUT method.

Mind moving the changes to explore.md into a separate PR?

@akhileshthite akhileshthite requested a review from RangerMauve May 7, 2025 08:46
@akhileshthite
Copy link
Contributor Author

akhileshthite commented May 7, 2025

IPNS is not necessary here since each file update generates a new IPFS CID. But yeah it's hard to manage.

I will update the tutorial once this looks good to you.
Screenshot 2025-05-07 at 1 25 00 AM

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.

2 participants