Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Addresses feedback from #16561 to cache the dynamically imported fflate module at the class level.

Changes:

  • Add static fflateModulePromise property to cache the import promise
  • Add getFflateModule() method that returns cached promise or creates new import
  • Promise caching pattern ensures thread-safety for concurrent export operations
private static fflateModulePromise: Promise<typeof import('fflate')> | null = null;

private static getFflateModule(): Promise<typeof import('fflate')> {
    if (!IgxExcelExporterService.fflateModulePromise) {
        IgxExcelExporterService.fflateModulePromise = import('fflate');
    }
    return IgxExcelExporterService.fflateModulePromise;
}

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…imports

Co-authored-by: kdinev <1472513+kdinev@users.noreply.github.com>
Copilot AI changed the title [WIP] Update dynamic import for excel exporter feature Cache fflate dynamic import to avoid redundant imports on subsequent exports Dec 2, 2025
Copilot finished work on behalf of kdinev December 2, 2025 09:38
Copilot AI requested a review from kdinev December 2, 2025 09:38
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