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

Lack of validations for imports using #context within code snippets #1666

Closed
Torres-ssf opened this issue Jan 19, 2024 · 0 comments · Fixed by #1665
Closed

Lack of validations for imports using #context within code snippets #1666

Torres-ssf opened this issue Jan 19, 2024 · 0 comments · Fixed by #1665
Assignees
Labels
docs Requests pertinent to documentation
Milestone

Comments

@Torres-ssf
Copy link
Contributor

In our documentation, we utilize a feature where #context comments are used to add imports to code snippets, as shown below:

// #context import type { AssetId } from 'fuels';

const assetId: AssetId = {
  value: Bits256,
};

This approach works well during markdown file processing, where the #context text is removed, and the relevant import is added to the code snippet.

However, there is no validation mechanism for the imports added with these #context comments.

This lack of validation can result in several issues:

  1. Outdated Imports: Over time, some imports may become outdated or deprecated. Without validation, these obsolete imports may remain in the documentation, potentially confusing our users.

  2. Unused Imports: Over time, we may need to update these code snippets and forget to update the #context comments, leaving imports that are no longer used in the associated code snippets. These unnecessary imports clutter the code and can mislead users regarding the actual dependencies of the code example.

We need to find a solution to validate all imports that are manually added to code snippets present on our Docs.

@Torres-ssf Torres-ssf added the docs Requests pertinent to documentation label Jan 19, 2024
@Torres-ssf Torres-ssf self-assigned this Jan 19, 2024
@Torres-ssf Torres-ssf modified the milestones: 1 - Salamander, 2 - Beetle Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Requests pertinent to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant