-
Notifications
You must be signed in to change notification settings - Fork 374
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
AOT Compilation with Angular CLI #514
Comments
@timmyrosen Hi!
Thank you very much!
I can confirm, this is a bug indeed. I'll deliver a patch as soon as possible. Thanks for reporting this. |
After some further investigation I was able to locate the origin of this bug. Angular CLI just breaks the This is the original library source code:
That's the output of Angular CLI
I'll file a bug. |
I see, thanks for quick reply! So this is in the hands of the Angular CLI team now? |
@udos86 Are you sure its a CLI-problem? I don't think the replacement with the webpack variable itself does break the instanceof operator, given that E.g. you may want to try the following snippet in Chrome:
I think the problem is that in your code-samples there's the assumption that |
@about-code Hi there, old coding friend! Thanks for your contribution to this issue!
I'm aware that this may seem highly unlikely , but here's a screenshot to beat the odds: As you can see Yet the
Technically speaking, you're right. But due to the function parameter typing this case is actually forbidden:
Given the fact that the code works flawless when leaving of |
In the console output it looks as if What happens if you compare
If the result is Is there another webpack config apart from |
Yep, that's exactly my current assumption according to this console output:
No, Angular CLI is hiding away Webpack entirely from the developer. There's no way of manipulating it's configuration. That's why my hands are pretty much tied here. |
Alright, here is the ultimate evidence, what's going on. This is the app code that creates the
And that's the library code that uses
It's obvious...but what's the reason for this bundling error? |
@udos86 Have seen the thread over at angular-cli. If you want to give ng-packagr a try you might also find a script in my repo helpful. It iterates over your packages folder and builds every package with an You might need to adjust the relative path in the script pointing to '../packages', depending on where you put the script in your repo. If you have any third-party deps you need to add them to the externals section of the respective package's ng-package.json. Then run the script as a node script (requires |
You know, I really like your work and I'm following your progress on your new project, of course. And I also like ng-packagr - it's a really nice tool. But with this project I wanted to succeed on my own. So after spending multiple hours tonight on this I finally got it going. From the next release on NG Dynamic Forms will meet Angular Package Format requirements which ultimately resolves this issue here. Maybe you'd like to have a look at 5e53e64 What's really important is that your This took me quite a while to get my head around. Thanks @timmyrosen for bringing this up and @about-code for your expertise. |
Wow, great work! Will test tomorrow, glad I could help! |
So do I.
I like that attitude. Good to know where I can ask for advice should I have to find out the hard way, that my lazyness hasn't teached me the lessons you've just learned. |
I'm submitting a...
I'm using...
Description
Hi!
Awesome plugin for starters!
I'm experiencing a problem when compiling with aot flag in Angular CLI (v 1.4.1) (compiler-cli v 4.2.4). The problem does not appear when using --aot=false
When trying to add a DynamicInputModel to a DynamicFormGroupModel I get the following error in console:
As I said, it works perfectly locally and when --aot=false so I don't think there is anything wrong with my code.
Thanks!
The text was updated successfully, but these errors were encountered: