language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | emberjs | ember.js | ad79c1e075987bea64d3a73e703363d07284338a.json | Enable sourcemap support for Ember development.
This is useful while developing on Ember, and we may possibly publish
the maps to `bower`, S3, etc in the future, but we need to be careful to
not cause many errors/warnings while building Ember CLI (if the `.map`
file is referenced but not present it causes a console warning). | package.json | @@ -18,7 +18,7 @@
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-yuidoc": "^0.4.0",
"ember-publisher": "0.0.7",
- "emberjs-build": "0.0.33",
+ "emberjs-build": "0.0.36",
"express": "^4.5.0",
"github": "^0.2.3",
"glob": "~4.3.2", | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-application/lib/main.js | @@ -9,9 +9,9 @@ Ember Application
@requires ember-views, ember-routing
*/
+import DefaultResolver from 'ember-application/system/resolver';
import {
- Resolver,
- default as DefaultResolver
+ Resolver
} from 'ember-application/system/resolver';
import Application from 'ember-application/system/application';
import 'ember-application/ext/controller'; // side effect of extending ControllerMixin | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-extension-support/tests/container_debug_adapter_test.js | @@ -1,5 +1,5 @@
import run from "ember-metal/run_loop";
-import { default as EmberController } from "ember-runtime/controllers/controller";
+import EmberController from "ember-runtime/controllers/controller";
import "ember-extension-support"; // Must be required to export Ember.ContainerDebugAdapter
import Application from "ember-application/system/application";
| true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-htmlbars/tests/helpers/each_test.js | @@ -7,7 +7,7 @@ import _MetamorphView from "ember-views/views/metamorph_view";
import { computed } from "ember-metal/computed";
import ArrayController from "ember-runtime/controllers/array_controller";
import { A } from "ember-runtime/system/native_array";
-import { default as EmberController } from "ember-runtime/controllers/controller";
+import EmberController from "ember-runtime/controllers/controller";
import ObjectController from "ember-runtime/controllers/object_controller";
import { Registry } from "ember-runtime/system/container";
| true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-htmlbars/tests/helpers/with_test.js | @@ -5,8 +5,8 @@ import EmberObject from "ember-runtime/system/object";
import { computed } from "ember-metal/computed";
import { set } from "ember-metal/property_set";
import { get } from "ember-metal/property_get";
+import ObjectController from "ember-runtime/controllers/object_controller";
import {
- default as ObjectController,
objectControllerDeprecation
} from "ember-runtime/controllers/object_controller";
import EmberController from 'ember-runtime/controllers/controller'; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-htmlbars/tests/helpers/yield_test.js | @@ -8,9 +8,9 @@ import { set } from "ember-metal/property_set";
import { A } from "ember-runtime/system/native_array";
import Component from "ember-views/views/component";
import EmberError from "ember-metal/error";
+import helpers from "ember-htmlbars/helpers";
import {
- registerHelper,
- default as helpers
+ registerHelper
} from "ember-htmlbars/helpers";
import makeViewHelper from "ember-htmlbars/system/make-view-helper";
| true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-htmlbars/tests/hooks/element_test.js | @@ -1,6 +1,6 @@
import EmberView from "ember-views/views/view";
+import helpers from "ember-htmlbars/helpers";
import {
- default as helpers,
registerHelper
} from "ember-htmlbars/helpers";
import { runAppend, runDestroy } from "ember-runtime/tests/utils"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-routing-htmlbars/lib/helpers/render.js | @@ -6,9 +6,9 @@
import Ember from "ember-metal/core"; // assert, deprecate
import EmberError from "ember-metal/error";
import { camelize } from "ember-runtime/system/string";
+import generateController from "ember-routing/system/generate_controller";
import {
- generateControllerFactory,
- default as generateController
+ generateControllerFactory
} from "ember-routing/system/generate_controller";
import { isStream } from "ember-metal/streams/utils";
import mergeViewBindings from "ember-htmlbars/system/merge-view-bindings"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-routing-htmlbars/tests/helpers/action_test.js | @@ -6,17 +6,17 @@ import ActionManager from "ember-views/system/action_manager";
import { Registry } from "ember-runtime/system/container";
import EmberObject from "ember-runtime/system/object";
-import { default as EmberController } from "ember-runtime/controllers/controller";
+import EmberController from "ember-runtime/controllers/controller";
import EmberArrayController from "ember-runtime/controllers/array_controller";
import compile from "ember-template-compiler/system/compile";
import EmberView from "ember-views/views/view";
import EmberComponent from "ember-views/views/component";
import jQuery from "ember-views/system/jquery";
+import helpers from "ember-htmlbars/helpers";
import {
- registerHelper,
- default as helpers
+ registerHelper
} from "ember-htmlbars/helpers";
import { | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-routing-htmlbars/tests/helpers/render_test.js | @@ -6,7 +6,7 @@ import { observer } from 'ember-metal/mixin';
import Namespace from "ember-runtime/system/namespace";
-import { default as EmberController } from "ember-runtime/controllers/controller";
+import EmberController from "ember-runtime/controllers/controller";
import EmberArrayController from "ember-runtime/controllers/array_controller";
import { registerHelper } from "ember-htmlbars/helpers"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-routing/lib/main.js | @@ -18,9 +18,9 @@ import HashLocation from "ember-routing/location/hash_location";
import HistoryLocation from "ember-routing/location/history_location";
import AutoLocation from "ember-routing/location/auto_location";
+import generateController from "ember-routing/system/generate_controller";
import {
- generateControllerFactory,
- default as generateController
+ generateControllerFactory
} from "ember-routing/system/generate_controller";
import controllerFor from "ember-routing/system/controller_for";
import RouterDSL from "ember-routing/system/dsl"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-routing/tests/system/controller_for_test.js | @@ -7,14 +7,12 @@ import Registry from 'container/registry';
import Namespace from "ember-runtime/system/namespace";
import { classify } from "ember-runtime/system/string";
import Controller from "ember-runtime/controllers/controller";
-import {
- default as ObjectController
-} from "ember-runtime/controllers/object_controller";
+import ObjectController from "ember-runtime/controllers/object_controller";
import ArrayController from "ember-runtime/controllers/array_controller";
import controllerFor from "ember-routing/system/controller_for";
+import generateController from "ember-routing/system/generate_controller";
import {
- generateControllerFactory,
- default as generateController
+ generateControllerFactory
} from "ember-routing/system/generate_controller";
var buildContainer = function(namespace) { | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-runtime/tests/controllers/controller_test.js | @@ -2,8 +2,8 @@
import Controller from "ember-runtime/controllers/controller";
import Service from "ember-runtime/system/service";
+import ObjectController from "ember-runtime/controllers/object_controller";
import {
- default as ObjectController,
objectControllerDeprecation
} from "ember-runtime/controllers/object_controller";
import Mixin from "ember-metal/mixin"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-runtime/tests/controllers/object_controller_test.js | @@ -1,5 +1,5 @@
+import ObjectController from "ember-runtime/controllers/object_controller";
import {
- default as ObjectController,
objectControllerDeprecation
} from "ember-runtime/controllers/object_controller";
import { observer } from 'ember-metal/mixin'; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-runtime/tests/inject_test.js | @@ -1,9 +1,9 @@
/* global EmberDev */
import InjectedProperty from "ember-metal/injected_property";
+import inject from "ember-runtime/inject";
import {
- createInjectionHelper,
- default as inject
+ createInjectionHelper
} from "ember-runtime/inject";
import { Registry } from "ember-runtime/system/container";
import Object from "ember-runtime/system/object"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-runtime/tests/mixins/promise_proxy_test.js | @@ -3,8 +3,8 @@ import {get} from "ember-metal/property_get";
import run from "ember-metal/run_loop";
import ObjectProxy from "ember-runtime/system/object_proxy";
import PromiseProxyMixin from "ember-runtime/mixins/promise_proxy";
+import EmberRSVP from "ember-runtime/ext/rsvp";
import {
- default as EmberRSVP,
onerrorDefault
} from "ember-runtime/ext/rsvp";
import * as RSVP from 'rsvp'; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-template-compiler/tests/plugins_test.js | @@ -1,5 +1,5 @@
+import plugins from "ember-template-compiler/plugins";
import {
- default as plugins,
registerPlugin
} from "ember-template-compiler/plugins";
import compile from "ember-template-compiler/system/compile"; | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-views/lib/main.js | @@ -39,8 +39,8 @@ import TextField from "ember-views/views/text_field";
import TextArea from "ember-views/views/text_area";
import SimpleBoundView from "ember-views/views/simple_bound_view";
+import _MetamorphView from "ember-views/views/metamorph_view";
import {
- default as _MetamorphView,
_Metamorph
} from "ember-views/views/metamorph_view";
import { | true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-views/lib/views/each.js | @@ -15,8 +15,8 @@ import {
removeBeforeObserver
} from "ember-metal/observer";
+import _MetamorphView from "ember-views/views/metamorph_view";
import {
- default as _MetamorphView,
_Metamorph
} from "ember-views/views/metamorph_view";
| true |
Other | emberjs | ember.js | 8544921eeef3a9c043199a3d82f1467b86d14f72.json | Use correct syntax for importing a default export.
The best replacement for importing `default` and a named
export is:
```javascript
import SomeDefaultExport, {
namedStuff
} from 'path/goes/here';
```
But we cannot use this because the syntax is not recognized by JSHint as
being valid.
So this changes them to use the slightly more verbose version:
```javascript
import SomeDefaultExport from 'path/goes/here';
import {
namedStuff
} from 'path/goes/here';
``` | packages/ember-views/lib/views/view.js | @@ -30,7 +30,10 @@ import CoreView from "ember-views/views/core_view";
import ViewStreamSupport from "ember-views/mixins/view_stream_support";
import ViewKeywordSupport from "ember-views/mixins/view_keyword_support";
import ViewContextSupport from "ember-views/mixins/view_context_support";
-import { default as ViewChildViewsSupport, childViewsProperty } from "ember-views/mixins/view_child_views_support";
+import ViewChildViewsSupport from "ember-views/mixins/view_child_views_support";
+import {
+ childViewsProperty
+} from "ember-views/mixins/view_child_views_support";
import ViewStateSupport from "ember-views/mixins/view_state_support";
import TemplateRenderingSupport from "ember-views/mixins/template_rendering_support";
import ClassNamesSupport from "ember-views/mixins/class_names_support"; | true |
Other | emberjs | ember.js | fc935673d59f8f991f6914f5ced383614ef299ee.json | Allow usage of limited ES2015 sematics.
emberjs-build now uses Babel and a whitelist of transforms during
transpilation.
Current whitelisted transforms are:
* [es6.templateLiterals](http://babeljs.io/docs/learn-es6/#template-strings)
* [es6.parameters.rest](http://babeljs.io/docs/learn-es6/#default-rest-spread)
* [es6.arrowFunctions](http://babeljs.io/docs/learn-es6/#arrows)
Additional transforms can be added to the whitelist
[here](https://github.com/emberjs/emberjs-build/blob/72244cbc501adf1266bad941c9d2227308b93629/lib/utils/transpile-es6.js#L18),
but will only be accepted if they are guaranteed to be ES3 safe. | package.json | @@ -18,7 +18,7 @@
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-yuidoc": "^0.4.0",
"ember-publisher": "0.0.7",
- "emberjs-build": "0.0.32",
+ "emberjs-build": "0.0.33",
"express": "^4.5.0",
"github": "^0.2.3",
"glob": "~4.3.2", | true |
Other | emberjs | ember.js | fc935673d59f8f991f6914f5ced383614ef299ee.json | Allow usage of limited ES2015 sematics.
emberjs-build now uses Babel and a whitelist of transforms during
transpilation.
Current whitelisted transforms are:
* [es6.templateLiterals](http://babeljs.io/docs/learn-es6/#template-strings)
* [es6.parameters.rest](http://babeljs.io/docs/learn-es6/#default-rest-spread)
* [es6.arrowFunctions](http://babeljs.io/docs/learn-es6/#arrows)
Additional transforms can be added to the whitelist
[here](https://github.com/emberjs/emberjs-build/blob/72244cbc501adf1266bad941c9d2227308b93629/lib/utils/transpile-es6.js#L18),
but will only be accepted if they are guaranteed to be ES3 safe. | packages/ember-htmlbars/tests/helpers/view_test.js | @@ -1,5 +1,4 @@
/*globals EmberDev */
-import { set } from "ember-metal/property_set";
import EmberView from "ember-views/views/view";
import Registry from "container/registry";
import run from "ember-metal/run_loop"; | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | features.json | @@ -4,7 +4,6 @@
"ember-routing-named-substates": true,
"ember-metal-injected-properties": true,
"mandatory-setter": "development-only",
- "ember-htmlbars": true,
"ember-htmlbars-block-params": true,
"ember-htmlbars-component-generation": null,
"ember-htmlbars-component-helper": true, | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-application/tests/system/dependency_injection/default_resolver_test.js | @@ -93,16 +93,6 @@ QUnit.test("the default resolver resolves helpers", function() {
registerHelper('fooresolvertest', fooresolvertestHelper);
registerHelper('bar-baz-resolver-test', barBazResolverTestHelper);
- var retrievedFooResolverTestHelper, retrievedBarBazResolverTestHelper;
-
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- retrievedFooResolverTestHelper = locator.lookup('helper:fooresolvertest').helperFunction;
- retrievedBarBazResolverTestHelper = locator.lookup('helper:bar-baz-resolver-test').helperFunction;
- } else {
- retrievedFooResolverTestHelper = locator.lookup('helper:fooresolvertest');
- retrievedBarBazResolverTestHelper = locator.lookup('helper:bar-baz-resolver-test');
- }
-
fooresolvertestHelper();
barBazResolverTestHelper();
}); | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/lib/compat.js | @@ -13,21 +13,18 @@ import {
escapeExpression
} from "ember-htmlbars/utils/string";
-var EmberHandlebars;
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- EmberHandlebars = Ember.Handlebars = Ember.Handlebars || {};
- EmberHandlebars.helpers = helpers;
- EmberHandlebars.helper = compatHandlebarsHelper;
- EmberHandlebars.registerHelper = compatRegisterHelper;
- EmberHandlebars.registerBoundHelper = compatRegisterBoundHelper;
- EmberHandlebars.makeBoundHelper = compatMakeBoundHelper;
- EmberHandlebars.get = compatHandlebarsGet;
- EmberHandlebars.makeViewHelper = makeViewHelper;
+var EmberHandlebars = Ember.Handlebars = Ember.Handlebars || {};
+EmberHandlebars.helpers = helpers;
+EmberHandlebars.helper = compatHandlebarsHelper;
+EmberHandlebars.registerHelper = compatRegisterHelper;
+EmberHandlebars.registerBoundHelper = compatRegisterBoundHelper;
+EmberHandlebars.makeBoundHelper = compatMakeBoundHelper;
+EmberHandlebars.get = compatHandlebarsGet;
+EmberHandlebars.makeViewHelper = makeViewHelper;
- EmberHandlebars.SafeString = SafeString;
- EmberHandlebars.Utils = {
- escapeExpression: escapeExpression
- };
-}
+EmberHandlebars.SafeString = SafeString;
+EmberHandlebars.Utils = {
+ escapeExpression: escapeExpression
+};
export default EmberHandlebars; | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/lib/helpers/bind-attr.js | @@ -222,11 +222,7 @@ function applyClassNameBindings(classNameBindings, view) {
function bindAttrHelperDeprecated() {
Ember.deprecate("The 'bindAttr' view helper is deprecated in favor of 'bind-attr'");
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- return helpers['bind-attr'].helperFunction.apply(this, arguments);
- } else {
- return helpers['bind-attr'].apply(this, arguments);
- }
+ return helpers['bind-attr'].helperFunction.apply(this, arguments);
}
export default bindAttrHelper; | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/lib/main.js | @@ -65,15 +65,12 @@ registerHelper('collection', collectionHelper);
registerHelper('each', eachHelper);
registerHelper('unbound', unboundHelper);
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- Ember.HTMLBars = {
- _registerHelper: registerHelper,
- template: template,
- compile: compile,
- precompile: precompile,
- makeViewHelper: makeViewHelper,
- makeBoundHelper: makeBoundHelper,
- registerPlugin: registerPlugin
- };
-
-}
+Ember.HTMLBars = {
+ _registerHelper: registerHelper,
+ template: template,
+ compile: compile,
+ precompile: precompile,
+ makeViewHelper: makeViewHelper,
+ makeBoundHelper: makeBoundHelper,
+ registerPlugin: registerPlugin
+}; | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/lib/system/bootstrap.js | @@ -84,9 +84,6 @@ function registerComponentLookup(registry) {
*/
onLoad('Ember.Application', function(Application) {
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- // jscs:disable validateIndentation
-
Application.initializer({
name: 'domTemplates',
initialize: environment.hasDOM ? _bootstrap : function() { }
@@ -97,9 +94,6 @@ onLoad('Ember.Application', function(Application) {
after: 'domTemplates',
initialize: registerComponentLookup
});
-
- // jscs:enable validateIndentation
- }
});
export default bootstrap; | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/compat/helper_test.js | @@ -12,9 +12,6 @@ import { runAppend, runDestroy } from "ember-runtime/tests/utils";
var view;
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
QUnit.module('ember-htmlbars: Handlebars compatible helpers', {
teardown: function() {
runDestroy(view);
@@ -270,6 +267,3 @@ QUnit.test('`hash` params are to options.hashTypes', function() {
runAppend(view);
});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/compat/precompile_test.js | @@ -1,7 +1,6 @@
import EmberHandlebars from "ember-htmlbars/compat";
var precompile = EmberHandlebars.precompile;
-var parse = EmberHandlebars.parse;
var template = 'Hello World';
var result;
@@ -21,15 +20,3 @@ QUnit.test("precompile creates a string when asObject is false", function() {
result = precompile(template, false);
equal(typeof(result), "string");
});
-
-if (!Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
-QUnit.test("precompile creates an object when passed an AST", function() {
- var ast = parse(template);
- result = precompile(ast);
- equal(typeof(result), "object");
-});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/helpers/bind_attr_test.js | @@ -204,32 +204,19 @@ QUnit.test("{{bindAttr}} is aliased to {{bind-attr}}", function() {
var originalBindAttr = helpers['bind-attr'];
try {
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- helpers['bind-attr'] = {
- helperFunction: function() {
- equal(arguments[0], 'foo', 'First arg match');
- equal(arguments[1], 'bar', 'Second arg match');
-
- return 'result';
- }
- };
- } else {
- helpers['bind-attr'] = function() {
+ helpers['bind-attr'] = {
+ helperFunction: function() {
equal(arguments[0], 'foo', 'First arg match');
equal(arguments[1], 'bar', 'Second arg match');
return 'result';
- };
- }
+ }
+ };
expectDeprecation(function() {
var result;
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- result = helpers.bindAttr.helperFunction('foo', 'bar');
- } else {
- result = helpers.bindAttr('foo', 'bar');
- }
+ result = helpers.bindAttr.helperFunction('foo', 'bar');
equal(result, 'result', 'Result match');
}, "The 'bindAttr' view helper is deprecated in favor of 'bind-attr'");
} finally { | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/helpers/collection_test.js | @@ -86,10 +86,7 @@ QUnit.test("itemViewClass works in the #collection helper with a global (DEPRECA
template: compile('{{#collection content=view.exampleController itemViewClass=TemplateTests.ExampleItemView}}beta{{/collection}}')
});
- var deprecation = /Resolved the view "TemplateTests.ExampleItemView" on the global context/;
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- deprecation = /Global lookup of TemplateTests.ExampleItemView from a Handlebars template is deprecated/;
- }
+ var deprecation = /Global lookup of TemplateTests.ExampleItemView from a Handlebars template is deprecated/;
expectDeprecation(function() {
runAppend(view);
}, deprecation); | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/helpers/each_test.js | @@ -540,10 +540,7 @@ QUnit.test("it supports {{itemViewClass=}} with global (DEPRECATED)", function()
people: people
});
- var deprecation = /Resolved the view "MyView" on the global context/;
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- deprecation = /Global lookup of MyView from a Handlebars template is deprecated/;
- }
+ var deprecation = /Global lookup of MyView from a Handlebars template is deprecated/;
expectDeprecation(function() {
runAppend(view);
@@ -659,11 +656,7 @@ QUnit.test("it supports {{emptyViewClass=}} with global (DEPRECATED)", function(
people: A()
});
- var deprecation = /Resolved the view "MyEmptyView" on the global context/;
-
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- deprecation = /Global lookup of MyEmptyView from a Handlebars template is deprecated/;
- }
+ var deprecation = /Global lookup of MyEmptyView from a Handlebars template is deprecated/;
expectDeprecation(function() {
runAppend(view); | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/helpers/loc_test.js | @@ -51,8 +51,6 @@ QUnit.test('localize takes passed formats into an account', function() {
runDestroy(view);
});
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
QUnit.test('localize throws an assertion if the second parameter is a binding', function() {
var view = buildView('{{loc "Hello %@" name}}', {
name: 'Bob Foster'
@@ -76,5 +74,3 @@ QUnit.test('localize a binding throws an assertion', function() {
runDestroy(view);
});
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/helpers/yield_test.js | @@ -215,31 +215,6 @@ QUnit.test("can bind a keyword to a component and use it in yield", function() {
equal(view.$('div p:contains(update) + p:contains(update)').length, 1, "keyword has correctly propagated update");
});
-if (!Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
-QUnit.test("yield uses the layout context for non component [DEPRECATED]", function() {
- view = EmberView.create({
- controller: {
- boundText: "outer",
- inner: {
- boundText: "inner"
- }
- },
- layout: compile("<p>{{boundText}}</p>{{#with inner}}<p>{{yield}}</p>{{/with}}"),
- template: compile('{{boundText}}')
- });
-
- expectDeprecation(function() {
- runAppend(view);
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
-
- equal('outerinner', view.$('p').text(), "Yield points at the right context");
-});
-
-// jscs:enable validateIndentation
-}
-
QUnit.test("yield view should be a virtual view", function() {
var component = Component.extend({
isParentComponent: true, | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/hooks/component_test.js | @@ -6,53 +6,44 @@ import { runAppend, runDestroy } from "ember-runtime/tests/utils";
var view, registry, container;
-// this is working around a bug in defeatureify that prevents nested flags
-// from being stripped
-var componentGenerationEnabled = false;
if (Ember.FEATURES.isEnabled('ember-htmlbars-component-generation')) {
- componentGenerationEnabled = true;
-}
-
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- if (componentGenerationEnabled) {
- QUnit.module("ember-htmlbars: component hook", {
- setup: function() {
- registry = new Registry();
- container = registry.container();
-
- registry.optionsForType('template', { instantiate: false });
- registry.register('component-lookup:main', ComponentLookup);
- },
-
- teardown: function() {
- runDestroy(view);
- runDestroy(container);
- registry = container = view = null;
- }
+ QUnit.module("ember-htmlbars: component hook", {
+ setup: function() {
+ registry = new Registry();
+ container = registry.container();
+
+ registry.optionsForType('template', { instantiate: false });
+ registry.register('component-lookup:main', ComponentLookup);
+ },
+
+ teardown: function() {
+ runDestroy(view);
+ runDestroy(container);
+ registry = container = view = null;
+ }
+ });
+
+ QUnit.test("component is looked up from the container", function() {
+ registry.register('template:components/foo-bar', compile('yippie!'));
+
+ view = EmberView.create({
+ container: container,
+ template: compile("<foo-bar />")
});
- QUnit.test("component is looked up from the container", function() {
- registry.register('template:components/foo-bar', compile('yippie!'));
+ runAppend(view);
- view = EmberView.create({
- container: container,
- template: compile("<foo-bar />")
- });
-
- runAppend(view);
+ equal(view.$().text(), 'yippie!', 'component was looked up and rendered');
+ });
- equal(view.$().text(), 'yippie!', 'component was looked up and rendered');
+ QUnit.test("asserts if component is not found", function() {
+ view = EmberView.create({
+ container: container,
+ template: compile("<foo-bar />")
});
- QUnit.test("asserts if component is not found", function() {
- view = EmberView.create({
- container: container,
- template: compile("<foo-bar />")
- });
-
- expectAssertion(function() {
- runAppend(view);
- }, 'You specified `foo-bar` in your template, but a component for `foo-bar` could not be found.');
- });
- }
+ expectAssertion(function() {
+ runAppend(view);
+ }, 'You specified `foo-bar` in your template, but a component for `foo-bar` could not be found.');
+ });
} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/hooks/text_node_test.js | @@ -7,45 +7,43 @@ import { runAppend, runDestroy } from "ember-runtime/tests/utils";
var view;
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- QUnit.module("ember-htmlbars: hooks/text_node_test", {
- teardown: function() {
- runDestroy(view);
- }
+QUnit.module("ember-htmlbars: hooks/text_node_test", {
+ teardown: function() {
+ runDestroy(view);
+ }
+});
+
+QUnit.test("property is output", function() {
+ view = EmberView.create({
+ context: { name: 'erik' },
+ template: compile("ohai {{name}}")
});
+ runAppend(view);
- QUnit.test("property is output", function() {
- view = EmberView.create({
- context: { name: 'erik' },
- template: compile("ohai {{name}}")
- });
- runAppend(view);
+ equalInnerHTML(view.element, 'ohai erik', "property is output");
+});
- equalInnerHTML(view.element, 'ohai erik', "property is output");
+QUnit.test("path is output", function() {
+ view = EmberView.create({
+ context: { name: { firstName: 'erik' } },
+ template: compile("ohai {{name.firstName}}")
});
+ runAppend(view);
- QUnit.test("path is output", function() {
- view = EmberView.create({
- context: { name: { firstName: 'erik' } },
- template: compile("ohai {{name.firstName}}")
- });
- runAppend(view);
+ equalInnerHTML(view.element, 'ohai erik', "path is output");
+});
- equalInnerHTML(view.element, 'ohai erik', "path is output");
+QUnit.test("changed property updates", function() {
+ var context = EmberObject.create({ name: 'erik' });
+ view = EmberView.create({
+ context: context,
+ template: compile("ohai {{name}}")
});
+ runAppend(view);
- QUnit.test("changed property updates", function() {
- var context = EmberObject.create({ name: 'erik' });
- view = EmberView.create({
- context: context,
- template: compile("ohai {{name}}")
- });
- runAppend(view);
+ equalInnerHTML(view.element, 'ohai erik', "precond - original property is output");
- equalInnerHTML(view.element, 'ohai erik', "precond - original property is output");
+ run(context, context.set, 'name', 'mmun');
- run(context, context.set, 'name', 'mmun');
-
- equalInnerHTML(view.element, 'ohai mmun', "new property is output");
- });
-}
+ equalInnerHTML(view.element, 'ohai mmun', "new property is output");
+}); | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/htmlbars_test.js | @@ -4,16 +4,13 @@ import { domHelper } from "ember-htmlbars/env";
import { equalHTML } from "htmlbars-test-helpers";
import merge from "ember-metal/merge";
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
+QUnit.module("ember-htmlbars: main");
- QUnit.module("ember-htmlbars: main");
+QUnit.test("HTMLBars is present and can be executed", function() {
+ var template = compile("ohai");
- QUnit.test("HTMLBars is present and can be executed", function() {
- var template = compile("ohai");
+ var env = merge({ dom: domHelper }, defaultEnv);
- var env = merge({ dom: domHelper }, defaultEnv);
-
- var output = template.render({}, env, document.body);
- equalHTML(output, "ohai");
- });
-}
+ var output = template.render({}, env, document.body);
+ equalHTML(output, "ohai");
+}); | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-htmlbars/tests/system/make_bound_helper_test.js | @@ -19,9 +19,6 @@ function registerRepeatHelper() {
}));
}
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
QUnit.module("ember-htmlbars: makeBoundHelper", {
setup: function() {
registry = new Registry();
@@ -276,6 +273,3 @@ QUnit.test('when no hash parameters are bound, no new views are created', functi
ok(!renderWasCalled, 'simple bound view should not have been created and rendered');
equal(view.$().text(), 'aaa');
});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-routing-htmlbars/tests/helpers/action_test.js | @@ -143,8 +143,6 @@ QUnit.test("Inside a yield, the target points at the original target", function(
equal(watted, true, "The action was called on the right context");
});
-if (!Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
QUnit.test("should target the current controller inside an {{each}} loop [DEPRECATED]", function() {
var registeredTarget;
@@ -167,7 +165,7 @@ QUnit.test("should target the current controller inside an {{each}} loop [DEPREC
view = EmberView.create({
controller: controller,
- template: compile('{{#each controller}}{{action "editTodo"}}{{/each}}')
+ template: compile('{{#each controller}}<button {{action "editTodo"}}>Edit</button>{{/each}}')
});
expectDeprecation(function() {
@@ -176,8 +174,6 @@ QUnit.test("should target the current controller inside an {{each}} loop [DEPREC
equal(registeredTarget, itemController, "the item controller is the target of action");
});
-// jscs:enable validateIndentation
-}
QUnit.test("should target the with-controller inside an {{#with controller='person'}} [DEPRECATED]", function() {
var registeredTarget; | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-routing-htmlbars/tests/helpers/outlet_test.js | @@ -1,4 +1,3 @@
-import Ember from 'ember-metal/core'; // TEMPLATES
import run from "ember-metal/run_loop";
import Namespace from "ember-runtime/system/namespace";
@@ -178,12 +177,8 @@ QUnit.test("Outlets bind to the current view, not the current concrete view", fu
equal(output, "BOTTOM", "all templates were rendered");
});
-// TODO: Remove flag when {{with}} is fixed.
-if (!Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
QUnit.test("Outlets bind to the current template's view, not inner contexts [DEPRECATED]", function() {
- var parentTemplate = "<h1>HI</h1>{{#if view.alwaysTrue}}{{#with this}}{{outlet}}{{/with}}{{/if}}";
+ var parentTemplate = "<h1>HI</h1>{{#if view.alwaysTrue}}{{outlet}}{{/if}}";
var bottomTemplate = "<h3>BOTTOM</h3>";
var routerState = {
@@ -198,9 +193,7 @@ QUnit.test("Outlets bind to the current template's view, not inner contexts [DEP
top.setOutletState(routerState);
- expectDeprecation(function() {
- runAppend(top);
- }, 'Using the context switching form of `{{with}}` is deprecated. Please use the keyword form (`{{with foo as bar}}`) instead.');
+ runAppend(top);
routerState.outlets.main = withTemplate(bottomTemplate);
@@ -212,9 +205,6 @@ QUnit.test("Outlets bind to the current template's view, not inner contexts [DEP
equal(output, "BOTTOM", "all templates were rendered");
});
-// jscs:enable validateIndentation
-}
-
QUnit.test("should support layouts", function() {
var template = "{{outlet}}";
var layout = "<h1>HI</h1>{{yield}}";
@@ -254,21 +244,12 @@ QUnit.test("should not throw deprecations if {{outlet}} is used with a quoted na
runAppend(top);
});
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- QUnit.test("should throw an assertion if {{outlet}} used with unquoted name", function() {
- top.setOutletState(withTemplate("{{outlet foo}}"));
- expectAssertion(function() {
- runAppend(top);
- }, "Using {{outlet}} with an unquoted name is not supported.");
- });
-} else {
- QUnit.test("should throw a deprecation if {{outlet}} is used with an unquoted name", function() {
- top.setOutletState(withTemplate("{{outlet foo}}"));
- expectDeprecation(function() {
- runAppend(top);
- }, 'Using {{outlet}} with an unquoted name is not supported. Please update to quoted usage \'{{outlet "foo"}}\'.');
- });
-}
+QUnit.test("should throw an assertion if {{outlet}} used with unquoted name", function() {
+ top.setOutletState(withTemplate("{{outlet foo}}"));
+ expectAssertion(function() {
+ runAppend(top);
+ }, "Using {{outlet}} with an unquoted name is not supported.");
+});
function withTemplate(string) {
return { | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-routing-htmlbars/tests/helpers/render_test.js | @@ -506,9 +506,6 @@ QUnit.test("{{render}} works with slash notation", function() {
equal(container.lookup('controller:blog.post'), renderedView.get('controller'), 'rendered with correct controller');
});
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
QUnit.test("throws an assertion if {{render}} is called with an unquoted template name", function() {
var template = '<h1>HI</h1>{{render home}}';
var controller = EmberController.extend({ container: container });
@@ -538,26 +535,3 @@ QUnit.test("throws an assertion if {{render}} is called with a literal for a mod
runAppend(view);
}, "The second argument of {{render}} must be a path, e.g. {{render \"post\" post}}.");
});
-
-// jscs:enable validateIndentation
-} else {
-// jscs:disable validateIndentation
-
-QUnit.test("Using quoteless templateName works properly (DEPRECATED)", function() {
- var template = '<h1>HI</h1>{{render home}}';
- var controller = EmberController.extend({ container: container });
- view = EmberView.create({
- controller: controller.create(),
- template: compile(template)
- });
-
- Ember.TEMPLATES['home'] = compile("<p>BYE</p>");
-
- expectDeprecation("Using a quoteless parameter with {{render}} is deprecated. Please update to quoted usage '{{render \"home\"}}.");
- runAppend(view);
-
- equal(view.$('p:contains(BYE)').length, 1, "template was rendered");
-});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-template-compiler/tests/system/compile_test.js | @@ -3,9 +3,6 @@ import {
compile as htmlbarsCompile
} from "htmlbars-compiler/compiler";
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
QUnit.module('ember-htmlbars: compile');
QUnit.test('compiles the provided template with htmlbars', function() {
@@ -42,6 +39,3 @@ QUnit.test('the template revision is different than the HTMLBars default revisio
ok(actual.revision !== expected.revision, 'revision differs from default');
});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-template-compiler/tests/system/template_test.js | @@ -1,8 +1,5 @@
import template from "ember-template-compiler/system/template";
-if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
QUnit.module('ember-htmlbars: template');
QUnit.test('sets `isTop` on the provided function', function() {
@@ -20,6 +17,3 @@ QUnit.test('sets `isMethod` on the provided function', function() {
equal(test.isMethod, false, 'sets isMethod on the provided function');
});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember-views/lib/views/view.js | @@ -762,12 +762,7 @@ var View = CoreView.extend(
var template = get(this, 'template');
if (template) {
- var useHTMLBars = false;
- if (Ember.FEATURES.isEnabled('ember-htmlbars')) {
- useHTMLBars = template.isHTMLBars;
- }
-
- if (useHTMLBars) {
+ if (template.isHTMLBars) {
return template.render(this, options, morph.contextualElement);
} else {
return template(context, options); | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember/tests/component_registration_test.js | @@ -180,21 +180,14 @@ QUnit.test("Assigning templateName and layoutName should use the templates speci
equal(Ember.$('#wrapper').text(), "inner-outer", "The component is composed correctly");
});
-if (!Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
- // ember-htmlbars doesn't throw an exception when a helper is not found
-
QUnit.test('Using name of component that does not exist', function () {
Ember.TEMPLATES.application = compile("<div id='wrapper'>{{#no-good}} {{/no-good}}</div>");
throws(function () {
boot();
- }, /Could not find component or helper named 'no-good'/);
+ }, /A helper named `no-good` could not be found/);
});
-// jscs:enable validateIndentation
-}
-
QUnit.module("Application Lifecycle - Component Context", {
setup: prepare,
teardown: cleanup | true |
Other | emberjs | ember.js | 1a18ed539fd7320b9c87d378e6750b41da33d3d6.json | Remove ember-htmlbars feature flagging.
It has :ship:'ed. | packages/ember/tests/helpers/helper_registration_test.js | @@ -80,37 +80,24 @@ QUnit.test("Bound helpers registered on the container can be late-invoked", func
ok(!helpers['x-reverse'], "Container-registered helper doesn't wind up on global helpers hash");
});
-if (!Ember.FEATURES.isEnabled('ember-htmlbars')) {
-// jscs:disable validateIndentation
-
// we have unit tests for this in ember-htmlbars/tests/system/lookup-helper
// and we are not going to recreate the handlebars helperMissing concept
QUnit.test("Undashed helpers registered on the container can not (presently) be invoked", function() {
- var realHelperMissing = helpers.helperMissing;
- helpers.helperMissing = function() {
- return "NOHALPER";
- };
-
// Note: the reason we're not allowing undashed helpers is to avoid
// a possible perf hit in hot code paths, i.e. _triageMustache.
// We only presently perform container lookups if prop.indexOf('-') >= 0
Ember.TEMPLATES.application = compile("<div id='wrapper'>{{omg}}|{{omg 'GRRR'}}|{{yorp}}|{{yorp 'ahh'}}</div>");
- boot(function() {
- registry.register('helper:omg', function() {
- return "OMG";
+ expectAssertion(function() {
+ boot(function() {
+ registry.register('helper:omg', function() {
+ return "OMG";
+ });
+ registry.register('helper:yorp', makeBoundHelper(function() {
+ return "YORP";
+ }));
});
- registry.register('helper:yorp', makeBoundHelper(function() {
- return "YORP";
- }));
- });
-
- equal(Ember.$('#wrapper').text(), "|NOHALPER||NOHALPER", "The undashed helper was invoked from the container");
-
- helpers.helperMissing = realHelperMissing;
+ }, /A helper named 'omg' could not be found/);
});
-
-// jscs:enable validateIndentation
-} | true |
Other | emberjs | ember.js | 00ad738432088ab02eba822b5d55137b9e138ffd.json | Specify vendored packages in Ember's Brocfile.
Rather than rely on emberjs-build to do this. | Brocfile.js | @@ -8,9 +8,29 @@
var EmberBuild = require('emberjs-build');
var packages = require('./lib/packages');
+var vendoredPackage = require('emberjs-build/lib/vendored-package');
+var htmlbarsPackage = require('emberjs-build/lib/htmlbars-package');
+var vendoredES6Package = require('emberjs-build/lib/es6-vendored-package');
+
var emberBuild = new EmberBuild({
htmlbars: require('htmlbars'),
- packages: packages
+ packages: packages,
+ _vendoredPackages: {
+ 'loader': vendoredPackage('loader'),
+ 'rsvp': vendoredES6Package('rsvp'),
+ 'backburner': vendoredES6Package('backburner'),
+ 'router': vendoredES6Package('router.js'),
+ 'dag-map': vendoredES6Package('dag-map'),
+ 'route-recognizer': htmlbarsPackage('route-recognizer', { libPath: 'node_modules/route-recognizer/dist/es6/' }),
+ 'dom-helper': htmlbarsPackage('dom-helper'),
+ 'morph-range': htmlbarsPackage('morph-range'),
+ 'morph-attr': htmlbarsPackage('morph-attr'),
+ 'htmlbars-compiler': htmlbarsPackage('htmlbars-compiler'),
+ 'htmlbars-syntax': htmlbarsPackage('htmlbars-syntax'),
+ 'simple-html-tokenizer': htmlbarsPackage('simple-html-tokenizer'),
+ 'htmlbars-test-helpers': htmlbarsPackage('htmlbars-test-helpers', { singleFile: true }),
+ 'htmlbars-util': htmlbarsPackage('htmlbars-util')
+ }
});
module.exports = emberBuild.getDistTrees(); | false |
Other | emberjs | ember.js | a60f255243aa1936320e4dfb96800065bce36909.json | Update emberjs-build to v0.0.28.
Provides local copy of HTMLBars, so that we do not have to update in
both Ember and emberjs-builds in the future. | Brocfile.js | @@ -9,6 +9,7 @@ var EmberBuild = require('emberjs-build');
var packages = require('./lib/packages');
var emberBuild = new EmberBuild({
+ htmlbars: require('htmlbars'),
packages: packages
});
| true |
Other | emberjs | ember.js | a60f255243aa1936320e4dfb96800065bce36909.json | Update emberjs-build to v0.0.28.
Provides local copy of HTMLBars, so that we do not have to update in
both Ember and emberjs-builds in the future. | package.json | @@ -17,7 +17,7 @@
"ember-cli": "0.1.12",
"ember-cli-yuidoc": "^0.4.0",
"ember-publisher": "0.0.7",
- "emberjs-build": "0.0.27",
+ "emberjs-build": "0.0.28",
"express": "^4.5.0",
"github": "^0.2.3",
"glob": "~4.3.2", | true |
Other | emberjs | ember.js | 36f8358377982fe719ea7a9fec5b8e72f74258d1.json | Update htmlbars to 0.11.0 | package.json | @@ -21,7 +21,7 @@
"express": "^4.5.0",
"github": "^0.2.3",
"glob": "~4.3.2",
- "htmlbars": "tildeio/htmlbars#master",
+ "htmlbars": "0.11.0",
"qunit-extras": "^1.3.0",
"qunitjs": "^1.16.0",
"route-recognizer": "0.1.5", | false |
Other | emberjs | ember.js | 1e54081264e72affc0f22ac685b0ad21c771b552.json | Move beforeRender/afterRender into the legacy bin | packages/ember-views/lib/mixins/legacy_view_support.js | @@ -3,6 +3,10 @@ import { Mixin } from "ember-metal/mixin";
import { get } from "ember-metal/property_get";
var LegacyViewSupport = Mixin.create({
+ beforeRender: function(buffer) {},
+
+ afterRender: function(buffer) {},
+
mutateChildViews: function(callback) {
var childViews = this._childViews;
var idx = childViews.length; | true |
Other | emberjs | ember.js | 1e54081264e72affc0f22ac685b0ad21c771b552.json | Move beforeRender/afterRender into the legacy bin | packages/ember-views/lib/views/view.js | @@ -1174,10 +1174,6 @@ var View = CoreView.extend(
*/
parentViewDidChange: K,
- beforeRender: function(buffer) {},
-
- afterRender: function(buffer) {},
-
applyAttributesToBuffer: function(buffer) {
// Creates observers for all registered class name and attribute bindings,
// then adds them to the element. | true |
Other | emberjs | ember.js | a9422f48228f5943886999d5ae3025464c18c409.json | adjust morph usage to be inclusive | packages/ember-metal-views/lib/renderer.js | @@ -170,7 +170,12 @@ Renderer.prototype.appendAttrTo =
Renderer.prototype.replaceIn =
function Renderer_replaceIn(view, target) {
- var morph = this._dom.createMorph(target, null, null);
+ var morph;
+ if (target.firstNode) {
+ morph = this._dom.createMorph(target, target.firstNode, target.lastNode);
+ } else {
+ morph = this._dom.appendMorph(target);
+ }
this.scheduleInsert(view, morph);
};
| true |
Other | emberjs | ember.js | a9422f48228f5943886999d5ae3025464c18c409.json | adjust morph usage to be inclusive | packages/ember-metal-views/tests/test_helpers.js | @@ -47,15 +47,13 @@ MetalRenderer.prototype.createElement = function (view, contextualElement) {
}
}
if (view.childViews) {
- view._childViewsMorph = this._dom.createMorph(el, null, null);
+ view._childViewsMorph = this._dom.appendMorph(el);
} else if (view.textContent) {
setElementText(el, view.textContent);
} else if (view.innerHTML) {
this._dom.detectNamespace(el);
- var nodes = this._dom.parseHTML(view.innerHTML, el);
- while (nodes[0]) {
- el.appendChild(nodes[0]);
- }
+ var frag = this._dom.parseHTML(view.innerHTML, el);
+ el.appendChild(frag);
}
return el;
}; | true |
Other | emberjs | ember.js | a9422f48228f5943886999d5ae3025464c18c409.json | adjust morph usage to be inclusive | packages/ember-views/lib/system/render_buffer.js | @@ -528,11 +528,8 @@ RenderBuffer.prototype = {
if (content.nodeType) {
this._element.appendChild(content);
} else {
- var nodes;
- nodes = this.dom.parseHTML(content, contextualElement);
- while (nodes[0]) {
- this._element.appendChild(nodes[0]);
- }
+ var frag = this.dom.parseHTML(content, contextualElement);
+ this._element.appendChild(frag);
}
// This should only happen with legacy string buffers | true |
Other | emberjs | ember.js | a9422f48228f5943886999d5ae3025464c18c409.json | adjust morph usage to be inclusive | packages/ember-views/lib/system/utils.js | @@ -17,8 +17,8 @@ export function isSimpleClick(event) {
*/
function getViewRange(view) {
var range = document.createRange();
- range.setStartAfter(view._morph.start);
- range.setEndBefore(view._morph.end);
+ range.setStartBefore(view._morph.firstNode);
+ range.setEndAfter(view._morph.lastNode);
return range;
}
| true |
Other | emberjs | ember.js | a9422f48228f5943886999d5ae3025464c18c409.json | adjust morph usage to be inclusive | packages/ember-views/lib/views/container_view.js | @@ -267,13 +267,7 @@ var ContainerView = View.extend(MutableArray, {
var element = buffer.element();
var dom = buffer.dom;
- if (this.tagName === '') {
- element = dom.createDocumentFragment();
- buffer._element = element;
- this._childViewsMorph = dom.appendMorph(element, this._morph.contextualElement);
- } else {
- this._childViewsMorph = dom.createMorph(element, element.lastChild, null);
- }
+ this._childViewsMorph = dom.appendMorph(element);
return element;
}, | true |
Other | emberjs | ember.js | 3c49cf2be64a5909b223baf0dcb9bff8f753b615.json | adjust container view | packages/ember-metal-views/lib/renderer.js | @@ -17,10 +17,9 @@ function Renderer(_helper, _destinedForDOM) {
this._destinedForDOM = _destinedForDOM === undefined ? true : _destinedForDOM;
}
-function Renderer_renderTree(_view, _parentView, _insertAt) {
+function Renderer_renderTree(_view, _parentView, _refMorph) {
var views = this._views;
views[0] = _view;
- var insertAt = _insertAt === undefined ? -1 : _insertAt;
var index = 0;
var total = 1;
var levelBase = _parentView ? _parentView._level+1 : 0;
@@ -114,15 +113,15 @@ function Renderer_renderTree(_view, _parentView, _insertAt) {
parentIndex = parents[level];
parent = parentIndex === -1 ? _parentView : views[parentIndex];
- this.insertElement(view, parent, element, -1);
+ this.insertElement(view, parent, element, null);
index = queue[--length];
view = views[index];
element = elements[level];
elements[level] = null;
}
}
- this.insertElement(view, _parentView, element, insertAt);
+ this.insertElement(view, _parentView, element, _refMorph);
for (i=total-1; i>=0; i--) {
if (willInsert) {
@@ -244,19 +243,15 @@ function Renderer_remove(_view, shouldDestroy, reset) {
}
}
-function Renderer_insertElement(view, parentView, element, index) {
+function Renderer_insertElement(view, parentView, element, refMorph) {
if (element === null || element === undefined) {
return;
}
if (view._morph) {
view._morph.setContent(element);
} else if (parentView) {
- if (index === -1) {
- view._morph = parentView._childViewsMorph.append(element);
- } else {
- view._morph = parentView._childViewsMorph.insert(index, element);
- }
+ view._morph = parentView._childViewsMorph.insertContentBeforeMorph(element, refMorph);
}
}
| true |
Other | emberjs | ember.js | 3c49cf2be64a5909b223baf0dcb9bff8f753b615.json | adjust container view | packages/ember-views/lib/views/container_view.js | @@ -395,11 +395,13 @@ merge(states.hasElement, {
var childViews = view._childViews;
var renderer = view._renderer;
- var i, len, childView;
- for (i = 0, len = childViews.length; i < len; i++) {
- childView = childViews[i];
- if (!childView._elementCreated) {
- renderer.renderTree(childView, view, i);
+ var refMorph = null;
+ for (var i = childViews.length-1; i >= 0; i--) {
+ var childView = childViews[i];
+ if (childView._elementCreated) {
+ refMorph = childView._morph;
+ } else {
+ renderer.renderTree(childView, view, refMorph);
}
}
} | true |
Other | emberjs | ember.js | c7b4af6b7a0484b7dab57ab85673121d5a3d7d07.json | Remove dead code | packages/ember-views/lib/views/view.js | @@ -3,9 +3,6 @@
// Ember.ContainerView circular dependency
// Ember.ENV
import Ember from 'ember-metal/core';
-
-import Evented from "ember-runtime/mixins/evented";
-import EmberObject from "ember-runtime/system/object";
import EmberError from "ember-metal/error";
import { get } from "ember-metal/property_get";
import run from "ember-metal/run_loop";
@@ -949,21 +946,6 @@ var View = CoreView.extend(ViewStreamSupport, ViewKeywordSupport, ViewContextSup
return this.currentState.rerender(this);
},
- /**
- Given a property name, returns a dasherized version of that
- property name if the property evaluates to a non-falsy value.
-
- For example, if the view has property `isUrgent` that evaluates to true,
- passing `isUrgent` to this method will return `"is-urgent"`.
-
- @method _classStringForProperty
- @param property
- @private
- */
- _classStringForProperty: function(parsedPath) {
- return View._classStringForValue(parsedPath.path, parsedPath.stream.value(), parsedPath.className, parsedPath.falsyClassName);
- },
-
// ..........................................................
// ELEMENT SUPPORT
//
@@ -1541,20 +1523,6 @@ deprecateProperty(View.prototype, 'states', '_states');
// once the view has been inserted into the DOM, legal manipulations
// are done on the DOM element.
-var mutation = EmberObject.extend(Evented).create();
-// TODO MOVE TO RENDERER HOOKS
-View.addMutationListener = function(callback) {
- mutation.on('change', callback);
-};
-
-View.removeMutationListener = function(callback) {
- mutation.off('change', callback);
-};
-
-View.notifyMutationListeners = function() {
- mutation.trigger('change');
-};
-
/**
Global views hash
| false |
Other | emberjs | ember.js | 35af16591ee00ac74568a9a1ebc859b04bf02658.json | Use standard naming convention for location | packages/ember-routing/lib/location/api.js | @@ -197,6 +197,6 @@ export default {
@since 1.4.0
*/
_getHash: function () {
- return getHash(this._location || this.location);
+ return getHash(this.location);
}
}; | false |
Other | emberjs | ember.js | 54d8d3959ec89e229ac3aef5dcd4a8ab424b2b96.json | Use delegate for AutoLocation
Previously, AutoLocation worked by faking out a `create()` method and
returning a concrete implementation of either HistoryLocation or
AutoLocation.
This was bad for a few reasons. First, messing with `create()` or
`extend()` semantics makes it hard for people to reason about behavior.
The fact that `AutoLocation.create() instanceof AutoLocation` evaluates
to `false` breaks a lot of assumed invariants people have.
Second, it meant that any state needed to pass to the concrete
implementation needed to be available at runtime, which has forced us
to write less-than-elegant code during our app instance refactor for
FastBoot.
For example, you cannot say:
```js
var location = this.container.lookup('location:auto');
location.rootURL = '/foo/';
```
Any state that needs to be set *must* be set at create time, leading
to hard-to-reason-about hacks like setting simple properties via an
injection to guarantee it's available at creation time (since `lookup` doesn't take
arguments). See https://github.com/emberjs/ember.js/blob/48e115928bcb6b366a621370339354c44aad86b1/packages/ember-routing/lib/system/router.js#L347-L351
for a taste of the madness.
Lastly, concrete implementations are instantiated directly via calls
to `create()` rather than going through the container, meaning that
`container` does not get set, nor would any registered injections
actually get injected.
This commit refactors the entire class, making it a standard
Ember.Object, and uses a simple delegate pattern to delegate any calls
from the router onto a concrete implementation chosen at runtime.
Because the concrete implementation is not determined until runtime,
state can be set on the location at any time until the concrete
implementation is accessed, which should allow us to remove some
of the contortions we have to do in the current router code.
Note that this commit does not provide passing tests, as all of the
current tests are hardcoded to assume the concrete-implementation-at-
create-time semantics. | packages/ember-routing/lib/location/api.js | @@ -1,5 +1,6 @@
import Ember from "ember-metal/core"; // deprecate, assert
import environment from "ember-metal/environment";
+import { getHash } from "ember-routing/location/util";
/**
@module ember
@@ -192,15 +193,6 @@ export default {
@since 1.4.0
*/
_getHash: function () {
- // AutoLocation has it at _location, HashLocation at .location.
- // Being nice and not changing
- var href = (this._location || this.location).href;
- var hashIndex = href.indexOf('#');
-
- if (hashIndex === -1) {
- return '';
- } else {
- return href.substr(hashIndex);
- }
+ return getHash(this._location || this.location);
}
}; | true |
Other | emberjs | ember.js | 54d8d3959ec89e229ac3aef5dcd4a8ab424b2b96.json | Use delegate for AutoLocation
Previously, AutoLocation worked by faking out a `create()` method and
returning a concrete implementation of either HistoryLocation or
AutoLocation.
This was bad for a few reasons. First, messing with `create()` or
`extend()` semantics makes it hard for people to reason about behavior.
The fact that `AutoLocation.create() instanceof AutoLocation` evaluates
to `false` breaks a lot of assumed invariants people have.
Second, it meant that any state needed to pass to the concrete
implementation needed to be available at runtime, which has forced us
to write less-than-elegant code during our app instance refactor for
FastBoot.
For example, you cannot say:
```js
var location = this.container.lookup('location:auto');
location.rootURL = '/foo/';
```
Any state that needs to be set *must* be set at create time, leading
to hard-to-reason-about hacks like setting simple properties via an
injection to guarantee it's available at creation time (since `lookup` doesn't take
arguments). See https://github.com/emberjs/ember.js/blob/48e115928bcb6b366a621370339354c44aad86b1/packages/ember-routing/lib/system/router.js#L347-L351
for a taste of the madness.
Lastly, concrete implementations are instantiated directly via calls
to `create()` rather than going through the container, meaning that
`container` does not get set, nor would any registered injections
actually get injected.
This commit refactors the entire class, making it a standard
Ember.Object, and uses a simple delegate pattern to delegate any calls
from the router onto a concrete implementation chosen at runtime.
Because the concrete implementation is not determined until runtime,
state can be set on the location at any time until the concrete
implementation is accessed, which should allow us to remove some
of the contortions we have to do in the current router code.
Note that this commit does not provide passing tests, as all of the
current tests are hardcoded to assume the concrete-implementation-at-
create-time semantics. | packages/ember-routing/lib/location/auto_location.js | @@ -1,13 +1,12 @@
import Ember from "ember-metal/core"; // FEATURES
+import { get } from "ember-metal/property_get";
import { set } from "ember-metal/property_set";
+import { computed } from "ember-metal/computed";
-import EmberLocation from "ember-routing/location/api";
-import HistoryLocation from "ember-routing/location/history_location";
-import HashLocation from "ember-routing/location/hash_location";
-import NoneLocation from "ember-routing/location/none_location";
-
+import EmberObject from "ember-runtime/system/object";
import environment from "ember-metal/environment";
-import { supportsHashChange, supportsHistory } from "ember-routing/location/feature_detect";
+import { supportsHashChange, supportsHistory } from "ember-routing/location/util";
+import { getPath, getOrigin, getHash, getFullPath } from "ember-routing/location/util";
/**
@module ember
@@ -28,32 +27,46 @@ import { supportsHashChange, supportsHistory } from "ember-routing/location/feat
@namespace Ember
@static
*/
-export default {
+export default EmberObject.extend({
/**
@private
- Attached for mocking in tests
+ The browser's `location` object. This is typically equivalent to
+ `window.location`, but may be overridden for testing.
@property location
@default environment.location
*/
- _location: environment.location,
+ location: environment.location,
/**
@private
- Attached for mocking in tests
+ The browser's `history` object. This is typically equivalent to
+ `window.history`, but may be overridden for testing.
@since 1.5.1
@property _history
@default environment.history
*/
- _history: environment.history,
+ history: environment.history,
/**
@private
- This property is used by router:main to know whether to cancel the routing
+ The browser's `userAgent`. This is typically equivalent to
+ `navigator.userAgent`, but may be overridden for testing.
+
+ @since 1.5.1
+ @property userAgent
+ @default environment.history
+ */
+ userAgent: environment.userAgent,
+
+ /**
+ @private
+
+ This property is used by the router to know whether to cancel the routing
setup process, which is needed while we redirect the browser.
@since 1.5.1
@@ -73,285 +86,178 @@ export default {
*/
rootURL: '/',
- /**
- @private
-
- Attached for mocking in tests
-
- @since 1.5.1
- @property _HistoryLocation
- @default Ember.HistoryLocation
- */
- _HistoryLocation: HistoryLocation,
-
- /**
- @private
-
- Attached for mocking in tests
-
- @since 1.5.1
- @property _HashLocation
- @default Ember.HashLocation
- */
- _HashLocation: HashLocation,
-
- /**
- @private
-
- Attached for mocking in tests
-
- @since 1.5.1
- @property _NoneLocation
- @default Ember.NoneLocation
- */
- _NoneLocation: NoneLocation,
-
- /**
- @private
-
- Returns location.origin or builds it if device doesn't support it.
-
- @method _getOrigin
- */
- _getOrigin: function () {
- var location = this._location;
- var origin = location.origin;
-
- // Older browsers, especially IE, don't have origin
- if (!origin) {
- origin = location.protocol + '//' + location.hostname;
-
- if (location.port) {
- origin += ':' + location.port;
- }
+ concreteImplementation: computed(function() {
+ var implementation = detectImplementation({
+ location: this.location,
+ history: this.history,
+ userAgent: this.userAgent,
+ rootURL: this.rootURL
+ });
+
+ if (implementation === false) {
+ set(this, 'cancelRouterSetup', true);
+ implementation = 'none';
}
- return origin;
- },
-
- _userAgent: environment.userAgent,
-
- /**
- @private
-
- @method _getSupportsHistory
- */
- _getSupportsHistory: function () {
- return supportsHistory(environment.userAgent, environment.history);
- },
-
- /**
- @private
-
- @method _getSupportsHashChange
- */
- _getSupportsHashChange: function () {
- return supportsHashChange(document.documentMode, window);
- },
-
- /**
- @private
-
- Redirects the browser using location.replace, prepending the location.origin
- to prevent phishing attempts
-
- @method _replacePath
- */
- _replacePath: function (path) {
- this._location.replace(this._getOrigin() + path);
- },
-
- /**
- @since 1.5.1
- @private
- @method _getRootURL
- */
- _getRootURL: function () {
- return this.rootURL;
- },
+ return this.container.lookup('location:' + implementation);
+ }),
- /**
- @private
+ initState: delegateToConcreteImplementation('initState'),
+ getURL: delegateToConcreteImplementation('getURL'),
+ setURL: delegateToConcreteImplementation('setURL'),
+ replaceURL: delegateToConcreteImplementation('replaceURL'),
+ onUpdateURL: delegateToConcreteImplementation('onUpdateURL'),
+ formatURL: delegateToConcreteImplementation('formatURL'),
- Returns the current `location.pathname`, normalized for IE inconsistencies.
+ willDestroy: function() {
+ var concreteImplementation = get(this, 'concreteImplementation');
- @method _getPath
- */
- _getPath: function () {
- var pathname = this._location.pathname;
- // Various versions of IE/Opera don't always return a leading slash
- if (pathname.charAt(0) !== '/') {
- pathname = '/' + pathname;
+ if (concreteImplementation) {
+ concreteImplementation.destroy();
}
+ }
+});
- return pathname;
- },
-
- /**
- @private
-
- Returns normalized location.hash as an alias to Ember.Location._getHash
-
- @since 1.5.1
- @method _getHash
- */
- _getHash: EmberLocation._getHash,
-
- /**
- @private
-
- Returns location.search
-
- @since 1.5.1
- @method _getQuery
- */
- _getQuery: function () {
- return this._location.search;
- },
-
- /**
- @private
+function delegateToConcreteImplementation(methodName) {
+ return function() {
+ var concreteImplementation = get(this, 'concreteImplementation');
+ concreteImplementation[methodName].apply(concreteImplementation, arguments);
+ };
+}
- Returns the full pathname including query and hash
+/**
+ Given the browser's `location`, `history` and `userAgent`, and a configured
+ root URL, this function detects whether the browser supports the [History
+ API](https://developer.mozilla.org/en-US/docs/Web/API/History) and returns a
+ string representing the Location object to use based on its determination.
- @method _getFullPath
- */
- _getFullPath: function () {
- return this._getPath() + this._getQuery() + this._getHash();
- },
+ For example, if the page loads in an evergreen browser, this function would
+ return the string "history", meaning the history API and thus HistoryLocation
+ should be used. If the page is loaded in IE8, it will return the string
+ "hash," indicating that the History API should be simulated by manipulating the
+ hash portion of the location.
- /**
- @private
+*/
- Returns the current path as it should appear for HistoryLocation supported
- browsers. This may very well differ from the real current path (e.g. if it
- starts off as a hashed URL)
+function detectImplementation(options) {
+ var location = options.location,
+ userAgent = options.userAgent,
+ history = options.history,
+ rootURL = options.rootURL;
- @method _getHistoryPath
- */
- _getHistoryPath: function () {
- var rootURL = this._getRootURL();
- var path = this._getPath();
- var hash = this._getHash();
- var query = this._getQuery();
- var rootURLIndex = path.indexOf(rootURL);
- var routeHash, hashParts;
-
- Ember.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0);
-
- // By convention, Ember.js routes using HashLocation are required to start
- // with `#/`. Anything else should NOT be considered a route and should
- // be passed straight through, without transformation.
- if (hash.substr(0, 2) === '#/') {
- // There could be extra hash segments after the route
- hashParts = hash.substr(1).split('#');
- // The first one is always the route url
- routeHash = hashParts.shift();
-
- // If the path already has a trailing slash, remove the one
- // from the hashed route so we don't double up.
- if (path.slice(-1) === '/') {
- routeHash = routeHash.substr(1);
- }
+ var implementation = 'none';
+ var cancelRouterSetup = false;
+ var currentPath = getFullPath(location);
- // This is the "expected" final order
- path += routeHash;
- path += query;
+ if (supportsHistory(userAgent, history)) {
+ var historyPath = getHistoryPath(rootURL, location);
- if (hashParts.length) {
- path += '#' + hashParts.join('#');
+ // If the browser supports history and we have a history path, we can use
+ // the history location with no redirects.
+ if (currentPath === historyPath) {
+ return 'history';
+ } else {
+ if (currentPath.substr(0, 2) === '/#') {
+ history.replaceState({ path: historyPath }, null, historyPath);
+ implementation = 'history';
+ } else {
+ cancelRouterSetup = true;
+ replacePath(location, historyPath);
}
+ }
+ } else if (supportsHashChange(document.documentMode, window)) {
+ var hashPath = getHashPath(location);
+
+ // Be sure we're using a hashed path, otherwise let's switch over it to so
+ // we start off clean and consistent. We'll count an index path with no
+ // hash as "good enough" as well.
+ if (currentPath === hashPath || (currentPath === '/' && hashPath === '/#/')) {
+ implementation = 'hash';
} else {
- path += query;
- path += hash;
+ // Our URL isn't in the expected hash-supported format, so we want to
+ // cancel the router setup and replace the URL to start off clean
+ cancelRouterSetup = true;
+ replacePath(location, hashPath);
}
+ }
- return path;
- },
-
- /**
- @private
+ if (cancelRouterSetup) {
+ return false;
+ }
- Returns the current path as it should appear for HashLocation supported
- browsers. This may very well differ from the real current path.
+ return implementation;
+}
- @method _getHashPath
- */
- _getHashPath: function () {
- var rootURL = this._getRootURL();
- var path = rootURL;
- var historyPath = this._getHistoryPath();
- var routePath = historyPath.substr(rootURL.length);
-
- if (routePath !== '') {
- if (routePath.charAt(0) !== '/') {
- routePath = '/' + routePath;
- }
+/**
+ @private
- path += '#' + routePath;
+ Returns the current path as it should appear for HistoryLocation supported
+ browsers. This may very well differ from the real current path (e.g. if it
+ starts off as a hashed URL)
+*/
+function getHistoryPath(rootURL, location) {
+ var path = getPath(location);
+ var hash = getHash(location);
+ var query = this._getQuery();
+ var rootURLIndex = path.indexOf(rootURL);
+ var routeHash, hashParts;
+
+ Ember.assert('Path ' + path + ' does not start with the provided rootURL ' + rootURL, rootURLIndex === 0);
+
+ // By convention, Ember.js routes using HashLocation are required to start
+ // with `#/`. Anything else should NOT be considered a route and should
+ // be passed straight through, without transformation.
+ if (hash.substr(0, 2) === '#/') {
+ // There could be extra hash segments after the route
+ hashParts = hash.substr(1).split('#');
+ // The first one is always the route url
+ routeHash = hashParts.shift();
+
+ // If the path already has a trailing slash, remove the one
+ // from the hashed route so we don't double up.
+ if (path.slice(-1) === '/') {
+ routeHash = routeHash.substr(1);
}
- return path;
- },
+ // This is the "expected" final order
+ path += routeHash;
+ path += query;
- /**
- Selects the best location option based off browser support and returns an
- instance of that Location class.
-
- @see Ember.AutoLocation
- @method create
- */
- create: function (options) {
- if (options && options.rootURL) {
- Ember.assert('rootURL must end with a trailing forward slash e.g. "/app/"',
- options.rootURL.charAt(options.rootURL.length-1) === '/');
- this.rootURL = options.rootURL;
+ if (hashParts.length) {
+ path += '#' + hashParts.join('#');
}
+ } else {
+ path += query;
+ path += hash;
+ }
- var historyPath, hashPath;
- var cancelRouterSetup = false;
- var implementationClass = this._NoneLocation;
- var currentPath = this._getFullPath();
-
- if (this._getSupportsHistory()) {
- historyPath = this._getHistoryPath();
+ return path;
+}
- // Since we support history paths, let's be sure we're using them else
- // switch the location over to it.
- if (currentPath === historyPath) {
- implementationClass = this._HistoryLocation;
- } else {
- if (currentPath.substr(0, 2) === '/#') {
- this._history.replaceState({ path: historyPath }, null, historyPath);
- implementationClass = this._HistoryLocation;
- } else {
- cancelRouterSetup = true;
- this._replacePath(historyPath);
- }
- }
+/**
+ @private
- } else if (this._getSupportsHashChange()) {
- hashPath = this._getHashPath();
+ Returns the current path as it should appear for HashLocation supported
+ browsers. This may very well differ from the real current path.
- // Be sure we're using a hashed path, otherwise let's switch over it to so
- // we start off clean and consistent. We'll count an index path with no
- // hash as "good enough" as well.
- if (currentPath === hashPath || (currentPath === '/' && hashPath === '/#/')) {
- implementationClass = this._HashLocation;
- } else {
- // Our URL isn't in the expected hash-supported format, so we want to
- // cancel the router setup and replace the URL to start off clean
- cancelRouterSetup = true;
- this._replacePath(hashPath);
- }
+ @method _getHashPath
+*/
+function getHashPath(rootURL, location) {
+ var path = rootURL;
+ var historyPath = getHistoryPath(rootURL, location);
+ var routePath = historyPath.substr(rootURL.length);
+
+ if (routePath !== '') {
+ if (routePath.charAt(0) !== '/') {
+ routePath = '/' + routePath;
}
- var implementation = implementationClass.create.apply(implementationClass, arguments);
+ path += '#' + routePath;
+ }
- if (cancelRouterSetup) {
- set(implementation, 'cancelRouterSetup', true);
- }
+ return path;
+}
- return implementation;
- }
-};
+function replacePath(location, path) {
+ location.replace(getOrigin(location) + path);
+} | true |
Other | emberjs | ember.js | 54d8d3959ec89e229ac3aef5dcd4a8ab424b2b96.json | Use delegate for AutoLocation
Previously, AutoLocation worked by faking out a `create()` method and
returning a concrete implementation of either HistoryLocation or
AutoLocation.
This was bad for a few reasons. First, messing with `create()` or
`extend()` semantics makes it hard for people to reason about behavior.
The fact that `AutoLocation.create() instanceof AutoLocation` evaluates
to `false` breaks a lot of assumed invariants people have.
Second, it meant that any state needed to pass to the concrete
implementation needed to be available at runtime, which has forced us
to write less-than-elegant code during our app instance refactor for
FastBoot.
For example, you cannot say:
```js
var location = this.container.lookup('location:auto');
location.rootURL = '/foo/';
```
Any state that needs to be set *must* be set at create time, leading
to hard-to-reason-about hacks like setting simple properties via an
injection to guarantee it's available at creation time (since `lookup` doesn't take
arguments). See https://github.com/emberjs/ember.js/blob/48e115928bcb6b366a621370339354c44aad86b1/packages/ember-routing/lib/system/router.js#L347-L351
for a taste of the madness.
Lastly, concrete implementations are instantiated directly via calls
to `create()` rather than going through the container, meaning that
`container` does not get set, nor would any registered injections
actually get injected.
This commit refactors the entire class, making it a standard
Ember.Object, and uses a simple delegate pattern to delegate any calls
from the router onto a concrete implementation chosen at runtime.
Because the concrete implementation is not determined until runtime,
state can be set on the location at any time until the concrete
implementation is accessed, which should allow us to remove some
of the contortions we have to do in the current router code.
Note that this commit does not provide passing tests, as all of the
current tests are hardcoded to assume the concrete-implementation-at-
create-time semantics. | packages/ember-routing/lib/location/util.js | @@ -1,3 +1,67 @@
+/**
+ @private
+
+ Returns the current `location.pathname`, normalized for IE inconsistencies.
+*/
+export function getPath(location) {
+ var pathname = location.pathname;
+ // Various versions of IE/Opera don't always return a leading slash
+ if (pathname.charAt(0) !== '/') {
+ pathname = '/' + pathname;
+ }
+
+ return pathname;
+}
+
+/**
+ @private
+
+ Returns the current `location.search`.
+*/
+export function getQuery(location) {
+ return location.search;
+}
+
+/**
+ @private
+
+ Returns the current `location.hash` by parsing location.href since browsers
+ inconsistently URL-decode `location.hash`.
+
+ Should be passed the browser's `location` object as the first argument.
+
+ https://bugzilla.mozilla.org/show_bug.cgi?id=483304
+*/
+export function getHash(location) {
+ var href = location.href;
+ var hashIndex = href.indexOf('#');
+
+ if (hashIndex === -1) {
+ return '';
+ } else {
+ return href.substr(hashIndex);
+ }
+}
+
+export function getFullPath(location) {
+ return getPath(location) + getQuery(location) + getHash(location);
+}
+
+export function getOrigin(location) {
+ var origin = location.origin;
+
+ // Older browsers, especially IE, don't have origin
+ if (!origin) {
+ origin = location.protocol + '//' + location.hostname;
+
+ if (location.port) {
+ origin += ':' + location.port;
+ }
+ }
+
+ return origin;
+}
+
/*
`documentMode` only exist in Internet Explorer, and it's tested because IE8 running in
IE7 compatibility mode claims to support `onhashchange` but actually does not.
@@ -20,7 +84,6 @@ export function supportsHashChange(documentMode, global) {
@private
@function supportsHistory
*/
-
export function supportsHistory(userAgent, history) {
// Boosted from Modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
// The stock browser on Android 2.2 & 2.3 returns positive on history support | true |
Other | emberjs | ember.js | 54d8d3959ec89e229ac3aef5dcd4a8ab424b2b96.json | Use delegate for AutoLocation
Previously, AutoLocation worked by faking out a `create()` method and
returning a concrete implementation of either HistoryLocation or
AutoLocation.
This was bad for a few reasons. First, messing with `create()` or
`extend()` semantics makes it hard for people to reason about behavior.
The fact that `AutoLocation.create() instanceof AutoLocation` evaluates
to `false` breaks a lot of assumed invariants people have.
Second, it meant that any state needed to pass to the concrete
implementation needed to be available at runtime, which has forced us
to write less-than-elegant code during our app instance refactor for
FastBoot.
For example, you cannot say:
```js
var location = this.container.lookup('location:auto');
location.rootURL = '/foo/';
```
Any state that needs to be set *must* be set at create time, leading
to hard-to-reason-about hacks like setting simple properties via an
injection to guarantee it's available at creation time (since `lookup` doesn't take
arguments). See https://github.com/emberjs/ember.js/blob/48e115928bcb6b366a621370339354c44aad86b1/packages/ember-routing/lib/system/router.js#L347-L351
for a taste of the madness.
Lastly, concrete implementations are instantiated directly via calls
to `create()` rather than going through the container, meaning that
`container` does not get set, nor would any registered injections
actually get injected.
This commit refactors the entire class, making it a standard
Ember.Object, and uses a simple delegate pattern to delegate any calls
from the router onto a concrete implementation chosen at runtime.
Because the concrete implementation is not determined until runtime,
state can be set on the location at any time until the concrete
implementation is accessed, which should allow us to remove some
of the contortions we have to do in the current router code.
Note that this commit does not provide passing tests, as all of the
current tests are hardcoded to assume the concrete-implementation-at-
create-time semantics. | packages/ember-routing/tests/location/auto_location_test.js | @@ -6,7 +6,7 @@ import copy from "ember-runtime/copy";
import EmberObject from "ember-runtime/system/object";
import AutoLocation from "ember-routing/location/auto_location";
import EmberLocation from "ember-routing/location/api";
-import { supportsHistory, supportsHashChange } from "ember-routing/location/feature_detect";
+import { supportsHistory, supportsHashChange } from "ember-routing/location/util";
var AutoTestLocation, location;
| true |
Other | emberjs | ember.js | fd6530b425a8ea2e5001001a24d2a41d3454bdb4.json | Update versions for next cycle. | VERSION | @@ -1 +1 @@
-1.11.0-beta.1+canary
+1.12.0-beta.1+canary | true |
Other | emberjs | ember.js | fd6530b425a8ea2e5001001a24d2a41d3454bdb4.json | Update versions for next cycle. | package.json | @@ -1,7 +1,7 @@
{
"name": "ember",
"license": "MIT",
- "version": "1.11.0-beta.1+canary",
+ "version": "1.12.0-beta.1+canary",
"scripts": {
"build": "ember build --environment production",
"postinstall": "bower install",
@@ -17,7 +17,7 @@
"ember-cli": "0.1.12",
"ember-cli-yuidoc": "^0.4.0",
"ember-publisher": "0.0.7",
- "emberjs-build": "0.0.26",
+ "emberjs-build": "0.0.27",
"express": "^4.5.0",
"github": "^0.2.3",
"glob": "~4.3.2", | true |
Other | emberjs | ember.js | 1c0fb8a7b783ec3936d23416364996f5b967a052.json | Remove Gemfile from repo.
Gems generally do not need to checkin their Gemfiles. | Gemfile | @@ -1,5 +0,0 @@
-source "https://rubygems.org"
-
-# Require the specific version of handlebars-source that
-# we'll be precompiling and performing tests with.
-gemspec | true |
Other | emberjs | ember.js | 1c0fb8a7b783ec3936d23416364996f5b967a052.json | Remove Gemfile from repo.
Gems generally do not need to checkin their Gemfiles. | Gemfile.lock | @@ -1,14 +0,0 @@
-PATH
- remote: .
- specs:
- ember-source (1.11.0.beta.1.canary)
-
-GEM
- remote: https://rubygems.org/
- specs:
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- ember-source! | true |
Other | emberjs | ember.js | 26805fb968858b7d40f4d24c81f8e2b75ddc15f8.json | remove bad advice.
If someone is running into this scenario they are creating a cycle.
Constructor injections cannot absorb cycles. The advice given suggests
the user re-class the entity, by means of register but this will likely
lead them down an ever worse path. As the user will likely now end-up
with two discrete instances when they intend to only have one.
The solutions are:
- inject more specifically `registry.inject('service:bar', 'baz', 'service:baz')`
- use the declarative `Ember.inject.*` which is lazy and obsorbs
cycles | packages/container/lib/registry.js | @@ -479,9 +479,7 @@ Registry.prototype = {
var fullNameType = fullName.split(':')[0];
if (fullNameType === type) {
throw new Error('Cannot inject a `' + fullName +
- '` on other ' + type +
- '(s). Register the `' + fullName +
- '` as a different type and perform the typeInjection.');
+ '` on other ' + type + '(s).');
}
var injections = this._typeInjections[type] || | true |
Other | emberjs | ember.js | 26805fb968858b7d40f4d24c81f8e2b75ddc15f8.json | remove bad advice.
If someone is running into this scenario they are creating a cycle.
Constructor injections cannot absorb cycles. The advice given suggests
the user re-class the entity, by means of register but this will likely
lead them down an ever worse path. As the user will likely now end-up
with two discrete instances when they intend to only have one.
The solutions are:
- inject more specifically `registry.inject('service:bar', 'baz', 'service:baz')`
- use the declarative `Ember.inject.*` which is lazy and obsorbs
cycles | packages/container/tests/registry_test.js | @@ -56,7 +56,7 @@ QUnit.test("Throw exception when trying to inject `type:thing` on all type(s)",
throws(function() {
registry.typeInjection('controller', 'injected', 'controller:post');
- }, 'Cannot inject a `controller:post` on other controller(s). Register the `controller:post` as a different type and perform the typeInjection.');
+ }, 'Cannot inject a `controller:post` on other controller(s).');
});
QUnit.test("The registry can take a hook to resolve factories lazily", function() { | true |
Other | emberjs | ember.js | 10397828ed488475afeb0d38f0d33a68760c70fa.json | Add 1.10.0 to CHANGELOG. | CHANGELOG.md | @@ -29,6 +29,73 @@
- [#10350](https://github.com/emberjs/ember.js/pull/10350) Make meta.cache & meta.cacheMeta lazy [@ebryn](https://github.com/ebryn)
- [#10353](https://github.com/emberjs/ember.js/pull/10353) Avoid creating context bindings for collection views [@mmun](https://github.com/mmun)
+### 1.10.0 (February 6, 2015)
+
+* [BUGFIX] Ensure that property case is normalized.
+* [BUGFIX] Prevent an error from being thrown if the errorThrown property is a string when catching unhandled promise rejections.
+* [BUGFIX] `contenteditable` elements should fire focus events in `ember-testing` click helper.
+* [BUGFIX] Remove HTMLBars from builds `ember.debug.js` and `ember.prod.js` builds. Please see http://emberjs.com/blog/2015/02/05/compiling-templates-in-1-10-0.html for more details.
+* [BUGFIX] Ensure that calling the `wait` testing helpe without routing works properly.
+* [BUGFIX] Ensure that a plus sign in query params are treated as spaces.
+* [BUGFIX] Fix broken `Ember.Test.unregisterWaiter` semantics.
+* [BUGFIX] Allow unbound helpers to add attributes.
+* [BUGFIX] Ensure compat helpers calling `options.fn` work.
+* [BUGFIX] Fix memory leak in view streams.
+* [BUGFIX] Don't render default layout for `Ember.TextField`.
+* Update HTMLBars version to v0.8.5:
+ * Allow numbers to be parsed as HTML in IE.
+ * Add namespace detection.
+ * Include line number in error thrown for unclosed HTML element.
+ * `removeAttribute` fix for IE <11 and SVG.
+ * Disable `cloneNodes` in IE8.
+ * Improve HTML validation and error messages thrown.
+ * Fix a number of template compliation issues in IE8.
+ * Use the correct namespace in `parseHTML` (fixes various issues that occur
+ when changing to and from alternate namespaces).
+ * Ensure values are converted to `String`'s when setting attributes (fixes issues in IE10 & IE11).
+ * Change `setProperty` and `morph` to remove an `undefined` attr value.
+* [BUGFIX] Fix usage of `emptyView` with `{{#each}}` helper.
+* Assert if an attribute set statically and via bind-attr. For example:
+ `<div class="foo" {{bind-attr class="bar"}}></div>` will now trigger an assertion (instead of
+ silently failing).
+* [BUGFIX] Fix deprecated bindAttr helper.
+* [BUGFIX] Do not allow both keyword and block params.
+* Cleanup HTMLBars public API
+ * Remove `Ember.HTMLBars.helper`.
+ * Remove internal `registerBoundHelper` function (use
+ `registerHelper('blah', makeViewHelper(SomeView))` or `registerHelper('blah', makeBoundHelper(func))`).
+* [BUGFIX] Fix Handlebars compat mode `registerHelper` interop with `makeViewHelper`.
+* [BUGFIX] Ensure that `mergedProperties` are properly merged when all properties are not present.
+* Add options argument to pass url to `Ember.deprecate`.
+* Deprecate `{{bind}}` helper.
+* Pass array to `Ember.computed.filter` callback
+* [BUGFIX] Prevent mandatory-setter when setter is already present.
+* Remove Handlebars from dependencies.
+* Fix error when parsing templates with invalid end tags.
+* [BUGFIX] Allow makeBoundHelper to be a sub-expression.
+* [BUGFIX] Allow compat makeBoundHelpers to be sub-expressions.
+* [BUGFIX] Export Ember.Handlebars compat shim for `Ember.Handlebars.SafeString` and `Ember.Handlebars.Utils.escapeExpression`.
+* [BUGFIX] Allow `Ember.inject` injected properties to be overridden (makes testing significantly easier).
+* [BUGFIX] Don’t assert uncaught RSVP rejections. We are already logging the error, but asserting breaks everything else on the run loop queue.
+* [BUGFIX] Allow tagName to be a CP (with deprecation).
+* [BUGFIX] Allow view instances in {{view}}.
+* [BUGFIX] Ensure bound attrs flush immediately.
+* [PERFORMANCE] Initialize views in preRender state.
+* [PERFORMANCE] `View#element` should not be observable.
+* Add ember-template-compiler package.
+* Rename `Ember.HTMLBars.registerASTPlugin` to `Ember.HTMLBars.registerPlugin`.
+* Export `ember-template-compiler.js`.
+* Escape `href`, `src`, and `background` attributes for `a`, `link`, `img`, and `iframe` elements.
+* Move debugging file output from `ember.js` to `ember.debug.js`.
+* Remove `templateData` property from views.
+* Restructure `Ember.libraries` to be more idiomatic.
+* Prevent creating an extra view for each select option.
+* Deprecate the block form of the bind helper.
+* Cleanup `Ember.CoreObject` init argument passing.
+* Allow all rejection types to be handled by default RSVP error handler.
+* Deprecate setting ContainerView#childViews.
+* [FEATURE] ember-htmlbars - Enable the HTMLBars rendering engine.
+* [FEATURE] ember-htmlbars-block-params - Enable block params feature for HTMLBars.
### 1.9.1 (December 23, 2014)
| false |
Other | emberjs | ember.js | bec12a220ed03b304c780fb9305a2eadcfc7b37c.json | Add changelog generator. | bin/changelog | @@ -0,0 +1,71 @@
+#!/usr/bin/env node
+'use strict';
+
+/*
+ * This script generates the template a changelog by comparing a current version
+ * with master. Run this, copy what's logged into the `CHANGELOG.md` and update
+ * the top section based on the changes listed in "Community Contributions"
+ *
+ * Usage:
+ *
+ * bin/changelog
+ */
+
+var EOL = require('os').EOL;
+var RSVP = require('rsvp');
+var Promise = RSVP.Promise;
+var GitHubApi = require('github');
+
+var github = new GitHubApi({version: '3.0.0'});
+var compareCommits = RSVP.denodeify(github.repos.compareCommits);
+var currentVersion = process.env.PRIOR_VERSION;
+
+compareCommits({
+ user: 'emberjs',
+ repo: 'ember.js',
+ base: currentVersion,
+ head: 'master'
+})
+.then(processPages)
+.then(console.log)
+.catch(function(err) {
+ console.error(err);
+})
+
+function processPages(res) {
+ var contributions = res.commits.map(function(commitInfo) {
+ return commitInfo.commit.message
+
+ }).filter(function(message) {
+ return message.indexOf('Merge pull request #') > -1;
+ }).map(function(message) {
+ var numAndAuthor = message.match(/#(\d+) from (.*)\//).slice(1,3);
+ var title = message.split('\n\n')[1];
+
+ return {
+ number: +numAndAuthor[0],
+ author: numAndAuthor[1],
+ title: title
+ };
+ }).sort(function(a, b) {
+ return a.number > b.number;
+ }).map(function(pr) {
+ var link = '[#' + pr.number + ']' +
+ '(https://github.com/emberjs/ember.js/pull/' + pr.number + ')';
+ var title = pr.title;
+ var author = '[@' + pr.author + ']' +
+ '(https://github.com/' + pr.author +')';
+
+ return '- ' + link + ' ' + title + ' ' + author;
+ }).join('\n');
+
+ if (github.hasNextPage(res)) {
+ return github.getNextPage(res)
+ .then(function(nextPage) {
+ console.log('getting next page!');
+ contributions += processPages(nextPage);
+ });
+ } else {
+ return RSVP.resolve(contributions);
+ }
+} | true |
Other | emberjs | ember.js | bec12a220ed03b304c780fb9305a2eadcfc7b37c.json | Add changelog generator. | package.json | @@ -19,6 +19,7 @@
"ember-publisher": "0.0.7",
"emberjs-build": "0.0.25",
"express": "^4.5.0",
+ "github": "^0.2.3",
"glob": "~4.3.2",
"htmlbars": "0.10.0",
"qunit-extras": "^1.3.0", | true |
Other | emberjs | ember.js | 7d3e25ea41ad91978e2405690f5d715e4074f55f.json | Ensure computed.oneWay is exported properly.
We previously imported `oneWay` twice (one for `Ember.oneWay` and the
other for `Ember.computed.oneWay`), and Esperanto automatically rewrites
all usage so that the last imported wins. | packages/ember-metal/lib/main.js | @@ -140,7 +140,7 @@ import {
gte,
lt,
lte,
- oneWay,
+ oneWay as computedOneWay,
readOnly,
defaultTo,
deprecatingAlias,
@@ -162,8 +162,8 @@ computed.gte = gte;
computed.lt = lt;
computed.lte = lte;
computed.alias = alias;
-computed.oneWay = oneWay;
-computed.reads = oneWay;
+computed.oneWay = computedOneWay;
+computed.reads = computedOneWay;
computed.readOnly = readOnly;
computed.defaultTo = defaultTo;
computed.deprecatingAlias = deprecatingAlias; | false |
Other | emberjs | ember.js | 69f6bea2c26d60c4c15ac96a674fa0865632d8fc.json | Remove unnecessary check for `NativeArray`
`ignore` has always one or more items. | packages/ember-runtime/lib/system/native_array.js | @@ -108,9 +108,7 @@ forEach(NativeArray.keys(), function(methodName) {
}
});
-if (ignore.length > 0) {
- NativeArray = NativeArray.without.apply(NativeArray, ignore);
-}
+NativeArray = NativeArray.without.apply(NativeArray, ignore);
/**
Creates an `Ember.NativeArray` from an Array like object. | false |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | lib/packages.js | @@ -1,7 +1,7 @@
module.exports = {
'container': {trees: null, requirements: []},
'ember-metal': {trees: null, vendorRequirements: ['backburner']},
- 'ember-metal-views': {trees: null, vendorRequirements: ['morph']},
+ 'ember-metal-views': {trees: null, vendorRequirements: ['dom-helper', 'morph-range', 'morph-attr']},
'ember-debug': {trees: null, requirements: ['ember-metal'], testing: true},
'ember-runtime': {trees: null, vendorRequirements: ['rsvp'], requirements: ['container', 'ember-metal']},
'ember-views': {trees: null, requirements: ['ember-runtime', 'ember-metal-views']}, | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | package.json | @@ -17,10 +17,10 @@
"ember-cli": "0.1.6",
"ember-cli-yuidoc": "^0.3.1",
"ember-publisher": "0.0.7",
- "emberjs-build": "0.0.23",
+ "emberjs-build": "0.0.24",
"express": "^4.5.0",
"glob": "~4.3.2",
- "htmlbars": "0.8.4",
+ "htmlbars": "0.9.0",
"qunit-extras": "^1.3.0",
"qunitjs": "^1.16.0",
"route-recognizer": "0.1.5", | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-application/lib/system/application.js | @@ -20,7 +20,7 @@ import EnumerableUtils from "ember-metal/enumerable_utils";
import ObjectController from "ember-runtime/controllers/object_controller";
import ArrayController from "ember-runtime/controllers/array_controller";
import Renderer from "ember-views/system/renderer";
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
import SelectView from "ember-views/views/select";
import EmberView from "ember-views/views/view";
import _MetamorphView from "ember-views/views/metamorph_view"; | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-htmlbars/lib/env.js | @@ -1,6 +1,6 @@
import environment from "ember-metal/environment";
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
import inline from "ember-htmlbars/hooks/inline";
import content from "ember-htmlbars/hooks/content"; | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-metal-views/lib/renderer.js | @@ -1,4 +1,4 @@
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
import environment from "ember-metal/environment";
var domHelper = environment.hasDOM ? new DOMHelper() : null; | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-views/lib/main.js | @@ -17,7 +17,7 @@ import {
} from "ember-views/system/utils";
import RenderBuffer from "ember-views/system/render_buffer";
import Renderer from "ember-views/system/renderer";
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
import "ember-views/system/ext"; // for the side effect of extending Ember.run.queues
import {
cloneStates, | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-views/lib/system/render_buffer.js | @@ -7,7 +7,7 @@ import jQuery from "ember-views/system/jquery";
import Ember from "ember-metal/core";
import create from 'ember-metal/platform/create';
import environment from "ember-metal/environment";
-import { normalizeProperty } from "morph/dom-helper/prop";
+import { normalizeProperty } from "dom-helper/prop";
// The HTML spec allows for "omitted start tags". These tags are optional
// when their intended child is the first thing in the parent tag. For | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-views/lib/views/core_view.js | @@ -1,5 +1,5 @@
import Renderer from "ember-views/system/renderer";
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
import {
cloneStates, | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-views/lib/views/view.js | @@ -58,7 +58,7 @@ import {
isStream
} from "ember-metal/streams/utils";
import sanitizeAttributeValue from "ember-views/system/sanitize_attribute_value";
-import { normalizeProperty } from "morph/dom-helper/prop";
+import { normalizeProperty } from "dom-helper/prop";
function K() { return this; }
| true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-views/tests/system/render_buffer_test.js | @@ -1,6 +1,6 @@
import jQuery from "ember-views/system/jquery";
import RenderBuffer from "ember-views/system/render_buffer";
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
var svgNamespace = "http://www.w3.org/2000/svg";
var xhtmlNamespace = "http://www.w3.org/1999/xhtml"; | true |
Other | emberjs | ember.js | 0de59931bec0e0b23b8c3379babbdea5eeeda190.json | Update HTMLBars to 0.9.0 | packages/ember-views/tests/system/sanitize_attribute_value_test.js | @@ -1,6 +1,6 @@
import sanitizeAttributeValue from "ember-views/system/sanitize_attribute_value";
import { SafeString } from "ember-htmlbars/utils/string";
-import { DOMHelper } from "morph";
+import DOMHelper from "dom-helper";
QUnit.module('ember-views: sanitizeAttributeValue(null, "href")');
| true |
Other | emberjs | ember.js | 4e9858137966a7fef62c9de301242656888311e7.json | Update transpiler to Esperanto.
Supports latest ES2015 syntax and features. | package.json | @@ -17,7 +17,7 @@
"ember-cli": "0.1.6",
"ember-cli-yuidoc": "^0.3.1",
"ember-publisher": "0.0.7",
- "emberjs-build": "0.0.22",
+ "emberjs-build": "0.0.23",
"express": "^4.5.0",
"glob": "~4.3.2",
"htmlbars": "0.8.4", | true |
Other | emberjs | ember.js | 4e9858137966a7fef62c9de301242656888311e7.json | Update transpiler to Esperanto.
Supports latest ES2015 syntax and features. | packages/ember-runtime/lib/ext/rsvp.js | @@ -8,7 +8,7 @@ import run from "ember-metal/run_loop";
// it should be `import * as RSVP from 'rsvp';` but
// Esprima does not support this syntax yet (and neither does
// es6-module-transpiler 0.4.0 - 0.6.2).
-module RSVP from 'rsvp';
+import * as RSVP from 'rsvp';
var testModuleName = 'ember-testing/test';
var Test; | true |
Other | emberjs | ember.js | 4e9858137966a7fef62c9de301242656888311e7.json | Update transpiler to Esperanto.
Supports latest ES2015 syntax and features. | packages/ember-runtime/tests/mixins/promise_proxy_test.js | @@ -3,11 +3,11 @@ import {get} from "ember-metal/property_get";
import run from "ember-metal/run_loop";
import ObjectProxy from "ember-runtime/system/object_proxy";
import PromiseProxyMixin from "ember-runtime/mixins/promise_proxy";
-var RSVP = requireModule("rsvp"); // jshint ignore:line
import {
default as EmberRSVP,
onerrorDefault
} from "ember-runtime/ext/rsvp";
+import * as RSVP from 'rsvp';
var ObjectPromiseProxy;
| true |
Other | emberjs | ember.js | 60ff02d81b7676da4fc0fc98b874eef99c8c9f1e.json | Remove unused variable | packages/ember-views/lib/system/sanitize_attribute_value.js | @@ -1,6 +1,5 @@
/* jshint scripturl:true */
-var parsingNode;
var badProtocols = {
'javascript:': true,
'vbscript:': true | false |
Other | emberjs | ember.js | 50bc8bedba68549b7d3c7565ca14d1d126e37276.json | Use DOMHelper to extract URL protocol | packages/ember-htmlbars/lib/hooks/attribute.js | @@ -23,7 +23,7 @@ export default function attribute(env, morph, element, attrName, attrValue) {
if (isStream(attrValue)) {
throw new EmberError('Bound attributes are not yet supported in Ember.js');
} else {
- var sanitizedValue = sanitizeAttributeValue(element, attrName, attrValue);
+ var sanitizedValue = sanitizeAttributeValue(env.dom, element, attrName, attrValue);
env.dom.setProperty(element, attrName, sanitizedValue);
}
} | true |
Other | emberjs | ember.js | 50bc8bedba68549b7d3c7565ca14d1d126e37276.json | Use DOMHelper to extract URL protocol | packages/ember-views/lib/system/sanitize_attribute_value.js | @@ -20,13 +20,9 @@ export var badAttributes = {
'background': true
};
-export default function sanitizeAttributeValue(element, attribute, value) {
+export default function sanitizeAttributeValue(dom, element, attribute, value) {
var tagName;
- if (!parsingNode) {
- parsingNode = document.createElement('a');
- }
-
if (!element) {
tagName = null;
} else {
@@ -38,9 +34,20 @@ export default function sanitizeAttributeValue(element, attribute, value) {
}
if ((tagName === null || badTags[tagName]) && badAttributes[attribute]) {
- parsingNode.href = value;
-
- if (badProtocols[parsingNode.protocol] === true) {
+ // Previously, we relied on creating a new `<a>` element and setting
+ // its `href` in order to get the DOM to parse and extract its protocol.
+ // Naive approaches to URL parsing are susceptible to all sorts of XSS
+ // attacks.
+ //
+ // However, this approach does not work in environments without a DOM,
+ // such as Node & FastBoot. We have extracted the logic for parsing to
+ // the DOM helper, so that in locations without DOM, we can substitute
+ // our own robust URL parsing.
+ //
+ // This will also allow us to use the new `URL` API in browsers that
+ // support it, and skip the process of creating an element entirely.
+ var protocol = dom.protocolForURL(value);
+ if (badProtocols[protocol] === true) {
return 'unsafe:' + value;
}
} | true |
Other | emberjs | ember.js | 50bc8bedba68549b7d3c7565ca14d1d126e37276.json | Use DOMHelper to extract URL protocol | packages/ember-views/lib/views/view.js | @@ -1232,7 +1232,7 @@ var View = CoreView.extend({
// Determine the current value and add it to the render buffer
// if necessary.
attributeValue = get(this, property);
- View.applyAttributeBindings(buffer, attributeName, attributeValue);
+ View.applyAttributeBindings(this.renderer._dom, buffer, attributeName, attributeValue);
} else {
unspecifiedAttributeBindings[property] = attributeName;
}
@@ -1252,7 +1252,7 @@ var View = CoreView.extend({
attributeValue = get(this, property);
- View.applyAttributeBindings(elem, attributeName, attributeValue);
+ View.applyAttributeBindings(this.renderer._dom, elem, attributeName, attributeValue);
};
this.registerObserver(this, property, observer);
@@ -2176,8 +2176,8 @@ View.views = {};
View.childViewsProperty = childViewsProperty;
// Used by Handlebars helpers, view element attributes
-View.applyAttributeBindings = function(elem, name, initialValue) {
- var value = sanitizeAttributeValue(elem[0], name, initialValue);
+View.applyAttributeBindings = function(dom, elem, name, initialValue) {
+ var value = sanitizeAttributeValue(dom, elem[0], name, initialValue);
var type = typeOf(value);
// if this changes, also change the logic in ember-handlebars/lib/helpers/binding.js | true |
Other | emberjs | ember.js | 50bc8bedba68549b7d3c7565ca14d1d126e37276.json | Use DOMHelper to extract URL protocol | packages/ember-views/tests/system/sanitize_attribute_value_test.js | @@ -1,9 +1,11 @@
import sanitizeAttributeValue from "ember-views/system/sanitize_attribute_value";
import { SafeString } from "ember-htmlbars/utils/string";
+import { DOMHelper } from "morph";
QUnit.module('ember-views: sanitizeAttributeValue(null, "href")');
var goodProtocols = ['https', 'http', 'ftp', 'tel', 'file'];
+var dom = new DOMHelper();
for (var i = 0, l = goodProtocols.length; i < l; i++) {
buildProtocolTest(goodProtocols[i]);
@@ -14,7 +16,7 @@ function buildProtocolTest(protocol) {
expect(1);
var expected = protocol + '://foo.com';
- var actual = sanitizeAttributeValue(null, 'href', expected);
+ var actual = sanitizeAttributeValue(dom, null, 'href', expected);
equal(actual, expected, 'protocol not escaped');
});
@@ -26,7 +28,7 @@ test('blocks javascript: protocol', function() {
expect(1);
var expected = 'javascript:alert("foo")';
- var actual = sanitizeAttributeValue(null, 'href', expected);
+ var actual = sanitizeAttributeValue(dom, null, 'href', expected);
equal(actual, 'unsafe:' + expected, 'protocol escaped');
});
@@ -37,7 +39,7 @@ test('blocks blacklisted protocols', function() {
expect(1);
var expected = 'javascript:alert("foo")';
- var actual = sanitizeAttributeValue(null, 'href', expected);
+ var actual = sanitizeAttributeValue(dom, null, 'href', expected);
equal(actual, 'unsafe:' + expected, 'protocol escaped');
});
@@ -48,7 +50,7 @@ test('does not block SafeStrings', function() {
expect(1);
var expected = 'javascript:alert("foo")';
- var actual = sanitizeAttributeValue(null, 'href', new SafeString(expected));
+ var actual = sanitizeAttributeValue(dom, null, 'href', new SafeString(expected));
equal(actual, expected, 'protocol unescaped');
}); | true |
Other | emberjs | ember.js | 93ef88ff323bed9103a25df93cd35f8acf54e986.json | Register default container on fallback registry.
This ensures that all registries will have a reference to the first
container created that references them.
This ensures that deprecated access to `lookup` and `lookupFactory`
on the registry will be proxied to the first container created for a
registry. This avoids breaking compatibility with Ember 1.x
initializers.
[Fixes #10313] | packages/container/lib/registry.js | @@ -143,14 +143,29 @@ Registry.prototype = {
container: function(options) {
var container = new Container(this, options);
- // Allow deprecated access to the first child container's `lookup` and
- // `lookupFactory` methods to avoid breaking compatibility for Ember 1.x
- // initializers.
+ // 2.0TODO - remove `registerContainer`
+ this.registerContainer(container);
+
+ return container;
+ },
+
+ /**
+ Register the first container created for a registery to allow deprecated
+ access to its `lookup` and `lookupFactory` methods to avoid breaking
+ compatibility for Ember 1.x initializers.
+
+ 2.0TODO: Remove this method. The bookkeeping is only needed to support
+ deprecated behavior.
+
+ @param {Container} newly created container
+ */
+ registerContainer: function(container) {
if (!this._defaultContainer) {
this._defaultContainer = container;
}
-
- return container;
+ if (this.fallback) {
+ this.fallback.registerContainer(container);
+ }
},
lookup: function(fullName, options) { | false |
Other | emberjs | ember.js | c8ed6cb6ce96e6a53b8f7095896369442bbc66d9.json | Add test for disabling autoboot | packages/ember-application/tests/system/visit_test.js | @@ -0,0 +1,45 @@
+import run from "ember-metal/run_loop";
+import Application from "ember-application/system/application";
+
+function createApplication() {
+ var app = Application.extend().create({
+ autoboot: false
+ });
+
+ return app;
+}
+
+if (Ember.FEATURES.isEnabled('ember-application-visit')) {
+ QUnit.module("Ember.Application - visit()");
+
+ // This tests whether the application is "autobooted" by registering an
+ // instance initializer and asserting it never gets run. Since this is
+ // inherently testing that async behavior *doesn't* happen, we set a
+ // 500ms timeout to verify that when autoboot is set to false, the
+ // instance initializer that would normally get called on DOM ready
+ // does not fire.
+ QUnit.test("Applications with autoboot set to false do not autoboot", function(assert) {
+ QUnit.expect(1);
+ QUnit.stop();
+
+ run(function() {
+ var app = createApplication();
+
+ // Start the timeout
+ var timeout = setTimeout(function() {
+ ok(true, "500ms elapsed without initializers being called");
+ QUnit.start();
+ }, 500);
+
+ // Create an instance initializer that should *not* get run.
+ app.instanceInitializer({
+ name: "assert-no-autoboot",
+ initialize: function() {
+ clearTimeout(timeout);
+ QUnit.start();
+ assert.ok(false, "instance should not have been created");
+ }
+ });
+ });
+ });
+} | false |
Other | emberjs | ember.js | 1d08c84e5d8cada2a324a595e6159e57ddd0a6f1.json | Add feature flag for visit API | FEATURES.md | @@ -5,6 +5,14 @@ for a detailed explanation.
## Feature Flags
+* `ember-application-visit`
+
+ Provides an API for creating an application instance and specifying
+ an initial URL that it should route to. This is useful for testing
+ (you can have multiple instances of an app without having to run
+ serially and call `reset()` each time), as well as being critical to
+ for FastBoot.
+
* `ember-application-instance-initializers`
Splits apart initializers into two phases:
@@ -217,4 +225,4 @@ for a detailed explanation.
});
```
- Added in [#10274](https://github.com/emberjs/ember.js/pull/10274)
\ No newline at end of file
+ Added in [#10274](https://github.com/emberjs/ember.js/pull/10274) | true |
Other | emberjs | ember.js | 1d08c84e5d8cada2a324a595e6159e57ddd0a6f1.json | Add feature flag for visit API | features.json | @@ -17,7 +17,8 @@
"ember-htmlbars-each-with-index": true,
"ember-application-instance-initializers": null,
"ember-application-initializer-context": null,
- "ember-router-willtransition": true
+ "ember-router-willtransition": true,
+ "ember-application-visit": null
},
"debugStatements": [
"Ember.warn", | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.