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

Need the ability to open demos in an iframe/new-route #102

Open
NullVoxPopuli opened this issue Jun 16, 2021 · 0 comments
Open

Need the ability to open demos in an iframe/new-route #102

NullVoxPopuli opened this issue Jun 16, 2021 · 0 comments

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Jun 16, 2021

This request is partially for debugging/development purposes, partially for style isolation without a shadowdom (which removes all styles of the parent context).

For this change to be uniformly implemented, the inline-demos in markdown files would need to be extracted to components during build time, rather than line-by-line inlined in the hbs output. This would allow passing a dynamic-segment to some route for dynamically loading the component for the above development scenario. With embroider+vite, this would also lead to much faster rebuild times, as all the surrounding UI wouldn't need to be built/rendered.

I think at build time, an object like this would need to be generated:

import { importSync } from '@embroider/macros';

const DEMO_MAP = {
  [some-key]: importSync('some-demo-component')
  // ...
}

// ...

async model({ componentName }) {
  let demoComponent = DEMO_MAP[componentName];
  
  return { demoComponent };
}
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

No branches or pull requests

1 participant