Skip to content

Commit

Permalink
chore: add scoped-custom-element-registry.min.js
Browse files Browse the repository at this point in the history
  • Loading branch information
okadurin committed Nov 6, 2023
1 parent da8a5c8 commit 2e6f47d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,7 @@ Keep using `/docs` on the root level as we used it in the `master` branch. The d
Cannot find module 'import.meta'
```

- Visit [accordion page]. There is an error in the browser console:

```
You are trying to re-register the "lion-accordion" custom element with a different class via ScopedElementsMixin
```

- Fiex the browser console error on [collapsible page](http://localhost:4322/components/collapsible):
- Fix the browser console error on [collapsible page](http://localhost:4322/components/collapsible):

```
__mdjs-stories--use-cases.js:40 Uncaught TypeError: shadowRoot.getElementById is not a function
Expand Down
2 changes: 2 additions & 0 deletions src/pages/[top]/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const getPathMdjsStroriesFile = (entry) => {
const mdjsStroriesFileDirectory = path.dirname(entry.slug);
return `/public/docs/${mdjsStroriesFileDirectory}/__mdjs-stories.js`;
}
const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custom-element-registry.min.js';
---

<MainLayout title={entry.slug}>
Expand All @@ -52,5 +53,6 @@ const getPathMdjsStroriesFile = (entry) => {
{blogData.tags}
{blogData.author}
<Content />
<script src={getScopedCustomElementRegistryFilePath()}"></script>
<script type="module" src={getPathMdjsStroriesFile(entry)} mdjs-setup></script>
</MainLayout>
3 changes: 3 additions & 0 deletions src/pages/components/[component].astro
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const getPathMdjsStroriesFile = (entry) => {
const mdjsStroriesFileDirectory = path.dirname(entry.slug);
return `/public/docs/${mdjsStroriesFileDirectory}/__mdjs-stories.js`;
}
const getScopedCustomElementRegistryFilePath = () => '/docs/_assets/scoped-custom-element-registry.min.js';
---

<MainLayout title={entry.slug}>
Expand All @@ -54,6 +56,7 @@ const getPathMdjsStroriesFile = (entry) => {
<content.Content />
))
}
<script src={getScopedCustomElementRegistryFilePath()}"></script>
<script type="module" src={getPathMdjsStroriesFile(componentEntries[0])} mdjs-setup></script>
</ComponentLayout>
</MainLayout>
Expand Down

0 comments on commit 2e6f47d

Please sign in to comment.