Skip to content

Commit df76015

Browse files
authored
Merge pull request #186 from ember-learn/remove-live-examples
Remove the live-example component
2 parents c312255 + fac74c0 commit df76015

File tree

10 files changed

+3
-160
lines changed

10 files changed

+3
-160
lines changed

addon/components/docs-demo/template.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{{yield (hash
44
example=(component 'docs-demo/x-example')
55
snippet=(component 'docs-demo/x-snippet' did-init=(action 'registerSnippet') activeSnippet=activeSnippet)
6-
live-example=(component 'docs-demo/x-live-example')
76
)}}
87

98
{{#if snippets}}

addon/components/docs-demo/x-live-example-demo/component.js

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

addon/components/docs-demo/x-live-example/component.js

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

addon/components/docs-demo/x-live-example/styles.scss

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

addon/components/docs-demo/x-live-example/template.hbs

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

index.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const fs = require('fs');
44
const path = require('path');
5-
const resolve = require('resolve');
65
const UnwatchedDir = require('broccoli-source').UnwatchedDir;
76
const MergeTrees = require('broccoli-merge-trees');
87
const Funnel = require('broccoli-funnel');
@@ -14,9 +13,6 @@ module.exports = {
1413
name: 'ember-cli-addon-docs',
1514

1615
options: {
17-
ace: {
18-
modes: ['handlebars']
19-
},
2016
nodeAssets: {
2117
'highlight.js': {
2218
public: {
@@ -93,13 +89,12 @@ module.exports = {
9389
includer.options.includeFileExtensionInSnippetNames = includer.options.includeFileExtensionInSnippetNames || false;
9490
includer.options.snippetSearchPaths = includer.options.snippetSearchPaths || ['tests/dummy/app'];
9591
includer.options.snippetRegexes = Object.assign({}, {
96-
begin: /{{#(?:docs-snippet|demo.example|demo.live-example)\sname=(?:"|')(\S+)(?:"|')/,
97-
end: /{{\/(?:docs-snippet|demo.example|demo.live-example)}}/,
92+
begin: /{{#(?:docs-snippet|demo.example)\sname=(?:"|')(\S+)(?:"|')/,
93+
end: /{{\/(?:docs-snippet|demo.example)}}/,
9894
}, includer.options.snippetRegexes);
9995

10096
let importer = findImporter(this);
10197

102-
importer.import(`${this._hasEmberSource() ? 'vendor' : 'bower_components'}/ember/ember-template-compiler.js`);
10398
importer.import('vendor/lunr/lunr.js', {
10499
using: [{ transformation: 'amd', as: 'lunr' }]
105100
});
@@ -157,8 +152,7 @@ module.exports = {
157152
return new MergeTrees([
158153
vendor,
159154
this._highlightJSTree(),
160-
this._lunrTree(),
161-
this._templateCompilerTree()
155+
this._lunrTree()
162156
].filter(Boolean));
163157
},
164158

@@ -216,19 +210,6 @@ module.exports = {
216210
srcDir: 'styles',
217211
destDir: 'highlightjs-styles'
218212
});
219-
},
220-
221-
_templateCompilerTree() {
222-
if (this._hasEmberSource()) {
223-
return new Funnel(path.dirname(resolve.sync('ember-source/package.json'), { basedir: this.project.root }), {
224-
srcDir: 'dist',
225-
destDir: 'ember'
226-
});
227-
}
228-
},
229-
230-
_hasEmberSource() {
231-
return 'ember-source' in this.project.pkg.devDependencies;
232213
}
233214
};
234215

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"broccoli-plugin": "^1.3.0",
3232
"broccoli-source": "^1.1.0",
3333
"broccoli-stew": "^1.5.0",
34-
"ember-ace": "^1.2.0",
3534
"ember-cli-autoprefixer": "^0.8.1",
3635
"ember-cli-babel": "^6.11.0",
3736
"ember-cli-clipboard": "^0.8.1",

tests/dummy/app/pods/docs/components/docs-demo/demo4/template.hbs

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

tests/dummy/app/pods/docs/components/docs-demo/template.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,3 @@ Use a file extension to help docs-snippet identify and properly syntax highlight
4141
If you wish to override the inferred label or syntax highlighting for a snippet, you can specify `label` and `language` properties.
4242

4343
{{docs/components/docs-demo/demo3}}
44-
45-
## Live examples
46-
47-
You can also make a live example, so your users can edit your demos and try out your components for themselves.
48-
49-
{{docs/components/docs-demo/demo4}}
50-
51-
Here's the code for this:
52-
53-
{{docs-snippet name='live-example-src.hbs'}}
54-
55-
Note that we're using the `demo.live-example` contextual component now. This component takes a block as a starting template for the user to see. It then puts that template into the `textarea`, and every time its value changes the template is recompiled and rerendered.
56-
57-
If there is a template compilation error it should show instead of the rendered output.

yarn.lock

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,6 @@ accepts@~1.3.4:
167167
mime-types "~2.1.16"
168168
negotiator "0.6.1"
169169

170-
ace-builds@^1.2.8:
171-
version "1.3.1"
172-
resolved "https://registry.yarnpkg.com/ace-builds/-/ace-builds-1.3.1.tgz#c7f9d7a657e7d9c630acd78f1dc2fa1e0e2a84f6"
173-
174170
acorn-dynamic-import@^3.0.0:
175171
version "3.0.0"
176172
resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz#901ceee4c7faaef7e07ad2a47e890675da50a278"
@@ -2765,17 +2761,6 @@ electron-to-chromium@^1.3.30, electron-to-chromium@^1.3.47:
27652761
version "1.3.48"
27662762
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz#d3b0d8593814044e092ece2108fc3ac9aea4b900"
27672763

2768-
ember-ace@^1.2.0:
2769-
version "1.3.1"
2770-
resolved "https://registry.yarnpkg.com/ember-ace/-/ember-ace-1.3.1.tgz#b690cd1fe09a65a264dec40f9a54050af982a8da"
2771-
dependencies:
2772-
ace-builds "^1.2.8"
2773-
broccoli-merge-trees "^2.0.0"
2774-
broccoli-plugin "^1.2.1"
2775-
ember-cli-babel "^6.6.0"
2776-
ember-cli-htmlbars "^2.0.2"
2777-
ember-cli-node-assets "^0.2.2"
2778-
27792764
ember-app-scheduler@^0.2.0:
27802765
version "0.2.1"
27812766
resolved "https://registry.yarnpkg.com/ember-app-scheduler/-/ember-app-scheduler-0.2.1.tgz#4af70ce7b4d5792a96eff46c0c2f4a737ec3ad63"

0 commit comments

Comments
 (0)