-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add public.api.ts #374
Comments
Hi @andrei4ik1997! Thank you for creating the issue! We will investigate the possibilities here and will keep you posted. |
Hi @karolkolodziej ! |
Hi @karolkolodziej, do you have any updates? |
HI @andrei4ik1997! Not much has changed. Due to time constraints, we were unable to fully investigate it. If you would like to suggest a solution, please feel free to do so. Your input is valuable to us in resolving this issue efficiently. Thank you for your patience and understanding. |
@karolkolodziej maybe something has changed on this issue? |
I don't have any updates at the moment. If I come up with a solution or have more information, I'll share it here. Thank you for your understanding. |
Please add public.api.ts file to the root of the library in which all functions will be exported. This is needed for the new ESBuild builder on Angular.
Builder does not accept paths with slashes(for example highcharts/highmaps)
After investgate and many attempts, I came to the conclusion that the Angular Esbuilder swears at import via / .
import Highcharts from 'highcharts'; It runs fine because the root folder contains a file with the same name as the library (highcharts.ts) and we don’t have to use the highcharts/highcharts import.
But as soon as I start using import Highcharts from 'highcharts/highcharts' (although this is the same as import Highcharts from 'highcharts') the builder starts not understanding this import path and throws an error
Therefore, I ask you to add the file to the root of the library public-api.ts or index.ts which exports all modules and charts from itself. So that we could use an import like import Highstock from 'highcharts;
I also managed to find a solution from @omishyn ( https://github.com/omishyn/om-angular-highcharts/tree/main ). He copies modules to the external layer using nf-copy.js . But I think this is a dirty solution. Maybe there is a better solution?
Maybe create index.ts/public.api.ts files will solve the problem?
P.s. Using the official wrapper (https://www.npmjs.com/package/highcharts-angular) doesn't solve the problem
index.ts examle
export * from './highcharts' export * from './highcharts-3d' export * from './highcharts-gantt' export * from './highcharts-more' export * from './highmaps' export * from './highstock' export * from './modules'
I am using native federation in my application.
https://www.npmjs.com/package/@angular-architects/native-federation
we also use polyfil es-module-shims. https://www.npmjs.com/package/es-module-shims
https://stackblitz.com/edit/stackblitz-starters-aptkaf?file=README.md
an example of the highcharts problem is located in the projects/mfe1/src/app/app.component.ts (app.component.) folder
you can also see the project here:
https://github.com/kirill-borisyonok/highcharts-issue
The text was updated successfully, but these errors were encountered: