Skip to content

Commit

Permalink
Don't use export * to workaround rollup bug (#556)
Browse files Browse the repository at this point in the history
* Don't use export * to workaround rollup bug

* Don't export internals
  • Loading branch information
keanulee authored and justinfagnani committed Oct 11, 2018
1 parent ddfd13a commit 868e92b
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions src/lit-html.ts
Expand Up @@ -15,17 +15,17 @@
import {defaultTemplateProcessor} from './lib/default-template-processor.js';
import {SVGTemplateResult, TemplateResult} from './lib/template-result.js';

export * from './lib/template-result.js';
export * from './lib/template.js';
export * from './lib/template-processor.js';
export * from './lib/default-template-processor.js';
export * from './lib/template-instance.js';
export * from './lib/part.js';
export * from './lib/parts.js';
export * from './lib/dom.js';
export * from './lib/directive.js';
export * from './lib/render.js';
export * from './lib/template-factory.js';
export {DefaultTemplateProcessor, defaultTemplateProcessor} from './lib/default-template-processor.js';
export {Directive, directive, isDirective} from './lib/directive.js';
// TODO(justinfagnani): remove line when we get NodePart moving methods
export {removeNodes, reparentNodes} from './lib/dom.js';
export {noChange, Part} from './lib/part.js';
export {AttributeCommitter, AttributePart, BooleanAttributePart, EventPart, isPrimitive, NodePart, PropertyCommitter, PropertyPart} from './lib/parts.js';
export {parts, render} from './lib/render.js';
export {templateCaches, templateFactory} from './lib/template-factory.js';
export {TemplateInstance} from './lib/template-instance.js';
export {SVGTemplateResult, TemplateResult} from './lib/template-result.js';
export {createMarker, isTemplatePartActive, Template} from './lib/template.js';

/**
* Interprets a template literal as an HTML template that can efficiently
Expand Down
3 changes: 2 additions & 1 deletion src/test/lib/template-result_test.ts
Expand Up @@ -12,7 +12,8 @@
* http://polymer.github.io/PATENTS.txt
*/

import {html, marker} from '../../lit-html.js';
import {marker} from '../../lib/template.js';
import {html} from '../../lit-html.js';

const assert = chai.assert;

Expand Down
63 changes: 59 additions & 4 deletions src/test/lit-html_test.ts
Expand Up @@ -12,17 +12,72 @@
* http://polymer.github.io/PATENTS.txt
*/

import {SVGTemplateResult, TemplateResult} from '../lib/template-result.js';
import {html, svg} from '../lit-html.js';
import * as LibDefaultTemplateProcessor from '../lib/default-template-processor.js';
import * as LibDirective from '../lib/directive.js';
import * as LibPart from '../lib/part.js';
import * as LibParts from '../lib/parts.js';
import * as LibRender from '../lib/render.js';
import * as LibTemplateFactory from '../lib/template-factory.js';
import * as LibTemplateInstance from '../lib/template-instance.js';
import * as LibTemplateResult from '../lib/template-result.js';
import * as LitHtml from '../lit-html.js';

const assert = chai.assert;

suite('index.js', () => {
test('html tag returns a TemplateResult', () => {
assert.instanceOf(html``, TemplateResult);
assert.instanceOf(LitHtml.html``, LibTemplateResult.TemplateResult);
});

test('svg tag returns a SVGTemplateResult', () => {
assert.instanceOf(svg``, SVGTemplateResult);
assert.instanceOf(LitHtml.svg``, LibTemplateResult.SVGTemplateResult);
});

test('exports everything from lib/template-result.js', () => {
Object.keys(LibTemplateResult).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/default-template-processor.js', () => {
Object.keys(LibDefaultTemplateProcessor).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/template-instance.js', () => {
Object.keys(LibTemplateInstance).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/part.js', () => {
Object.keys(LibPart).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/parts.js', () => {
Object.keys(LibParts).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/directive.js', () => {
Object.keys(LibDirective).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/render.js', () => {
Object.keys(LibRender).forEach((key) => {
assert.property(LitHtml, key);
});
});

test('exports everything from lib/template-factory.js', () => {
Object.keys(LibTemplateFactory).forEach((key) => {
assert.property(LitHtml, key);
});
});
});

0 comments on commit 868e92b

Please sign in to comment.