感谢@McMath 的优秀答案,我现在有webpack编译我的客户端和我的服务器.我现在正努力webpack --watch做到有用.理想情况下,当我的客户端发生变化时,我想让它为我的服务器进程生成类似nodemon的东西,以及当我的客户端发生变化时的某些类型的browserync.
我意识到它是一个捆绑器/加载器,而不是真正的任务运行器,但有没有办法实现这一目标?缺乏谷歌搜索结果似乎表明我正在尝试新的东西,但这一定已经完成了..
我总是可以将webpack包放到另一个目录并使用gulp来观察/复制它/ browsersync-ify它,但这看起来像是一个黑客..有更好的方法吗?
我正在对使用EF(System.Data.Entities)从sql DB读取的WCF服务进行一些分析.当我启动多个并行服务器的客户端时,CPU都会达到100%,性能通常是坦克,一切都陷入困境.
在使用并发分析器进行分析时,我发现85%的时间花在同步上,只有大约4%是实际的代码执行.深入研究堆栈跟踪,大多数同步似乎来自System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync中对WaitForSingleObject的调用.堆栈显示调用转到本机方法包装器,然后在kernel32.dll!_WaitForSingleObject结束.
有谁之前经历过这个吗?对此有什么办法吗?我并没有真正抛出荒谬的负载,只有大约20个并行客户端,并且它都是只读的,所以我很惊讶线程甚至会费心去同步.
我已经和它斗争了一个星期了,我无法解释它.任何帮助,将不胜感激!
我在TS再出口方面有点迷失.假设我创建了一对测试模块;
test1.ts;
export function test1() {
return 'test';
}
Run Code Online (Sandbox Code Playgroud)
test2.ts;
export function test2() {
return 'test';
}
Run Code Online (Sandbox Code Playgroud)
我相信我应该能够做到这样的事情;
combined.ts;
export * from './test1';
export * from './test2';
module.exports = {
test1: test1,
test2: test2
};
Run Code Online (Sandbox Code Playgroud)
但是,没有这样的运气.似乎有很多GitHub问题讨论了各种方法,包括旧的hack使用,export import * from './test1'但他们似乎都在争论ES6规范的真正意义,并且没有一个真正起作用.
这样做汇总的正确方法是什么?我是否只是走错路径将文件拆分成文件?名称空间在这里更合适吗?
有没有人对Rational Software Architect vs Sparx EA有任何想法?我还应该关注其他工具吗?具体来说,我对以下内容感兴趣;
似乎理性和EA都会做大部分,理性显然会导致RUP.似乎没有做硬件映射/成本计算,虽然sybase powerbuilder确实如此 - 不确定我是否遗漏了一些东西?
关于如何正确评估/选择一个的建议?还有什么我应该看的吗?
我正在尝试为具有节点后端服务器的Angular2应用程序设置基于webpack的流程.经过几个小时敲打它,我已经设法让客户愉快地建立,但我无法弄清楚如何现在整合我的服务器构建.我的服务器使用生成器,因此必须以ES6为目标,并且需要指向不同的打字文件(main.d.ts而不是browser.d.ts).
我的源代码树看起来像;
/
-- client/
-- -- <all my angular2 bits> (*.ts)
-- server/
-- -- <all my node/express bits> (*.ts)
-- webpack.config.js
-- typings/
-- -- browser.d.ts
-- -- main.d.ts
Run Code Online (Sandbox Code Playgroud)
我想也许只是客户端和服务器文件夹中的tsconfig.json可以工作,但没有运气.我也找不到让html-webpack-plugin忽略我的服务器包而不将其注入index.html的方法.我当前的tsconfig和webpack在下面,但有没有人成功地让webpack捆绑这样的设置?任何指针都将非常感激.
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"declaration": false,
"removeComments": true,
"noEmitHelpers": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true
},
"files": [
"typings/browser.d.ts",
"client/app.ts",
"client/bootstrap.ts",
"client/polyfills.ts"
]
}
Run Code Online (Sandbox Code Playgroud)
和我的webpack.config.js;
var Webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var Path = require('path');
module.exports = {
entry: { …Run Code Online (Sandbox Code Playgroud) 几天来我一直在反对这个问题,而且无法到达任何地方......我正在尝试使用Mocha来测试我的Angular 2应用程序(基于SystemJS,如果它很重要),我就可以'弄清楚如何获取控制器的实例.
我正在尝试我能提出的最简单的案例;
import {bootstrap} from 'angular2/platform/browser';
import {App} from '../app/app';
import {Type} from 'angular2/core';
describe('Login', () => {
let app:App;
beforeEach((done) => {
console.log(bootstrap);
bootstrap(<Type>App)
.then(result => result.instance)
.then(instance => {
app = instance;
done();
});
});
it('Test for App to Exist', (done) => {
console.log(app);
done();
});
});
Run Code Online (Sandbox Code Playgroud)
我可以告诉他,console.log(bootstrap)失败的方式,因为我的gulp-mocha任务刚刚死亡(默默地).注释掉bootstrap引用只是做一个虚拟测试;
import {bootstrap} from 'angular2/platform/browser';
import {App} from '../app/app';
import {Type} from 'angular2/core';
describe('Login', () => {
let app:App;
beforeEach((done) => {
done();
});
it('Test for App to …Run Code Online (Sandbox Code Playgroud) 是否可以采用整个stage('foo') {...}定义并将其提取到Jenkins中的共享库中?文档非常清楚如何拉出单个步骤,但是我找不到任何方法可以进行整个阶段,对其进行参数化并在全球范围内重复使用。我以为也许return stage...会行得通,但它会作为无效的返回值而出错。
也打开了这个作为一个问题,但希望有人看到这个..
我有一个非常简单的集线器,它实现了IConnected/IDisconnect.在一个独立的项目中,这个中心测试得很好.
当我把它放到我的实际项目中时,我已经有了一些其他集线器,添加它导致没有可用的集线器(确认没有出现在/ signalr/hubs中).然后我在这个集线器中注释掉IConnected/IDisconnect并重新编译,然后它与其余部分一起显示出来.添加接口打破了这一切.
谁看过这个吗?是否有一些配置丢失或什么?
public class ChatHub : Hub, IConnected, IDisconnect
{
public void Test(string message)
{
}
public System.Threading.Tasks.Task Connect(IEnumerable<string> groups)
{
this.Clients.onNewUserOnline(Context.ConnectionId);
return new Task(() => { });
}
public Task Reconnect(IEnumerable<string> groups)
{
this.Clients.onNewUserOnline(Context.ConnectionId);
return new Task(() => { });
}
public Task Disconnect()
{
this.Clients.onUserOffline(Context.ConnectionId);
return new Task(() => { });
}
}
Run Code Online (Sandbox Code Playgroud) 我正在阅读Moxy ignore invalid fields in json的答案,并且该方法与我正在尝试做的事情相匹配,所以我决定试一试..我创建了一个功能来禁用默认的 ConfigurableMoxyJsonProvider;
@Provider
public class JsonFeature implements Feature {
@Override
public boolean configure(final FeatureContext context) {
final String disableMoxy = CommonProperties.MOXY_JSON_FEATURE_DISABLE +
'.' +
context.getConfiguration().getRuntimeType().name().toLowerCase();
context.property(disableMoxy, true);
return true;
}
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个非常简单的自定义提供程序;
@Provider
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class JsonProvider extends MOXyJsonProvider {
@Override
protected void preWriteTo(Object object, Class<?> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, Object> httpHeaders, Marshaller marshaller)
throws JAXBException {
System.out.println("test");
}
@Override
protected void preReadFrom(Class<Object> type, Type genericType, Annotation[] annotations, …Run Code Online (Sandbox Code Playgroud) IntelliJ中的Angular2(v15的最新更新 - 终极版)应该有效吗?所有的文档似乎都说它是通过AngularJS插件完成的,但我得到的是奇怪的智能感知错误.例如;
bootstrap(App, [
ROUTER_PROVIDERS,
provide(LocationStrategy, {useClass: HashLocationStrategy})
]);
Run Code Online (Sandbox Code Playgroud)
抛出 Argument type App is not assignable to parameter type Type
和标准注释一样;
@RouteConfig([
{path: '/...', component: RootView, as: 'RootView', useAsDefault: true}
])
Run Code Online (Sandbox Code Playgroud)
扔 Argument type {path: string, component: RootView, as: string, useAsDefault: boolean}[] is not assignable to parameter type RouteDefinition[]
以前有人碰过这个吗?有谁知道如何让smartJ玩得好听?
按要求提供应用程序来源;
import {Component, ViewEncapsulation} from 'angular2/core';
import {RootView} from './root-view';
import {
RouteConfig,
ROUTER_DIRECTIVES
} from 'angular2/router';
@Component({
selector: 'app',
templateUrl: './components/app/app.html',
encapsulation: ViewEncapsulation.None,
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{path: …Run Code Online (Sandbox Code Playgroud) intellij-idea angularjs typescript typescript1.7 intellij-15
typescript ×3
node.js ×2
webpack ×2
.net ×1
angular ×1
angularjs ×1
browser-sync ×1
c# ×1
ecmascript-6 ×1
groovy ×1
intellij-15 ×1
java ×1
jenkins ×1
jersey ×1
jersey-2.0 ×1
json ×1
mda ×1
mocha.js ×1
moxy ×1
nodemon ×1
signalr ×1
systemjs ×1
tsc ×1
uml ×1
unit-testing ×1