Giter Site home page Giter Site logo

Comments (6)

danbucholtz avatar danbucholtz commented on July 26, 2024

@metzc,

What does your import statement look like? Do you have types for the library?

What does the error message look like?

Thanks,
Dan

from ionic-app-scripts.

chriswep avatar chriswep commented on July 26, 2024

@danbucholtz this happens on a clean new ionic project with just the official apollo initialization code added: http://dev.apollodata.com/angular2/initialization.html

Types are included in the library (there is no compilation error), error message in browser as quoted in my initial bug report.

I think you can easily reproduce it.

Of course this is a rollup issue. The problem: there is a lot of stuff which doesn't work with rollup so maybe there is a more general question here. Suggestion: have a fallback mechanism which can be activated for certain libraries to work around rollup limitations. Please also note discussions on the related apollo-client (and referenced rollup-commonjs) issues.

from ionic-app-scripts.

danbucholtz avatar danbucholtz commented on July 26, 2024

All,

We've posted some docs on the subject. Note: They match a version of @ionic/app-scripts that will be dropped in the next day or so. 95% of the concepts still apply.

http://ionicframework.com/docs/v2/resources/third-party-libs/
http://ionicframework.com/docs/v2/resources/app-scripts/

Here's an example with AngularFire2.
Here is a project I implemented that has every library in it that Ionic users have reported trouble with. Most of the libraries worked, but a couple did not. Here is the summary of the findings.

Please let me know how everything goes. Since we posted documentation, we are going to close this issue.

I posted these issues in the apollo-client repo to get it to work with Ionic and Angular.
apollographql/apollo-client#746
apollographql/apollo-client#745

Thanks,
Dan

from ionic-app-scripts.

chriswep avatar chriswep commented on July 26, 2024

Thanks for the detailed work on this!

Just wanted to point out that there is still no way (even via script-tag due to lack of a build) to make apollo-client work with ionic rc0, contrary to what you state in the spreadsheet. (apparently you also commented it out in your example project)

from ionic-app-scripts.

danbucholtz avatar danbucholtz commented on July 26, 2024

@metzc,

Were you able to get the library built? If I could get it to compile, I can probably get it to work with Rollup. What is the error message that you're getting?

Thanks,
Dan

from ionic-app-scripts.

chriswep avatar chriswep commented on July 26, 2024

if you clone the apollo-client repo you can "npm run compile:browser" and it generates a build in the "dist" dir. i managed to adapt the deploy script so that it generates a valid npm package for this build file (which worked). using that i could fix another bug via the namedExports in rollup.config.js. apollo-client seems to work then. Problem is: apollo-client-rxjs generates the next problem (again circular dep as it seems):
RxApolloClient.js:5: Uncaught TypeError: Cannot read property 'prototype' of undefined

This library doesn't include a build script so i stopped following that path. What i did now is to fetch the sources of apollo-client, apollo-client-rxjs and angular2-apollo and fixed the circular deps and some version inconsistencies and used those custom versions in npm which for now works. is more a hack though. apollo-client is being refactored so i switch back to official once they are done.

from ionic-app-scripts.

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.