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

Add missing BoxRendererType exports #2047

Closed
wants to merge 1 commit into from
Closed

Conversation

garrettjstevens
Copy link
Collaborator

Discussion #2042 helped me realize that we have some things missing in our re-exports in core. In this case, BoxRendererType was the default export in packages/core/pluggableElementTypes/renderers/BoxRendererType.ts, and in packages/core/ReExports/modules.ts it did:

// other imports...
import BoxRendererType from '../pluggableElementTypes/renderers/BoxRendererType'
// other imports...

const libs = {
  // other libs...
 '@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType': BoxRendererType,
  // other libs
}

// other stuff

That meant that the named exports in BoxRendererType.ts didn't get added to libs. I don't think there's a way to add both named and default exports to a single entry in libs, so this PR changes BoxRendererType to a named export and then re-exports everything from that file.

There could be other things missing in the same way, though. I'm wondering if there's a way to be more methodical about our re-exports to make sure we don't miss things. Or, we could ban default exports in core (like with a lint rule) to be sure this doesn't happen.

@garrettjstevens garrettjstevens self-assigned this Jun 11, 2021
@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Jun 11, 2021
@tchannagiri
Copy link

Thanks for the update Garret. If I may make another suggestion: why not keep the BoxRendererType class itself as the default export, but also re-export all the exports from BoxRendererType.ts using "* as BoxRendererType" as you have in the commit? I think the UMD build will still be able to correctly determine if you are importing the default export or a named export and chose the correct re-export. It also seems like all the other renderer classes in pluggableElementType/renderers are exported as the default export.

On another note, I think maybe my issue here: GMOD/jbrowse-plugin-template#15 with trying to compile offscreenCanvasPonyFill.js in the plugin template may be related. It is not currently re-exported, but if it was then there would be no need to compile it and it would avoid the compilation errors I was getting.

@garrettjstevens
Copy link
Collaborator Author

This does not do what I originally thought it did. Closing.

@cmdcolin cmdcolin deleted the boxrenderer_exports branch September 10, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants