Giter Club home page Giter Club logo

Comments (5)

alexeagle avatar alexeagle commented on May 5, 2024 1

The issue here is inside the UMD bundle you get from firebase. They use an anonymous define() - what this means is that the bundle doesn't know its own name. So the only way to resolve an import statement from angularfire2 in the browser is to fetch it from a URL, because in this case the name of the module is known from the URL (or from a mapping manually given to the module loader)

More broadly, the issue is that the module loading in ts_devserver works for TS code built by bazel, but not for externally built code.

One option is what @thelgevold published on http://www.syntaxsuccess.com/viewarticle/angular-bazel-build-with-dev-server - using SystemJS as the loader for these external bundles, while require.js is the loader for the bazel-built bundles. He could probably help out here since he's a core contributor to ABC.

Another option, well worth considering in this case, is for AngularFire to ship with BUILD files. If you had a source dependency on it, then you'd get the JS transpiled with the ts_library rule, then it's just a bazel-to-bazel dependency and require.js is a sufficient loader. That's how rxjs is handled in this example repo.

It's tracked in bazelbuild/rules_typescript#126

/cc @IgorMinar has been working on improving the integration with firebase, fixing some unrelated runtime issues with zones.

from angular-bazel-example.

pshields avatar pshields commented on May 5, 2024

Thanks Alex. I've logged a feature request with Firebase and will see if I can figure out an alternative way to load the module in the devserver (such as using SystemJS) in the meantime.

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 5, 2024

Link to the firebase issue?

from angular-bazel-example.

pshields avatar pshields commented on May 5, 2024

I originally filed it through https://firebase.google.com/support/, which doesn't appear to be globally linkable. I'll log another one at https://github.com/angular/angularfire2 and link to it shortly.

Edit: angular/angularfire#1431

from angular-bazel-example.

alexeagle avatar alexeagle commented on May 5, 2024

Let's use that firebase issue to track, as well as https://github.com/bazelbuild/rules_typescript/issues/103 for general issues with serving third-party libs.

from angular-bazel-example.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.