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

More configuration options for paratimes #1441

Merged
merged 10 commits into from
Aug 13, 2024
Merged

Conversation

csillag
Copy link
Contributor

@csillag csillag commented May 31, 2024

This PR adds support for:

  • Using special names for paratimes
  • Using special paths for paratimes
  • Using special themes for paratimes
  • Skipping the opening graph if not needed

Copy link

github-actions bot commented May 31, 2024

Deployed to Cloudflare Pages

Latest commit: 04a687123886676426eed3728f181620e30e21ad
Status:✅ Deploy successful!
Preview URL: https://03cc9de3.oasis-explorer.pages.dev

@csillag csillag force-pushed the csillag/more-extension-points branch from 1d2f7a7 to b372e50 Compare June 3, 2024 14:41
@csillag csillag changed the title Csillag/more extension points More configuration options for paratimes Jun 3, 2024
@csillag csillag force-pushed the csillag/more-extension-points branch from b372e50 to a95185d Compare June 3, 2024 14:43
@csillag csillag marked this pull request as ready for review June 3, 2024 14:44
@csillag csillag force-pushed the csillag/more-extension-points branch 2 times, most recently from d265ec3 to 9e54fc2 Compare June 3, 2024 14:48
@csillag
Copy link
Contributor Author

csillag commented Jun 3, 2024

Here is an example of using some of these features: b3f4ce9#diff-c3095d5010e65c52737a98a5d618ea24049ebe90c8470752426081d70ed6e012.

(The resulting behavior can be seen at #1355)

@csillag
Copy link
Contributor Author

csillag commented Jun 5, 2024

Since there are multiple, loosely connected things, I suggest reviewing commit by commit.

@csillag csillag force-pushed the csillag/more-extension-points branch from 01e6a93 to fbe90b4 Compare June 5, 2024 13:34
[Network.testnet]: {},
}

export const specialScopePaths: Partial<Record<Network, Partial<Record<Layer, [string, string]>>>> = {
Copy link
Member

Choose a reason for hiding this comment

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

idk how to clarify the structure better. Maybe:

Suggested change
export const specialScopePaths: Partial<Record<Network, Partial<Record<Layer, [string, string]>>>> = {
export const specialScopePaths: Partial<Record<Network, Partial<Record<Layer, [/** renamed network */ string, /** renamed layer */ string]>>>> = {

or

Suggested change
export const specialScopePaths: Partial<Record<Network, Partial<Record<Layer, [string, string]>>>> = {
export const specialScopePaths: Partial<Record<`${Network}/${Layer}`, `${string}/${string}`>> = {
'testnet/pontusx': 'pontusx/test',
}

src/app/utils/route-utils.ts Outdated Show resolved Hide resolved
.storybook/preview.tsx Show resolved Hide resolved
Normally, the name of a scope is derived by concatenating
the name of the layer (i.e. "Sapphire") and
the name of the network (i.e. "Testnet") ==> "Sapphire Testnet"

However, in some specific cases, we might want to have something different.
This can be achieved by this override function.
@csillag csillag force-pushed the csillag/more-extension-points branch from fbe90b4 to 669e4ec Compare August 13, 2024 12:52
Normally the "sapphire" paratime on the "testnet" network will be
available via "testnet/sapphire".

This commit adds a config option to override the paths for
specific paratimes with any two-word constant.

(So that we can use "magic/kingdom" instead of "testnet/sapphire",
if we want to.)
This is mostly useful if we want to restrict a deployment
to display only a few layers.
Up to now, this function has returned all the themes, for all networks.
Now it will only return one theme, for the requested network.
@csillag csillag force-pushed the csillag/more-extension-points branch from 669e4ec to 04a6871 Compare August 13, 2024 13:01
@csillag csillag merged commit 089384b into master Aug 13, 2024
8 checks passed
@csillag csillag deleted the csillag/more-extension-points branch August 13, 2024 15:38
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.

2 participants