Skip to content

Commit

Permalink
fix(plugging): pass nsdoc Promise to plugins
Browse files Browse the repository at this point in the history
BREAKING CHANGE: We now pass the `nsdoc` to plugins as a `Promise<XMLDocument>` rather than a plain `XMLDocument` in order to enable the synchronous rendering of plugins in our `Hosting` mixin.
  • Loading branch information
ca-d authored May 29, 2022
1 parent 0921077 commit 33ea02b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Plugging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import { TextField } from '@material/mwc-textfield';
import { ifImplemented, Mixin } from './foundation.js';
import { EditingElement } from './Editing.js';
import { officialPlugins } from '../public/js/plugins.js';
import { initializeNsdoc } from './foundation/nsdoc.js';

const nsdoc = initializeNsdoc();

const pluginTags = new Map<string, string>();
/**
Expand Down Expand Up @@ -277,6 +280,7 @@ export function Plugging<TBase extends new (...args: any[]) => EditingElement>(
.docName=${this.docName}
.docId=${this.docId}
.pluginId=${plugin.src}
.nsdoc=${nsdoc}
></${tag}>`,
};
}
Expand Down

0 comments on commit 33ea02b

Please sign in to comment.