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

Make samples from documentation runnable via Telerik REPL #994

Open
egil opened this issue Feb 23, 2023 · 0 comments
Open

Make samples from documentation runnable via Telerik REPL #994

egil opened this issue Feb 23, 2023 · 0 comments
Labels
backlog Enhancements which are relevant but not a priority at the moment. documentation Improvements or additions to documentation investigate This issue require further investigation before closing.

Comments

@egil
Copy link
Member

egil commented Feb 23, 2023

Our friends from Telerik have been working on a prototype that will allow us to run bUnit tests inside their Blazor REPL environment. I suspect there will be some limitations here, like demos of WaitForX features and perhaps an injection of services, JSInterop, that won't work, but it may still be worthwhile to have this available in the remaining places.

Related issue: #145

Here is a demo:

  1. Go to https://blazorrepl.telerik.com/GdkwlMbS11AjptTB51
  2. The test is in the Test.cs file, the component under test is in the Counter.razor file
  3. Click the RUN button to run the tests

The current suggestion is that the integration could work like this:

  1. During deployment/build of the docs site, each "sample test/component-under-test pair" is uploaded to the Blazor REPL via a command line tool.
  2. Somewhere next to each sample in the docs we add a link that points to related sample
  3. If the user clicks the link, a new window is opened and they can play around with the code

Here are the "upload samples" details:

Auth
HeaderKey: "API-KEY"
API KEY value: "REPL_API_KEY (in github secrets)"
Http Verb: POST
Content-Type: application/json
Url: https://test.snippets.blazorrepl.telerik.com/
Body Schema: { files: [{ path: '', content: '' }], installedPackages: [{ name: '', version: '' }] }

The file which is first in the files array will appear first in the REPL and it will be the default visible file.

If everything is ok, the API will return 200 OK with the snippet ID

Next step

  1. Figure out which samples make sense to use the REPL with
  2. Figure out a good way to integrate this with our docs build pipeline
@egil egil added documentation Improvements or additions to documentation backlog Enhancements which are relevant but not a priority at the moment. investigate This issue require further investigation before closing. labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Enhancements which are relevant but not a priority at the moment. documentation Improvements or additions to documentation investigate This issue require further investigation before closing.
Projects
None yet
Development

No branches or pull requests

1 participant