-
Notifications
You must be signed in to change notification settings - Fork 26
Compiler brakes ngrx effects #29
Comments
Maybe @MikeRyanDev would be interested to add some closure compiler compatibility check? We use it at Google so maybe aokrushko can confirm that this works with closure compiler internally. |
@alexeagle Definitely interested. I know we break it for Closure users semi-regularly but I don't know enough about Closure to add a useful compatibility test suite. cc @robwormald |
There are two things:
- a smoke test that it's possible to use ngrx with closure compiler
- exhaustive testing that no ngrx feature or use case is broken by closure
compiler
I don't know of anywhere that we do the second one today. In theory it's
possible to re-run your whole unit test suite after closure-compiling the
app.
The first one is pretty easy to do, but I doubt it would catch issues like
this.
Should discuss with Rob, maybe we can get enough usage internally at Google
that a pre-commit check against all the tests would be sufficient.
…On Wed, Jan 3, 2018 at 6:23 PM Mike Ryan ***@***.***> wrote:
@alexeagle <https://github.com/alexeagle> Definitely interested. I know
we break it for Closure users semi-regularly but I don't know enough about
Closure to add a useful compatibility test suite.
cc @robwormald <https://github.com/robwormald>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5IxxjzufWL3MrYq7xpCV3VSuewFpGks5tHDY0gaJpZM4QjGu3>
.
|
Hey all, So the closure strips properties from effects, because "they are not used". To force them to be there you can declare the interface. That's the best workaround for the moment. I'm also working to find the combination of closure flags that leaves so the workaround: export declare interface LoadUserEffectsProps {
userAcc$: Observable<Action>;
}
@Injectable()
export class LoadUserEffects implements LoadUserEffectsProps {
constructor(private actions$: Actions, private userService: UserService) {
}
@Effect() userAcc$: Observable<Action> = this.actions$
.ofType(USER_ACTION)
... I was looking into it in December but I was on "vacation" since mid-December and am still on vacation until next week. (vacation with 3 toddlers :) so rarely have time to get to laptop). |
Hello @alexeagle
After I add ngrx store it dosn't work on client side, could you check my repo:
https://github.com/vforv/closure-compiler
To start just type:
it will build server side with webpack and client with closure...
I get this error:
It looks like it brakes EffectsModule... When I remove EffectsModule it works...
The text was updated successfully, but these errors were encountered: