-
Notifications
You must be signed in to change notification settings - Fork 83
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
Zero dependency (vanilla js) #172
Comments
Currently dockview is specifically designed for use with React. Dockview has zero dependencies but it does have a peer dependency on the react and react-dom libraries. Although, the entire project is written in vanilla js and exposes a react layer on top for people to use. It would easily work in vanilla js if the react peer dependency could be isolated. Let me take a look at this and see if I can provide an example of using dockview using only vanilla js. |
Progress Update I've published an experimental build to npm under the experimental tag 0.0.0-experimental-ff3f0b23-20230207. There are numerous issues with this still but I wanted to show where I was at on this. It's very reasonable to assume dockview can support Vanilla JS/TS (and I believe it would be a benefit to have) since the core of the library is written in plain TypeScript with the React components simply wrappers on top of that core logic. The sandbox example here shows a "running example" (not necessarily a working example) written in plain TypeScript. As you will see there are issues:
I will be looking into these issues but I can't really give a hard timeline currently, however the message here is that I do intend to support Vanilla JS/TS in the near future. |
I wonder if something in the spirit of this would be possible:
Or, to follow an existing paradigm, something like this: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdockinglayout/jquery-docking-layout-getting-started.htm?search= |
Moving this under the Discussions section here. |
Hi @mathuo. This example (linked to in the discussion referenced above) uses both react and typescript. Is it actually possible in vanilla JS? index.tsx import { StrictMode } from 'react';
import * as ReactDOMClient from 'react-dom/client';
import './styles.css';
import 'dockview/dist/styles/dockview.css';
import App from './app';
const rootElement = document.getElementById('root');
if (rootElement) {
const root = ReactDOMClient.createRoot(rootElement);
root.render(
<StrictMode>
<div className="app">
<App />
</div>
</StrictMode>
);
} |
I see now there is a drop-down on the example for a javascript version. However that still isn't vanilla javascript. |
What are you defining as vanilla javascript? |
index.html
Here is a (really bad) web app that uses an extensive and complex pure-javascript widget library. I use the library by loading a single javascript file. |
Overall, I like dock-view the best in terms of functionality and appearance. But there are a number of pure-js libraries that require only loading a single library file. Also, some are not FOSS, for example JQWidgets. Dock Spawn TS is a pure JS library (no react) but not something you can link to as a single file.
What would be really awesome is an algorithm to drag and dock jspanel objects. |
I'm speaking for the Vue community here. It would be great if there was also a Vue version of this. Especially since dockview-core is not related to React, this should be possible in principle. I've just had a look at the source code, but I'm struggling a bit with porting the React portal stuff to Vue. Can anyone help? |
Moving discussion to here |
Does "zero dependency" mean it can run as a vanilla js library?
Is there an example of how to do that?
The text was updated successfully, but these errors were encountered: