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

feat: Photo storage example #355

Merged
merged 16 commits into from Dec 15, 2022
Merged

feat: Photo storage example #355

merged 16 commits into from Dec 15, 2022

Conversation

sea-snake
Copy link
Contributor

Example React application that shows how to upload files to an assets canister with the @dfinity/assets package.

Related PR dfinity/agent-js#603

@sesi200
Copy link
Contributor

sesi200 commented Sep 28, 2022

Thank you very much for this PR! I'd like to get back to this once dfinity/agent-js#603 is merged. Feel free to ping me when you think I should take another look

hosting/photo-storage/README.md Outdated Show resolved Hide resolved
hosting/photo-storage/README.md Outdated Show resolved Hide resolved
hosting/photo-storage/README.md Outdated Show resolved Hide resolved
hosting/photo-storage/package.json Outdated Show resolved Hide resolved
hosting/photo-storage/README.md Outdated Show resolved Hide resolved
@sea-snake
Copy link
Contributor Author

Updated MR with above suggestions and fixed some bugs (replaced masonry dep with a more reliable masonry dep)

@sesi200
Copy link
Contributor

sesi200 commented Nov 3, 2022

Looking nice, thanks a lot! Any chance you can also add a very basic e2e test to alert us (me) when a dfx update breaks the example? This is a good example you could work from. It doesn't need to be anything fancy

@sesi200
Copy link
Contributor

sesi200 commented Nov 3, 2022

Also, the rust-basic-bitcoin failed test will be fixed in master in a few minutes

@sea-snake
Copy link
Contributor Author

Looking nice, thanks a lot! Any chance you can also add a very basic e2e test to alert us (me) when a dfx update breaks the example? This is a good example you could work from. It doesn't need to be anything fancy

Added a workflow that checks if the project builds and deploys successfully.

@sesi200
Copy link
Contributor

sesi200 commented Dec 12, 2022

With npm i and npm run build I get the following error:

Failed to compile.

Module not found: Error: Can't resolve 'assert' in '/Users/ssiff/Desktop/examples/hosting/photo-storage/node_modules/@dfinity/identity/lib/esm/identity'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }

Is this a problem introduced by myself or something wrong with the code?

@sea-snake
Copy link
Contributor Author

sea-snake commented Dec 14, 2022

Is this a problem introduced by myself or something wrong with the code?

Seems like a problem in @dfinity/identity 0.14.1, updating dependencies to 0.15.0 seems to fix it.

hosting/photo-storage/README.md Outdated Show resolved Hide resolved
@sesi200
Copy link
Contributor

sesi200 commented Dec 15, 2022

Thank you for fixing it that quickly! Can confirm it work now. Thank you very much for contributing!

@sesi200 sesi200 merged commit 9c68071 into dfinity:master Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants