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

Fix Swap wasp.png to wasp.svg #1538

Closed
wants to merge 1 commit into from
Closed

Fix Swap wasp.png to wasp.svg #1538

wants to merge 1 commit into from

Conversation

lalitkumawat1m
Copy link

Description

Fixes #1534

Select what type of change this PR introduces:

  1. Just code/docs improvement (no functional change).
  2. Bug fix (non-breaking change which fixes an issue).
  3. New feature (non-breaking change which adds functionality).
  4. Breaking change (fix or feature that would cause existing functionality to not work as expected).

Update Waspc ChangeLog and version if needed

If you did a bug fix, new feature, or breaking change, that affects waspc, make sure you satisfy the following:

  1. I updated ChangeLog.md with description of the change this PR introduces.
  2. I bumped waspc version in waspc.cabal to reflect changes I introduced, with regards to the version of the latest wasp release, if the bump was needed.

@infomiho
Copy link
Contributor

@lalitkumawat1m did you test out the templates changes locally with wasp new?

@lalitkumawat1m
Copy link
Author

It works fine

@infomiho
Copy link
Contributor

If you tested it out locally, why does the CI fail on the e2e tests? 🙃

Copy link
Member

@Martinsos Martinsos left a comment

Choose a reason for hiding this comment

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

@lalitkumawat1m Thanks for the effort!

I did a thorough review now and this PR is not in a great shape.
You mostly did global waspLogo.png -> waspLogo.svg string replace -> a lot of those replacements are incorrect or unneeded.
Also, you didn't follow those up with replacing actual waspLogo.png files with waspLogo.svg files except in one place.

In this state, I doubt that any but one example is correctly showing its logo, and all new projects that wasp would generate with wasp new I believe are also broken.

So I am not sure what you tested, when you said you tested it?

I left comments that will hopefully help with getting this PR to a better shape, but testing and understanding the changes is also a part of doing PR, so if you want to continue with this PR please put effort into that.

@@ -903,7 +903,7 @@ This was the file tree of a newly generated project in the previous version of W
│   ├── Main.css
│   ├── MainPage.js
│   ├── .waspignore
│   └── waspLogo.png
│   └── waspLogo.svg
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be changed, this and the line below, since this is ChangeLog -> so this is how it was at that point in the time and should be kept that way.

@@ -46,7 +46,7 @@ This will generate a project skeleton in the folder `myApp`. The project structu
│   │   ├── MainPage.jsx
│   │   ├── react-app-env.d.ts
│   │   ├── tsconfig.json
│   │   └── waspLogo.png
│   │   └── waspLogo.svg
Copy link
Member

Choose a reason for hiding this comment

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

Old blog post, so let's keep it as it was.

@@ -1104,7 +1104,7 @@ Ok, but what good is a function that fetches the data if we’ve got nowhere to
Let’s go now to our `src/client/MainPage.tsx` file (make sure it’s got the `.tsx` extension and not `.jsx`) and replace the contents with these below:

```tsx
import waspLogo from './waspLogo.png'
import waspLogo from './waspLogo.svg'
Copy link
Member

Choose a reason for hiding this comment

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

Also old blog post, let's keep it as it was.

@@ -52,7 +52,7 @@ waspBuild/.wasp/build/web-app/src/ext-src/Main.css
waspBuild/.wasp/build/web-app/src/ext-src/MainPage.jsx
waspBuild/.wasp/build/web-app/src/ext-src/vite-env.d.ts
waspBuild/.wasp/build/web-app/src/ext-src/vite.config.ts
waspBuild/.wasp/build/web-app/src/ext-src/waspLogo.png
waspBuild/.wasp/build/web-app/src/ext-src/waspLogo.svg
Copy link
Member

Choose a reason for hiding this comment

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

You did search and replace here, but that is not how our e2e tests work. To update them correctly, you actually need to build and run the waspc Haskell project on your machine and update the e2e tests. Which is involved, you need to have Haskell Toolchain running on your machine (GHC, Cabal). We could run these for you possibly though, if you get everything else right! But you should certainly revert these manual changes on e2e tests that you did (everything inside of e2e-test dir).

@@ -1,4 +1,4 @@
import waspLogo from './waspLogo.png'
import waspLogo from './waspLogo.svg'
Copy link
Member

Choose a reason for hiding this comment

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

This is really one of the most important changes, this change here.
This tells Wasp to, when it generates new project, use .svg in it.
But that waspLogo.svg, you need to provide it also somewhere in the data/Cli/templates/basic/src/client/ dir, I don't think you did though, I don't think you replaced that waspLogo.png with waspLogo.svg? You should do that.

@@ -1,4 +1,4 @@
import waspLogo from './waspLogo.png'
import waspLogo from './waspLogo.svg'
Copy link
Member

Choose a reason for hiding this comment

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

All these changes you did in examples -> they are not really needed. It doesn't really matter if they use waspLogo.png, it is just a file generated at start. So I would revert these changes.

Copy link
Member

Choose a reason for hiding this comment

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

Also, most of the example you corrected only half way -> you changed the import, but didn't swap .png file with .svg file. You did that in only one example. So I believe only one example works correctly.

@infomiho
Copy link
Contributor

Thank you for the contribution but this change affects our starter templates which are crucial for our Wasp CLI.

I will now close this PR as I'm not confident that we tested out the changes in a good way. If you manage to test it locally, feel free to reopen.

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.

Replace the png Wasp logo with an svg in default template
3 participants