Replies: 3 comments 8 replies
-
IIRC, we also considered |
Beta Was this translation helpful? Give feedback.
-
Endgoal TL;DR
SummaryI'd say the I'm also intrigued by running these snippets in isolation. Could these two ideas converge? HypothesysConsider a hypothetical snippet that can be:
// foobar.ts
import { Provider, Wallet, FUEL_NETWORK_URL } from 'fuels';
(async function main () {
const address = 'fuel..leuf'; // consider the full address here
const provider = await Provider.create(FUEL_NETWORK_URL);
const assetId = provider.getBaseAssetId();
const balance = await Wallet.fromAddress(address, provider).getBalance(assetId);
console.log(balance);
})(); Test AssertionsHow could we ensure that these self-executing functions are working?
Let's say that on
// foobar.snippet.ts
import { Provider, Wallet, FUEL_NETWORK_URL } from 'fuels';
export const main = () => (async function () {
const address = 'fuel..leuf'; // consider the full address here
const provider = await Provider.create(FUEL_NETWORK_URL);
const assetId = provider.getBaseAssetId();
const balance = await Wallet.fromAddress(address, provider).getBalance(assetId);
console.log(balance);
})(); Then we could have tests like this asserting the wrapped snippets, not the raw ones: // imports wrapped snippet
import { main } from './foobar.snippet.ts';
test('..', () => {
const res = await main();
expect(res.logCalls[0]).toEqual(..);
}); Final SnapshotIn the end, we'd have:
They'd contain, respectively:
Final Considerations
|
Beta Was this translation helpful? Give feedback.
-
I believe this discussion is now closed - we have the following issue: Please reopen if this asssesment is incorrect 😄 |
Beta Was this translation helpful? Give feedback.
-
We experience different inconsistencies with docs-hub - such as FuelLabs/docs-hub#233 and FuelLabs/docs-hub#234 for example - that have created quite a bit of friction. We should perhaps revisit the tooling that we use to generate doc snippets.
The most popular option would probably be Docusaurus as it provides a more feature-rich experience out of the box. It has built-in support for versioning, localization, and search, while VitePress requires additional configuration or external tools for these features. Docusaurus also has a larger ecosystem and community support compared to VitePress.
We should at the very least think about localization as we currently only have support for English. Interested to hear others' thoughts
Beta Was this translation helpful? Give feedback.
All reactions