-
Notifications
You must be signed in to change notification settings - Fork 82
Unable to import library from node_modules #159
Comments
This will get easier when we switch over to the Ivy compiler, which no longer uses summary and factory files. In the meantime our plan is to make this more similar to what we do internally at Google, to reduce the combinations of things that need to work together. Internally we build Angular from source in Bazel rather than depend on a binary distribution. @gregmagolan has a couple of PRs out to make Material work against Angular built from source, then we'll recommend that user apps do this as well. Note that more generally, in the NPM ecosystem there are a bunch of issues with projects shipping their compiled artifacts (eg. different users want different down-leveled language targets). If all TS projects had BUILD files, you could imagine a world where it's more typical to build your dependencies from source. |
@alexeagle is @gregmagolan pull requests something we can play with right now while waiting on the Ivy compiler integration? |
It would be challenging to patch together Greg's work, I'd advise to wait another week or two for that to land. |
Are there plans or work going on to bring that experience to other @angular/* projects, as I've run into similar issues with flex-layout. |
Hi @alexeagle hope the integration work is progressing well? |
Material + Angular + Bazel has been our dream for a while. Excited to know you guys (from Google) are working on it. No rush, but what progress/track can we expect of this cause. Asking because we need to plan our company policy accordingly with it - we use Angular + Bazel @alexeagle |
This repo now demonstrates building Angular from sources. I think the next step to close this issue is we should also use material components in this example. |
I gave this a quick shot, but there must be more to it Added a reference to the material2 repo
added button lib to the dependency list
But get issues compiling
|
Yeah I'm not surprised it has errors, fixing those is the remaining work for this issue |
@alexeagle If there are parts the community can do, I'd be happy to contribute. |
Out of interest I did some more poking around, see if I could get something to build. So far I've managed to get it to compile, by referencing a local material2 repo, building parts with angular from source, can successfully run However, when I then reference this in this example project, although it compiles, there are anonymous defines in the example:
Hit a bit of a brick wall working out why these would be different. |
I managed to spend a little time on this the other day and have the example app in this repo using a |
@mattem that's awesome, I was working on that yesterday but didn't get it working. Do you have a PR on angular/material2 showing what you had to change? |
@alexeagle I've opened two PRs angular/components#13109 and #201 It's by no means complete, I was starting to look at loading of the theme CSS. I also wasn't really able to get to the bottom of the issue I posted above, however the issue seems to be that the typescript rules in |
@gregmagolan @alexeagle Awesome to see Angular Material now working with Bazel. What's the roadmap for other Angular projects, specifically Flex Layout. Once that's available we can start moving our build process for our larger applications over to Bazel 😄 As always, happy to contribute when I have time. |
We just decided a couple days ago to prioritize getting the angular compiler fixes needed so that we can have normal dependencies on distributions rather than build deps from source. |
One of our apps uses
@angular/material
, but due to angular/components#9502 we can't currently build this with Bazel. A newer app is attempting to use VMware's Clarity.I get different errors when trying to reproduce this, it seems that the
ng_module
rule doesn't includengfactory.js
files as action inputs.Changing
ng_module.bzl
to include them allows the app to build, but causes the devserver to not be able to find the file, as I guess there is now a requirement for it to be served.What is the right way to import libraries using the ng_module rules? The example repo shows the use of ngrx, but this doesn't have references to the ngfactory as part of the ngsummary.
Not sure if I should be opening issue against this repo or the angular one, happy to make an issue over there if needed.
The text was updated successfully, but these errors were encountered: