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

Set up stackblitz or codepen template with Nimble #325

Open
jattasNI opened this issue Feb 1, 2022 · 5 comments
Open

Set up stackblitz or codepen template with Nimble #325

jattasNI opened this issue Feb 1, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@jattasNI
Copy link
Contributor

jattasNI commented Feb 1, 2022

😯 Problem to Solve

I wanted to quickly play with a Nimble component configuration that wasn't available from Storybook (in my case, I wanted to make a demo for someone to show how to use an arbitrary image as a button icon). Ideally I could click a button and be launched into a live editor environment that imports all the right Nimble dependencies, shows a code sample with some nimble components, and renders the components in a sandbox page.

💁 Proposed Solution

Codepen and Stackblitz are two sites that offer this functionality. I'd love to see a link from the top level README and Storybook that takes you to one of these with everything Nimble needs already pre-populated.

@jattasNI jattasNI added enhancement New feature or request triage New issue that needs to be reviewed labels Feb 1, 2022
@m-akinc m-akinc removed the triage New issue that needs to be reviewed label Feb 21, 2022
@rajsite
Copy link
Member

rajsite commented Feb 22, 2022

Created a nimble angular stackblitz here: https://stackblitz.com/edit/nimble-angular-issue-template
Anything else we want to add or test in it? If nothing we should add it to the issue template and ask clients to include minimal reproductions.

Some issues currently:

  • If you download it and run npm install, it fails. Looks like the CLI dev dependency is not set correctly
  • How should it be managed / maintained? How do we keep it up to date with package versions, etc?

@rajsite
Copy link
Member

rajsite commented Feb 22, 2022

I think all of the following applies only to stackblitz with their web containers feature which is beta and not supported on safari (?).

Looks like we can create a url to import from github with stackblitz: https://developer.stackblitz.com/docs/platform/importing-projects/#import-from-github

@jattasNI jattasNI mentioned this issue Feb 22, 2022
3 tasks
@jattasNI
Copy link
Contributor Author

jattasNI commented Feb 22, 2022

Awesome!

Anything else we want to add or test in it

A couple suggestions, none of which is a showstopper:

  • there's an unused field in app.component.ts
  • might be nice to have an example of interacting with the component in TS through its directive
  • might be nice to keep the stackblitz in sync with the setup instructions in nimble-angular/README.md

just need to go public

Easy, right? :-D I added a note to #290 to mention this as another rationale for open sourcing.

@rajsite
Copy link
Member

rajsite commented Apr 6, 2022

Another fiddle alternative is codesandbox:
Pros:

@rajsite
Copy link
Member

rajsite commented Jul 20, 2023

Stackblitz added a new webcontainer api so you can have more control / fully embed the environment on a page. Could make the show code button in storybook bring up a full running example 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants