Skip to content

Commit dec04fe

Browse files
committed
feat(ui_builder): Async support
1 parent 9830da2 commit dec04fe

File tree

5 files changed

+208
-153
lines changed

5 files changed

+208
-153
lines changed

core/index.js

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -306,26 +306,28 @@ const patternlab_module = function (config) {
306306
patternlab.isBusy = true;
307307
return buildPatterns(options.cleanPublic).then(() => {
308308

309-
new ui_builder().buildFrontend(patternlab);
310-
assetCopier().copyAssets(patternlab.config.paths, patternlab, options);
309+
return new ui_builder().buildFrontend(patternlab).then(() => {
311310

312-
this.events.on('patternlab-pattern-change', () => {
313-
if (!patternlab.isBusy) {
314-
options.cleanPublic = false;
315-
return this.build(options);
316-
}
317-
return Promise.resolve();
318-
});
311+
assetCopier().copyAssets(patternlab.config.paths, patternlab, options);
319312

320-
this.events.on('patternlab-global-change', () => {
321-
if (!patternlab.isBusy) {
322-
options.cleanPublic = true; //rebuild everything
323-
return this.build(options);
324-
}
325-
return Promise.resolve();
326-
});
313+
this.events.on('patternlab-pattern-change', () => {
314+
if (!patternlab.isBusy) {
315+
options.cleanPublic = false;
316+
return this.build(options);
317+
}
318+
return Promise.resolve();
319+
});
327320

328-
patternlab.isBusy = false;
321+
this.events.on('patternlab-global-change', () => {
322+
if (!patternlab.isBusy) {
323+
options.cleanPublic = true; //rebuild everything
324+
return this.build(options);
325+
}
326+
return Promise.resolve();
327+
});
328+
329+
patternlab.isBusy = false;
330+
});
329331
});
330332
},
331333

core/lib/object_factory.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ const Pattern = function (relPath, data, patternlab) {
101101

102102
Pattern.prototype = {
103103

104-
renderSync: function (data, partials) {
105-
if (this.engine) {
106-
const results = this.engine.renderPattern(this, data || this.jsonFileData, partials);
107-
return results;
108-
}
109-
return null;
110-
},
111-
112104
// render function - acts as a proxy for the PatternEngine's
113105
render: function (data, partials) {
114106

core/lib/renderSync.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)