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

List options are broken when bundled with tree-shaking #729

Closed
TrevorKarjanis opened this issue Sep 10, 2022 · 0 comments · Fixed by #730
Closed

List options are broken when bundled with tree-shaking #729

TrevorKarjanis opened this issue Sep 10, 2022 · 0 comments · Fixed by #730
Labels
bug Something isn't working triage New issue that needs to be reviewed

Comments

@TrevorKarjanis
Copy link
Contributor

TrevorKarjanis commented Sep 10, 2022

🐛 Bug Report

Nimble combo box and select components break when list options are tree-shaken. The nimble-list-option.module.ts does not import the list-option side-effects. Bundler optimizations will reduce named imports to direct deep imports, and remove any other code in a module.

💻 Repro or Code Sample

  1. Clone branch issue-729.
  2. Run npm run build.
  3. Run npm run -w angular-workspace start.

🤔 Expected Behavior

The list option module should import side-effects with bundler optimization, so that associated components function properly.

😯 Current Behavior

With bundle optimization, combo box and select component options are not populated. They are present in the drop down, but no style nor selectable.

Screenshot (3)

💁 Possible Solution

Fixed in #730. Consistent with the other modules, import list options with side-effects.

// nimble-list-option.module.ts
import '@ni/nimble-components/dist/esm/list-option';

🔦 Context

Angular 14 includes improved bundle optimization.

🌍 Your Environment

  • OS & Device: macOS
  • Browser Google Chrome
  • Version: nimble-angular@8.4.7
  • Frameworks: Angular v14
@TrevorKarjanis TrevorKarjanis added bug Something isn't working triage New issue that needs to be reviewed labels Sep 10, 2022
rajsite pushed a commit that referenced this issue Sep 10, 2022
# Pull Request

## 🤨 Rationale

Fixes #729. Nimble combo box and select components break when list
options are tree-shaken. The nimble-list-option.module.ts does not
import the list-option side-effects. Bundler optimizations will reduce
named imports to direct deep imports, and remove any other code in a
module.

## 👩‍💻 Implementation

Import list options with side-effects.

## 🧪 Testing

- Manually verified that combo box and select components work with
Angular 14
- Verified that the linter check passes
- Verified that automated tests pass

## ✅ Checklist

- [ ] I have updated the project documentation to reflect my changes or
determined no changes are needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New issue that needs to be reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant