Skip to content

Commit

Permalink
revert: "refactor: Clean up golden-layout css (deephaven#1322)" (deep…
Browse files Browse the repository at this point in the history
…haven#1334)

This reverts commit d1838d7.

Was getting build errors when consuming in Enterprise:
```
> Task :web-client-ui:ideClient FAILED
✓ 1043 modules transformed.
Could not resolve '../scss/GoldenLayout.module.css' from node_modules/@deephaven/golden-layout/dist/GoldenLayoutThemeExport.js
error during build:
Error: Could not resolve '../scss/GoldenLayout.module.css' from node_modules/@deephaven/golden-layout/dist/GoldenLayoutThemeExport.js
    at error (file:///Users/bender/dev/illumon/iris/web/client-ui/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
    at ModuleLoader.handleResolveId (file:///Users/bender/dev/illumon/iris/web/client-ui/node_modules/rollup/dist/es/shared/rollup.js:22156:24)
    at file:///Users/bender/dev/illumon/iris/web/client-ui/node_modules/rollup/dist/es/shared/rollup.js:22119:26
ERROR: "build-js" exited with 1.
```

In the `dist/GoldenLayoutThemeExport.js`, the import ends up being:
```
import GoldenLayout from "../scss/GoldenLayout.module.css"; // parseInt for unitless values, stripping "px"
```
But in the scss folder it’s `GoldenLayout.module.scss`, not `.css`

The babel preset converts the scss imports to css:
```
    [
      'transform-rename-import',
      {
        // The babel-plugin-add-import-extension adds the .js to .scss imports, just convert them back to .css
        original: '^(.+?)\\.s?css.js$',
        replacement: '$1.css',
      },
    ],
```

Will need to resolve this issue before re-merging this refactor.
  • Loading branch information
mofojed authored May 31, 2023
1 parent 4c3fe24 commit 2f7928a
Show file tree
Hide file tree
Showing 23 changed files with 483 additions and 320 deletions.
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions packages/dashboard/src/PanelPlaceholder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
display: flex;
flex-direction: column;
justify-content: center;
padding: $spacer-3;
min-height: 100%;
max-height: 100%;
text-align: center;
overflow: hidden;

// add padding on an inner wrapper so it is included in max height of parent
div {
padding: $spacer-3;
}
}
2 changes: 1 addition & 1 deletion packages/dashboard/src/PanelPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PanelPlaceholder = React.forwardRef(
const component = LayoutUtils.getComponentNameFromPanel({ props });
return (
<div ref={ref} className="panel-placeholder">
<div>Component &quot;{component}&quot; is not registered.</div>
Component &quot;{component}&quot; is not registered.
</div>
);
}
Expand Down
9 changes: 9 additions & 0 deletions packages/dashboard/src/layout/GoldenLayout.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@import '@deephaven/components/scss/custom.scss';
@import './GoldenLayout.scss';

// Exported variables for use in GoldenLayoutThemeExport.js
/* stylelint-disable property-no-unknown */
:export {
tab-height: $tab-height;
drag-border-width: $drag-border-width;
}
Loading

0 comments on commit 2f7928a

Please sign in to comment.