Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Investigate AOT strangeness #607

Closed
Blackbaud-PatrickOFriel opened this issue Apr 20, 2017 · 4 comments
Closed

Investigate AOT strangeness #607

Blackbaud-PatrickOFriel opened this issue Apr 20, 2017 · 4 comments
Assignees

Comments

@Blackbaud-PatrickOFriel
Copy link
Contributor

Blackbaud-PatrickOFriel commented Apr 20, 2017

We have run into a couple issues when referencing SKYUX 2 classes from builder using AOT. SKY UX will build fine, but runtime errors occur when referencing non-component code like the SkyMediaBreakpoints enum, the ListDataProvider abstract class, and the ListDataResponseModel class. The commonalities with all of these are that they're 'vanilla' TypeScript, not Angular components or services or anything

@Blackbaud-PatrickOFriel
Copy link
Contributor Author

@Blackbaud-TrevorBurch I think I found the root issue. In our core.ts file we export our files doing something like this:

export * from './modules/list';

Which apparently the AOT compiler does not like. (problem number 6 in here: https://medium.com/@isaacplmann/making-your-angular-2-library-statically-analyzable-for-aot-e1c6f3ebedd5).

When I referenced the items directly it seemed to solve the problem so a workaround can be the following:

import { 
  ListDataProvider
} from '@blackbaud/dist/modules/list/list-data.provider';

instead of importing directly from core. I'll try to have a release out today or tomorrow that gets rid of the export * and exports each important class specifically.

Let me know if any of that was unintelligible!

@Blackbaud-PatrickOFriel
Copy link
Contributor Author

In 2.0.0-beta.21

@Blackbaud-PatrickOFriel
Copy link
Contributor Author

The fix seems to have worked for SkyMediaBreakpoints, but still hasn't fixed the issue for ListItemModel and DataProvider

@Blackbaud-PatrickOFriel
Copy link
Contributor Author

Seems to be working on beta.22

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

No branches or pull requests

1 participant