Skip to content

Conversation

@flaki
Copy link
Contributor

@flaki flaki commented Mar 2, 2022

Work-in-progress multi-language code block component ( #27 ) to address various issues around Runtime API, maintenance and API documentation quality.

Currently all code lives on the atmo/runnable-api/introduction.md page as a proof of concept, and it will need to be moved out to its own component. Similarly the configuration object for language support stability ( #32 ) will need to move to its own config JSON. Language stability now has its own page to be referenced from everywhere in the Reactr component.

Outstanding work (may or may not be tackled as part of this PR):

  • Implement the badging behavior for language stability
  • Figure out whether we want to reveal the badges everywhere? (is it too annoying?)
  • Add status badges to the tabs (or not?) as icons, emojis or through differentiation of colors
  • Implement loading snippets from external files
  • Allow wrapping code blocks in <div>-s to allow adding extra content to some of the tabs

@flaki flaki requested a review from hola-soy-milk March 2, 2022 10:58
Copy link
Contributor

@hola-soy-milk hola-soy-milk left a comment

Choose a reason for hiding this comment

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

So excited for this! Some minor questions and recommendations

@flaki
Copy link
Contributor Author

flaki commented Mar 8, 2022

This latest change adds support for a few extra features that made it possible to include docs for JS/TS, as demonstrated in the HTTP API, with the remaining APIs coming soon. I have also filed #59 to make note of some of the recently added but as-of-yet undocumented API features.

@flaki
Copy link
Contributor Author

flaki commented Mar 10, 2022

The latest changes document the remaining Runtime API imports for JavaScript and TypeScript.

I have included various clarifications in the other docs as I transformed the files to use the <MultiLanguageCodeBlock>, and this my newfound familiarity with Reactr's API code will significantly reduce the time I expect it will take to add the docs for the remaining languages (Grain, Tiny Go).

I have filed a variety of follow-up issues on Reactr for bugs, missing implementations and other inconsistencies:

@flaki flaki marked this pull request as ready for review March 10, 2022 10:53
@flaki flaki changed the title WIP Runtime API multi-language tabbed code block component Runtime API for JS&TS using the multi-language tabbed code block component Mar 10, 2022
Copy link
Contributor

@hola-soy-milk hola-soy-milk left a comment

Choose a reason for hiding this comment

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

Looking great!

I noticed some code blocks that are preceded by explanations about AssemblyScript but are noted as a typescript code block.

Could it be these need adapting?

@flaki flaki force-pushed the language-component branch from 99ef9d9 to 0d6425a Compare March 11, 2022 18:07
@flaki
Copy link
Contributor Author

flaki commented Mar 11, 2022

I rebased this on the recent GH Actions changes which means previews of this PR now deploy under:
https://suborbital.github.io/docs/language-component/atmo/runnable-api/introduction

@cohix
Copy link
Contributor

cohix commented Mar 11, 2022

I noticed that on certain pageloads, there is no language selected by default, even if I've selected a language on a different page:

image

Clicking on Rust brings up the content correctly, but it is a bit confusing at first.

I can't seem to reliably repro it.

@cohix
Copy link
Contributor

cohix commented Mar 11, 2022

Let's change JS/TS to beta instead of preview

@flaki
Copy link
Contributor Author

flaki commented Mar 11, 2022

I noticed that on certain pageloads, there is no language selected by default, even if I've selected a language on a different page

Yeah so the reason for this is that if you selected a language somewhere it "syncs" across the fields, but if that language is not available another tab is not selected automatically.

There is a "default tab" option but I haven't been able to figure out how to make it work just yet, can file a followup though because I agree that until we have 100% coverage for all languages this can be a bit jarring.

Copy link
Contributor

@cohix cohix left a comment

Choose a reason for hiding this comment

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

The quirk with the language picker is understood and shouldn't block this PR! Let's get it merged.

@flaki
Copy link
Contributor Author

flaki commented Mar 12, 2022

Created #73 to track the default-language-tab issue, and I'm going to merge this.

@flaki flaki merged commit f0b4e5b into main Mar 12, 2022
@LauraLangdon LauraLangdon deleted the language-component branch November 25, 2022 19:33
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