Skip to content

Add default exports to avoid build warnings #2944

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

Closed
wants to merge 3 commits into from

Conversation

alex-ju
Copy link
Member

@alex-ju alex-ju commented Jun 11, 2025

📌 Summary

Add export default to avoid build warnings and allow tidy imports.

🔗 External links

Jira ticket: HDS-4637 and HDS-3342


💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@alex-ju alex-ju requested a review from a team as a code owner June 11, 2025 11:35
Copy link

vercel bot commented Jun 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Jun 12, 2025 4:16pm
hds-website ✅ Ready (Inspect) Visit Preview Jun 12, 2025 4:16pm

@aklkv
Copy link
Collaborator

aklkv commented Jun 12, 2025

is that really an issue? since we are ignoring this type of files, only warning we see in on the consumer side are:

Screenshot 2025-06-12 at 9 30 24 AM

@alex-ju
Copy link
Member Author

alex-ju commented Jun 12, 2025

is that really an issue? since we are ignoring this type of files, only warning we see in on the consumer side are:

not sure I follow @aklkv. could you please expand on your feedback here?

@RobbieTheWagner
Copy link
Member

I'm curious what the underlying problem was here? To my knowledge, you are not required to have a default export in every file.

@alex-ju
Copy link
Member Author

alex-ju commented Jun 13, 2025

I'm curious what the underlying problem was here? To my knowledge, you are not required to have a default export in every file.

The build process is looking for default exports from several modules, and those modules were exporting named constants and functions instead. HCP raised a few times now that this adds unnecessary noise to their build logs so we're trying to act on feedback.

@aklkv
Copy link
Collaborator

aklkv commented Jun 13, 2025

@alex-ju totally correct, all ember specific folders like:

/components
/helpers
/services
/modifiers

only one real (meaning non type) default export, otherwise emberoider/webpack (this "issue" more like noise is only specific to webpack variant of embroider because how it build export map).

my feedback here we should fix it it's easy, otherwise I would prefere to direct our attention to single file components migration as it's much more important and becoming blocking addictianally it would not be even a problem with vit which is going to be predominant favour of build tooling for all projects that are going to migrate.

@alex-ju alex-ju requested review from shleewhite and aklkv June 19, 2025 10:46
@aklkv
Copy link
Collaborator

aklkv commented Jun 23, 2025

I finally got time to look into this:

  • there why to many default export if you look at my screenshots the only offending files are mostly modifiers to fix /types.ts files in modifiers folder modify this part in rollup.config.mjs by adding modifiers/**/!(*types).js', and maybe helpers as well for future.
  addon.appReexports([
    'components/**/!(*types).js',
    'helpers/**/*.js',
    'modifiers/**/*.js',
    'services/**/!(*types).js',
    'instance-initializers/**/*.js',
  ]),
  • after above is fixed we would be left with following files that need default exports:

modifiers/hds-advanced-table-cell/dom-management
modifiers/hds-advanced-table-cell/keyboard-navigation
modifiers/hds-code-editor/languages/rego
modifiers/hds-code-editor/languages/sentinel
modifiers/hds-code-editor/palettes/hds-dark-palette

this would slim down your PR substantially, to see the result what we see when using hds in embroider context check our Run Tests for embroider-safe scenario, there would be one issues left which is fine

@alex-ju
Copy link
Member Author

alex-ju commented Jul 2, 2025

  • there why to many default export if you look at my screenshots the only offending files are mostly modifiers to fix /types.ts files in modifiers folder modify this part in rollup.config.mjs by adding modifiers/**/!(*types).js', and maybe helpers as well for future.
  addon.appReexports([
    'components/**/!(*types).js',
    'helpers/**/*.js',
    'modifiers/**/*.js',
    'services/**/!(*types).js',
    'instance-initializers/**/*.js',
  ]),

I don't mind adding this exception, but there is only one types.js file in modifiers, so updating the rollup config has very minimal impact (one warning out of dozens)

  • after above is fixed we would be left with following files that need default exports:

modifiers/hds-advanced-table-cell/dom-management modifiers/hds-advanced-table-cell/keyboard-navigation modifiers/hds-code-editor/languages/rego modifiers/hds-code-editor/languages/sentinel modifiers/hds-code-editor/palettes/hds-dark-palette

the above modifiers are already covered in this PR with default exports

this would slim down your PR substantially, to see the result what we see when using hds in embroider context check our Run Tests for embroider-safe scenario, there would be one issues left which is fine

I'm not sure I follow, what would slim down the PR substantially? as I mentioned above, the suggested change in rollup config only clears one warning. And yes, as mentioned in the tickets, I'm testing with pnpm ember try:one embroider-safe which seems to be similar to your process.

@alex-ju
Copy link
Member Author

alex-ju commented Jul 28, 2025

Closing this PR as we've been unable to align on a solution and it's been stalled in review for over a month. Since the changes were only intended to address non-functional build warnings, it's probably not worth pursuing further at this time.

@alex-ju alex-ju closed this Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants