Skip to content

Missing metadata.json files for AoT compilation #223

Closed

Description

@dagstuan

Currently the library does not support AoT compilation due to missing metadata.json files that need to be included along with d.ts-files.

See:

https://github.com/orizens/angular2-infinite-scroll/issues/77#issuecomment-245027350
angular/angular#11262 (comment)
angular/angular#11262 (comment)

Activity

  1. e-schultz commented on Sep 12, 2016

    @e-schultz
    Member

    Looking into getting AoT support in soon, and how this works with the @select decorator - have been running into some issues with that, and would like to get that resolved soon as AoT will be important for many projects.

    Thanks for letting us know about the metadata.json / links to other issues - will try and get this resolved soon.

  2. added a commit that references this issue on Sep 21, 2016
  3. duydao commented on Oct 5, 2016

    @duydao

    Thanks for looking into this! In the meantime, is there any workaround for this issue?

  4. h2qutc commented on Oct 6, 2016

    @h2qutc

    Hi, did anyone fix this issue ?

  5. e-schultz commented on Oct 6, 2016

    @e-schultz
    Member

    Been busy traveling for work lately and haven't had as much time to work on this, but have a test module published at 4.0.0-aotbeta.3 - still not fully working.

    One error once I've gotten past the NgModule error, is how it behaves when you pass functions into selectors.

    export const stuffSelect = n=>n.tuff;
    export class Stuff {
      @select(n=>n.stuff) thisWillCauseAnError$
      @select(stuffSelect) thisWilNotCauseAnError$
    }
    

    If anyone has a demo repo with an AoT app working that they could point me at to help play around with as a test bed, that would be great.

  6. e-schultz commented on Oct 6, 2016

    @e-schultz
    Member

    Some update/progress:

    Working on a repo with master of angular-cli.

    e-schultz/ng2-redux-aot-example#1

    Have it so things don't throw errors, however the @select decorator just fails to work, will investigate further.

  7. hasangilak commented on Oct 8, 2016

    @hasangilak

    i had this problem with ngc over NgRedux error which could be handle like this
    you can safely add ReduxWrapper as a provider to NgModule now

     import {Injectable} from "@angular/core";
     import {NgRedux} from "ng2-redux/lib/index";
     import {IAppState} from "./../store/store";
    
     @Injectable()
     export class ReduxWrapper {
          private redux: NgRedux<IAppState>;
    
          constructor() {
            this.redux = new NgRedux<IAppState>();
          }
     }
    
  8. hasangilak commented on Oct 8, 2016

    @hasangilak

    also there must be another work around for combineReducers function . this style ditch the error of re-exporting Reducer over ngc compilation
    <Reducer<IAppState>>combineReducers<IAppState>

  9. hasangilak commented on Oct 13, 2016

    @hasangilak

    also there is a problem with redux library which throws an error on NODE_ENV === "productions". no way to handle this ...

  10. SethDavenport commented on Oct 21, 2016

    @SethDavenport
    Member

    @hasangilak regarding the NODE_ENV === "production" error - are you using angular-cli or webpack by any chance?

  11. SethDavenport commented on Oct 21, 2016

    @SethDavenport
    Member

    If you're using angular-cli I believe they've fixed this in beta-18. If you're using webpack, you'll need to use webpack.DefinePlugin to provide a value for process.env in the browser environment:

    new webpack.DefinePlugin({
      'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
    })
  12. SethDavenport commented on Oct 21, 2016

    @SethDavenport
    Member

    @dagstuan have you tried the latest ng2-redux 4.0.0 beta 7? I believe it resolves a number of AoT issues.

  13. SethDavenport commented on Oct 26, 2016

    @SethDavenport
    Member

    Closing for now. If you're still having AoT issues, be sure to reference #234 for the latest discussion.

  14. dagstuan commented on Oct 27, 2016

    @dagstuan
    Author

    Hey, sorry about the late reply. I havent had issues with it lately as I've been waiting a while to try and implement it again :) But it looks like you guys have it under control. Thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions