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

Support to enable or disable the 'Open repo in Remix' link #5

Merged

Conversation

acuarica
Copy link

Related to ethereum/sourcify#1385, this PR adds support to enable (default) or disable the 'Open repo in Remix' link.

image

It does so by setting the Docker build argument HIDE_OPEN_IN_REMIX. When set to 1 it will hide the link. Otherwise it leaves it unchanged (default).

When HIDE_OPEN_IN_REMIX is set to 1, a patch to remove the link is applied. The patch was originally created here hashgraph/hedera-sourcify#69.

Signed-off-by: Luis Mastrangelo <luis@swirldslabs.com>
@marcocastignoli
Copy link
Member

marcocastignoli commented May 16, 2024

Hey @acuarica, this works. But I think that injecting an object in the javascript is better. So instead of using a git patch we can:
1.

ARG HIDE_OPEN_IN_REMIX
COPY hide-open-in-remix.patch /hide-open-in-remix.patch 
RUN if [ "$HIDE_OPEN_IN_REMIX" = "1" ]; then 
   cd h5ai;
   # Push to a new new custom.js `{ hideOpenInRemix: true }`;
fi
  1. Inside a/src/_h5ai/public/js/lib/view/view.js b/src/_h5ai/public/js/lib/view/view.js import that config file and manage the case with a js condition

What do you think?

@acuarica
Copy link
Author

Hi @marcocastignoli, thanks for taking the time to take a look at this.

The main issue I see is that view.js comes from yet another repo. I chose to modify it with a patch to avoid modifying yet another level repo.

Having a js condition means to evaluate this at runtime. Given this is a build time flag, patching at build time doesn't sound too bad and it looks clearer what is the intent.

@marcocastignoli
Copy link
Member

Ok then 👍

@marcocastignoli marcocastignoli merged commit afe19ad into sourcifyeth:master May 16, 2024
acuarica added a commit to hashgraph/hedera-sourcify that referenced this pull request May 16, 2024
See sourcifyeth/h5ai-nginx#5 for more details.

Signed-off-by: Luis Mastrangelo <luis@swirldslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants