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: add replacement map feature #176

Merged
merged 8 commits into from
Aug 16, 2023
Merged

feat: add replacement map feature #176

merged 8 commits into from
Aug 16, 2023

Conversation

roshaans
Copy link
Contributor

@roshaans roshaans commented Aug 12, 2023

It was very confusing to have two applications QueryApi.dev-App vs QueryApi.App. As a result, we have removed the dev-App component and use a feature from bos-loader which allows you to write json files with keys/values that are used as replacements in your widgets.

To run local setup, run yarn start:widgets:local

--

Replacement Files

The replacement files should have the following format:
We have three different versions. For local, dev, and mainnet.

{
"REPL_PLACEHOLDER1": "value1",
"REPL_PLACEHOLDER2": "value2"
}
The placeholders in widgets are replaced with specified values. For example the code for the following widget:

return <>

This is ${REPL_PLACEHOLDER1}


${REPL_PLACEHOLDER2}

</>;
will be resolved to:

return <>

This is value1


value2

</>;

@roshaans roshaans marked this pull request as ready for review August 12, 2023 00:44
@roshaans roshaans requested a review from a team as a code owner August 12, 2023 00:44
@roshaans roshaans requested a review from darunrs August 12, 2023 00:44
Copy link
Collaborator

@morgsmccauley morgsmccauley left a comment

Choose a reason for hiding this comment

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

Why are all variables prefixed with REPL_? Seems unrelated

Copy link
Collaborator

@darunrs darunrs left a comment

Choose a reason for hiding this comment

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

Oddly enough, if I run yarn dev locally, it puts the server on localhost: 9180 but I imagine that's a simple change in the local.json to update. Optionally, you can drop a line in the README to mention that.

@roshaans
Copy link
Contributor Author

Why are all variables prefixed with REPL_? Seems unrelated

REPL_* is what the bos-loader tool uses replace all keys with values from the replacement maps in the codebase.

@roshaans
Copy link
Contributor Author

This PR is not ready atm. Will merge after double checking some configs.

@roshaans roshaans force-pushed the feat/use-replacement-maps branch from dbafd78 to bc55877 Compare August 16, 2023 12:59
@roshaans roshaans force-pushed the feat/use-replacement-maps branch from bc55877 to 4c69e13 Compare August 16, 2023 13:06
@roshaans roshaans merged commit 73f8786 into main Aug 16, 2023
@roshaans roshaans deleted the feat/use-replacement-maps branch August 16, 2023 13:09
darunrs pushed a commit that referenced this pull request Aug 16, 2023
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.

4 participants