Skip to content

Commit

Permalink
template assets all generating
Browse files Browse the repository at this point in the history
  • Loading branch information
martypdx committed Mar 20, 2024
1 parent 30c699e commit 2eeedf9
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 308 deletions.
279 changes: 0 additions & 279 deletions packages/compiler/transform/BindGenerator.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/compiler/transform/GeneratorBase.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GENERATOR } from 'astring';

// enable extending as es6 class
// enables extending as es6 class
export function Generator() { }
Generator.prototype = GENERATOR;

Expand All @@ -9,4 +9,3 @@ export function writeNextLine(state) {
state.write(lineEnd);
state.write(indent.repeat(state.indentLevel));
}

24 changes: 0 additions & 24 deletions packages/compiler/transform/RenderGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,6 @@ export class RenderGenerator extends Generator {
state.write(identifier.name, identifier);
}

// Render(template, state) {
// const { bindings, isDomFragment } = template;

// const params = [];
// for(let i = 0; i < bindings.length; i++) {
// params.push(`${VALUE}${i}`);
// }

// state.write(`function renderDOM(${params.join(', ')}) {`);
// state.indentLevel++;
// writeNextLine(state);

// state.write(`const [root, bind] = render('id', targets, bind, ${isDomFragment});`);
// writeNextLine(state);
// state.write(`bind(${params.join(', ')});`);
// writeNextLine(state);
// state.write(`return root;`);

// state.indentLevel--;
// writeNextLine(state);
// state.write(`}`);
// state.write(state.lineEnd);
// }

Bindings(state) {
const bindings = this.#bindings;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ export function makeRender({ bindings: { length } }) {
bind(${params});
return root;
}\n`;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-undef */
import { makeTargets, makeGetBound, makeRender } from './AssetsGenerator.js';
import { makeTargets, makeGetBound, makeRender } from './template-assets.js';
import { parse, generate as _generate } from '../compiler.js';
import { describe, test, beforeEach } from 'vitest';
import { RenderGenerator } from './RenderGenerator.js';
Expand All @@ -12,7 +12,6 @@ function preParse(input, expect) {
return template;
}


describe('targets generator', () => {

beforeEach(context => {
Expand Down

0 comments on commit 2eeedf9

Please sign in to comment.