-
Notifications
You must be signed in to change notification settings - Fork 129
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
Feature: cra template overhaul #181
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
@@ -2,14 +2,13 @@ | |||
// https://create-react-app.dev/docs/proxying-api-requests-in-development/#configuring-the-proxy-manually | |||
|
|||
module.exports = function (app) { | |||
app.use("/manifest.json", function (req, res, next) { | |||
app.use('/manifest.json', function (req, res, next) { |
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.
If we only have the cors proxy for the manifest can the icons be properly loaded?
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.
Good catch. No, they can't. I'll just apply it for every route
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.
Hmm, thinking about it a little bit more I'm not sure. The icons can be properly loaded via HTML img
tag. They cannot be fetched from js code, though.
The interface doesn't display it because it tries to fetch it first: https://github.com/gnosis/safe-react/blob/development/src/routes/safe/components/Apps/utils.ts#L266 and if it doesn't work it doesn't try to use the URL anymore and uses placeholder image
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.
🤦 ... yeah not optimal not sure ...
Little bit different question shouldn't react app rewired also cover this?
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.
It's not well maintained and already has some caveats safe-global/safe-react-apps#88
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.
If we can stay with "react-scripts" it's better to stay with it, chances of getting updates are way higher
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.
Makes sense :)
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.
Great stuff! 🎉
<Button size="lg" color="primary" onClick={submitTx}> | ||
Submit | ||
</Button> | ||
)} |
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.
This was kinda useful I think.
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.
Why? I think developers will remove it anyway and implement it themselves.
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.
I used it in Drain Safe. A good UX pattern. But yeah, it's pretty trivial to reimplement.
|
…ature/cra-example-test
This PR does an overhaul of our create-react-app template:
react-app-rewired
which is not well maintained and we didn't really need it, it could be replaced via a hack with cra'ssetupProxy.js
Testing:
npx create-react-app safe-app-template --template file:./safe-apps-sdk/packages/cra-template-safe-app
- The path assumes you are at the same directory as a safe-apps-sdk repo folderyarn start
andyarn test