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

fix(schema-compiler): ExportNamedDeclaration for variables object #8774

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arkadiusz-swierczek-pm
Copy link

Check List

  • Tests has been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

Class ImportExportTranspiler contains the a bug that prevent using exported object syntax from cubes.

Related: https://cube.dev/docs/product/data-modeling/dynamic/code-reusability-export-and-import#import-from-parent-directories

The changes were tesed using https://astexplorer.net/ and content:

export const helperFunction = () => 'hello'
export { helperFunction as alias }
export default helperFunction

Without the fix, the Compiler throws error TypeError: Cannot read properties of null (reading 'declarations'). After the fix the babel transpiles the file to:

const helperFunction = () => 'hello';

addExport({
  helperFunction: helperFunction
})
addExport({
  alias: helperFunction
});
setExport(helperFunction);

@arkadiusz-swierczek-pm arkadiusz-swierczek-pm requested a review from a team as a code owner October 3, 2024 15:33
Copy link

vercel bot commented Oct 3, 2024

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

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 3:34pm

@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:community Contribution from Cube.js community members.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant