Skip to content

Commit

Permalink
Ayncnode comments cleanup (#385)
Browse files Browse the repository at this point in the history
Async node comments clean up
  • Loading branch information
sakuntala-motukuri authored Jun 12, 2024
1 parent d0be2bd commit b39edf1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion plugins/async-node/core/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ test("replaces async nodes with provided node", async () => {
let deferredResolve: ((value: any) => void) | undefined;

plugin.hooks.onAsyncNode.tap("test", async (node: Node.Node) => {
console.log("tapped");
return new Promise((resolve) => {
deferredResolve = resolve;
});
Expand Down
13 changes: 0 additions & 13 deletions plugins/async-node/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export class AsyncNodePlugin implements PlayerPlugin {
this.plugins = options.plugins;
options.plugins.forEach((plugin) => {
plugin.applyPlugin(this);
// plugin.asyncNode.tap('test', async (node: Node.Node) => {
// console.log('got async node')
// return await this.hooks.onAsyncNode.call(node)
// });
});
}
}
Expand Down Expand Up @@ -131,11 +127,7 @@ export class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {
const newNode = resolvedNode || node;
if (!resolvedNode && node?.type === NodeType.Async) {
queueMicrotask(async () => {
if (this.basePlugin) {
console.log("calling async node");
}
const result = await this.basePlugin?.hooks.onAsyncNode.call(node);
console.log(`result is ${result}`);
const parsedNode =
options.parseNode && result ? options.parseNode(result) : undefined;

Expand All @@ -154,7 +146,6 @@ export class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {

apply(view: ViewInstance): void {
view.hooks.parser.tap("template", this.applyParser.bind(this));
console.log(`wtf ${this.basePlugin}`);
view.hooks.resolver.tap("template", (resolver) => {
resolver.hooks.beforeResolve.tap(this.name, (node, options) => {
let resolvedNode;
Expand All @@ -170,11 +161,7 @@ export class AsyncNodePluginPlugin implements AsyncNodeViewPlugin {
const newNode = resolvedNode || node;
if (!resolvedNode && node?.type === NodeType.Async) {
queueMicrotask(async () => {
if (this.basePlugin) {
console.log("calling async node");
}
const result = await this.basePlugin?.hooks.onAsyncNode.call(node);
console.log(`result is ${result}`);
const parsedNode =
options.parseNode && result
? options.parseNode(result)
Expand Down

0 comments on commit b39edf1

Please sign in to comment.