Skip to content
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

Exports for Ionic2 rc1 support #20

Merged
merged 1 commit into from
Oct 23, 2016
Merged

Conversation

SebastianGiro
Copy link
Contributor

Hi,

For this package to work on Ionc2 rc0+ without the need to add it on rollup.config.ts we need to avoid using export * from.
Instead we need to manually re-export each one on the index.ts.

I've tested it and with this fix it works like a charm :)

@ihadeed
Copy link
Member

ihadeed commented Oct 19, 2016

Thanks for the PR @SebastianGiro :)

Ionic Native uses export * from '..';, see https://github.com/driftyco/ionic-native/blob/master/src/index.ts#L115-L223

Are you having issues with that as well?

@SebastianGiro
Copy link
Contributor Author

@ihadeed Hey.

Yes they are using export * because (I presume) they are importing each module before doing the export.

This works in their project but not in ng2-facebook-sdk

import { ActionSheet } from './plugins/actionsheet';
export * from './plugins/actionsheet';

If we do only the export * from './ng2-facebook-sdk';
We are going to get this error for every export missing in the index:

[11:26:51]  bundle failed: 'FacebookService' is not exported by node_modules/ng2-facebook-sdk/dist/index.js 
            (imported by src/pages/+auth/auth-login/auth-login.component.ts). For help fixing this error 
            see https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module 

How we solve this error?:

  1. exporting the custom imports like I did in the commit.
  2. OR using the rollup.js
  3. OR a variant from the first option, encapsulating all the ng2-facebook-sdk.ts using namespaces
    export namespace FacebookSdk { } <--- Include all the exports here.
    And in index.ts doing something like this: export { FacebookSdk } from './ng2-facebook-sdk';

@ihadeed ihadeed merged commit 2faaaec into zyra:master Oct 23, 2016
@ihadeed
Copy link
Member

ihadeed commented Oct 23, 2016

Thanks, this plus the commit I pushed for the AoT fixed it. Publishing 0.4.0 now.

@SebastianGiro
Copy link
Contributor Author

Nice!. All working fine in 0.4.0.

@ihadeed
Copy link
Member

ihadeed commented Oct 25, 2016

Thanks for your help!

On Oct 24, 2016 10:42 AM, "Sebastian Giro" [email protected] wrote:

Nice!. All working fine in 0.4.0.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#20 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ANJ8dKGkvverHBKmtiV_9cD5_bc2zNUHks5q3MPygaJpZM4KaLYr
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants