-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible breaking changes with Beta.11 and injectAsync? #126
Comments
I recall seeing this before in my own project, which has been linking with beta-11 before it was officially named so (i.e. it's been linking with the current ionic2 master for a while and this change happened a while ago). The fix is easy. There is no more injectAsync(), but inject() is there and async() is there and the way to get the old behavior is to import those two functions instead of the function injectAsync()
and then call
instead of injectAsync(...) I'm away this weekend and cannot create a pull request for this until Monday, but can do so then if nobody beats me to it. ---- On Fri, 05 Aug 2016 16:26:23 -0400 chrono notifications@github.com wrote ----
|
@dorontal: Yes, awesome, that fixes the bundle error. I've pasted the specific changes to test/diExports.ts for reference, so that you you or @lathonez can pick it up directly.
However, I guess now I'm just stuck with an issue similar to #125, where the only major difference introduced here was the move from karma 0.13.22 to 1.1.0
|
I could solve this issue, by bootstrapping a fresh sidemenu ionic project and compared changes. Most notably were some changes in ionic's gulpfile and package.json: diff --git a/governess-app/gulpfile.js b/governess-app/gulpfile.js
index 36a03bb..5f8a1da 100644
--- a/governess-app/gulpfile.js
+++ b/governess-app/gulpfile.js
@@ -32,6 +32,7 @@ var buildSass = require('ionic-gulp-sass-build');
var copyHTML = require('ionic-gulp-html-copy');
var copyFonts = require('ionic-gulp-fonts-copy');
var copyScripts = require('ionic-gulp-scripts-copy');
+var tslint = require('ionic-gulp-tslint');
var isRelease = argv.indexOf('--release') > -1;
@@ -41,12 +42,7 @@ gulp.task('watch', ['clean'], function(done){
function(){
gulpWatch('app/**/*.scss', function(){ gulp.start('sass'); });
gulpWatch('app/**/*.html', function(){ gulp.start('html'); });
- buildBrowserify(
- {
- src: ['./app/app.ts', './typings/index.d.ts'],
- watch: true
- }
- ).on('end', done);
+ buildBrowserify({ watch: true }).on('end', done);
}
);
});
@@ -76,3 +72,4 @@ gulp.task('scripts', copyScripts);
gulp.task('clean', function(){
return del('www/build');
});
+gulp.task('lint', tslint);
diff --git a/governess-app/package.json b/governess-app/package.json
index 18023fe..a58d20e 100644
--- a/governess-app/package.json
+++ b/governess-app/package.json
@@ -56,6 +56,7 @@
"ionic-gulp-html-copy": "1.0.0",
"ionic-gulp-sass-build": "1.0.0",
"ionic-gulp-scripts-copy": "2.0.1",
+ "ionic-gulp-tslint": "^1.0.0",
"isparta": "4.0.0",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
@@ -73,6 +74,7 @@
"tsify": "0.16.0",
"tslint": "3.12.1",
"tslint-eslint-rules": "1.3.0",
+ "tslint-ionic-rules": "^0.0.3",
"typings": "1.3.1"
},
"cordovaPlugins": [ Maybe it will solve #125 too. |
Upgraded and encountered the same error as you guys:
|
Did you already make the changes noted above? --- ../../clicker/test/diExports.ts 2016-06-29 18:15:12.308410517 +0000
+++ tests/diExports.ts 2016-08-06 07:47:24.941769412 +0000
-import { injectAsync } from '@angular/core/testing';
+import { inject, async } from '@angular/core/testing';
-export let injectAsyncWrapper: Function = ((callback) => injectAsync([TestComponentBuilder], callback));
+export let injectAsyncWrapper: Function = ((callback) => async(inject([TestComponentBuilder], callback))); IIRC I had to delete & rebuild my whole node_modules as well... |
Yeah that's all good it's the RC4 form changes I'm struggling with atm. |
No help there but a good reference point. Been digging for hours. Comparing differences between using TemplateParseVisitor.prototype._createElementPropertyAsts = function (elementName, props, directives) {
var _this = this;
var boundElementProps = [];
var boundDirectivePropsIndex = new Map();
directives.forEach(function (directive) {
directive.inputs.forEach(function (prop) {
boundDirectivePropsIndex.set(prop.templateName, prop);
});
});
props.forEach(function (prop) {
if (!prop.isLiteral && lang_1.isBlank(boundDirectivePropsIndex.get(prop.name))) {
boundElementProps.push(_this._createElementPropertyAst(elementName, prop.name, prop.expression, prop.sourceSpan));
}
});
return boundElementProps;
}; The line that's blowing up is the The reason it returns TL;dr - we're passing an TODO: 1 - what are we passing for |
The above issue
Is solved by adding |
Now banging my head against:
For which this looks relevant: |
Nope, already got those fixes. The basic point for all of these is that bootstrapping the app as follows: ionicBootstrap(ClickerApp, [
disableDeprecatedForms(),
provideForms(),
Clickers,
provide('Storage', {useClass: Storage})]
); Sorts out the forms and little else (if anything?) is needed for the app to work using The problem we've got is getting the same bootstrapping through testing, which is why we're needing to jump through these hoops. |
Setting identical providers in diExports sorted it (as above basically). Pushed the commit upgrading to beta.11, RC4 and new forms. |
Awesome, thanks. |
I've bumped my project (with tests based on clicker) to Ionic@Beta.11 - failing here:
Current angular2 docs say that there are no new docs yet but there seem to have been changes.
The text was updated successfully, but these errors were encountered: