I started implementing the routing system for the laboratory and realized that I
need more specifics on what exactly we should implement.
These options are not comprehensive but I've tried to consider the different
cases possible and routes we could go.
1. Url naming
Trivial but important. We need to pick what we want the URL to look like.\
Option 1a: We could either go with abbreviated
Endpoint Explorer: https://www.stellar.org/laboratory/#/explorer
Transaction Builder: https://www.stellar.org/laboratory/#/txbuilder
Transaction Signer: https://www.stellar.org/laboratory/#/txsigner
Option 1b: Things fully spelled out
Endpoint Explorer: https://www.stellar.org/laboratory/#/endpoint-explorer
Transaction Builder: https://www.stellar.org/laboratory/#/transaction-builder
Transaction Signer: https://www.stellar.org/laboratory/#/transaction-signer
2. How much information do we want to keep in the url.
For now, I think it might be better to just go with option 2a and spend development
time on other more useful features. In the future, we can move onto 2b if we have
extra dev time.
Option 2a: Minimal
Just have three different possibilities: one for each page:
Example: https://www.stellar.org/laboratory/#/endpoint-explorer
Option 2b: Selective
Store main 2nd level navigation data in the url. For the transaction signer, it
can be the xdr of the transaction. It will only work for the signer though
because the state in the transaction builder may not always be serializable into
a valid xdr blob.
Examples:
https://www.stellar.org/laboratory/#/endpoint-explorer/transactions-for-account
https://www.stellar.org/laboratory/#/transaction-signer/AAAAAGXNhLrhGtltTwCpmqlarh7s1DB2hIkbP//jgzn4Fos/AAAAZAAAAA0AABGHAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAuocnFfCNi6J2JIoh8FDH1VL8SsVmqAF48W4x9q7kHScAAAAXSHboAAAAAAAAAAAB+BaLPwAAAECWmdSLKo7fSoAwMxnYrQzUiZt8BfCoB/4HoxXnjHo3DkKyZoqJi27phVVbmF98Le6hCzD5t56Y7W6zxj8wvdQL
Option 2c: Full serialization of store of the current page
This option would keep the full serialized state of the specific page in the url.
I think option 2c is not necessary to be displayed on the url at all times as it
would bloat the url and would be overwhelming.
I do see a use case where one can click a share
button to build a url with the
serialized state in query params. Then once the link is visited, the query parts
would disappear.
Example:
https://www.stellar.org/laboratory/#/endpoint-explorer/order-book-details?selling_asset_type=native&buying_asset_type=credit_alphanum4&buying_asset_code=KELP&buying_asset_issuer=GBKELPXG2FLP2IBICXY6AZPR64YLBYA3C2OI2W2JPCHS7ZUQ6CLLX5XR
Option 2d: Full serialization of the whole app's store
This will hold EVERYTHING in the url.
3. Landing page
Option 3a: Automatically start at endpoint explorer
Would we have a landing page when none of the pages are selected?
Option 3b: Create a new landing page
The landing page would include a quick intro of the laboratory, and links to
other resources such as the developers site or tutorials that use the laboratory.
Option 3c: Integrate into developers site
This option would eliminate the branding of the laboratory
.