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

Update dependencies to work with Vite and NextJS, combine css files into a single css file #1510

Merged
merged 16 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"@babel/plugin-transform-runtime",
["@babel/plugin-proposal-class-properties", { "loose": true }],
["@babel/plugin-proposal-private-property-in-object", { "loose": true }],
["@babel/plugin-proposal-private-methods", { "loose": true }]
["@babel/plugin-proposal-private-methods", { "loose": true }],
["babel-plugin-transform-remove-imports", { "test": "\\.(scss)$" }]
],
"presets": ["@babel/preset-env", "@babel/preset-react"]
}
2 changes: 1 addition & 1 deletion .circleci/continue_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jobs:
command: npm run lint
- run:
name: Run JavaScript tests
command: npm run build:css && npm run test:ci
command: npm run test:ci
- run:
name: Run Javascript end to end tests
command: npm run cy:ci
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ train_evaluation.r2_score_linear_regression:

### Standalone React component usage

To use Kedro-Viz as a standalone React component, import the component and supply a data JSON as prop:
To use Kedro-Viz as a standalone React component, you can follow the example below. However, please note that Kedro-Viz does not support server-side rendering (SSR). If you're using Next.js or another SSR framework, you should be aware of this limitation.

```javascript
import KedroViz from '@quantumblack/kedro-viz';
import '@quantumblack/kedro-viz/lib/styles.min.css';

const MyApp = () => (
<div style={{ height: '100vh' }}>
Expand All @@ -166,6 +167,23 @@ const MyApp = () => (
);
```

To use with NextJS:

```javascript
import '@quantumblack/kedro-viz/lib/styles.min.css';
import dynamic from 'next/dynamic';

const NoSSRKedro = dynamic(() => import('@quantumblack/kedro-viz'), {
ssr: false,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome !!


const MyApp = () => (
<div style={{ height: '100vh' }}>
<NoSSRKedro data={json} />
</div>
);
```

The JSON can be obtained by running:

```bash
Expand Down
8 changes: 7 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Please follow the established format:
- Include the ID number for the related PR (or PRs) in parentheses
-->

# Release 6.5.1

## Bug fixes and other changes

- Updated dependencies to ensure compatibility with Vite and Next.js environments, combine css into a signle file for npm library (#1510)
vladimir-mck marked this conversation as resolved.
Show resolved Hide resolved

# Release 6.5.0

## Major features and improvements
Expand All @@ -17,7 +23,7 @@ Please follow the established format:
- Fix to search for a '<lambda' Python function in the sidebar. (#1497)
- Add favicon to Kedro-Viz. (#1509)
- Remove python upper-bound requirements and add KedroVizPythonVersion warning. (#1506)

- Resolved various bugs affecting server-side rendering, updated dependencies to ensure compatibility with Vite and Next.js environments (#1508)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this here? That PR was never merged, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


# Release 6.4.0

Expand Down
Loading
Loading