Comments (3)
Right now in my project i find some workaround with help of gulp.
After typescript compiling but before minification, i parse with regexp current stream content (gulp-data plugin), find any functions arguments matched to pattern like: ISettings, IParams, IInterfaceA
. And then push them into array and put that array as except
parameter for uglify2 plugin.
let reservedVariables = [];
.pipe(ts({
out: 'output.js',
typescript: require('typescript')
}))
.pipe(data(function(file) {
let results,
result,
res;
results = String(file.contents).match(/function[^(]*\(([^)]*)\)/g);
for (result in results) {
res = results[result].match(/function[^(]*\(([^)]*)\)/)[1].split(',');
res.forEach((value) => {
if (value === '') {
return false;
}
if (/I[A-Z]\w*/.test(value)) {
reservedVariables.push(value);
}
});
}
reservedVariables = reservedVariables.filter(function (value, index, self) {
return self.indexOf(value) === index;
});
return reservedVariables;
}))
.pipe(uglify({
mangle: {
except: reservedVariables
}
}))
from inversifyjs.
@sanex3339 thanks for sharing that!
from inversifyjs.
You can now use:
@inject("IFoo","IBar")
class FooBar implements IFooBar {
public foo : IFoo;
public bar : IBar;
public log() {
console.log("foobar");
}
constructor(foo : IFoo, bar : IBar) {
this.foo = foo;
this.bar = bar;
}
}
For more details check out #33
from inversifyjs.
Related Issues (20)
- @inject not working HOT 4
- Strange behavior of hierarchical DI HOT 1
- Rebind is broke when upgraded from v5 to v6 HOT 3
- Circular Path detection falsely blames multi-inject HOT 1
- regression: v6 no longer handles singletons with value `undefined` HOT 4
- regression: inversify 6 no longer allows binding null values HOT 3
- Support @singleton annotation HOT 2
- Inversify-generator: generator package for bindings and type identifiers
- Container takes a long time to instantiate HOT 1
- Tests for #549 are flaky (node 10 / es6) HOT 2
- TypeError: Converting circular structure to JSON HOT 1
- Remove `browser` test suite HOT 5
- container.onNoMatchingBindingsFount or .onError
- The error middleware throws unhandler error for first container config and last router
- How to inject method parameter HOT 1
- Last release was on Oct 14, 2021 HOT 8
- postConstruct inconsistency for sync and async
- Whether the inclusion size can be optimized
- Major bug, request scope in a singleton class is not working HOT 1
- Migrate to Monorepo HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inversifyjs.