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 Vue 3 demo to examples #10245

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from

Conversation

maciejbo-handsontable
Copy link
Contributor

Context

We do not have Vue 3 demo at all, we needed to fix this lack.

How has this been tested?

Launched in browser in local environment

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Additional language file or change to the existing one (translations)

Related issue(s):

Affected project(s):

  • handsontable
  • @handsontable/angular
  • @handsontable/react
  • @handsontable/vue
  • @handsontable/vue3

Checklist:

[skip changelog]

Copy link
Member

@jansiegel jansiegel left a comment

Choose a reason for hiding this comment

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

@maciejbo-handsontable

Apart from my suggestions in the code, the demo needs a little correction in the styling of the progress bar.

When comparing this demo with the vue2 demo, the progress bars appear in a slightly different position, which would cause issues with the visual tests.

Take a look at this video - in here I'm switching between tabs with the vue2 and vue3 demos:

progress-bar-position.mov

@@ -0,0 +1,101 @@
<script src="./DataGrid.js"></script>
Copy link
Member

Choose a reason for hiding this comment

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

I think we could move the entire logic into this (DataGrid.vue) file to keep it consistent with the vue2 demo.

@@ -0,0 +1,10 @@
import Handsontable from 'handsontable';
import { HotTable } from "@handsontable/vue3";
Copy link
Member

Choose a reason for hiding this comment

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

In some places, there are single quites (') being used. In others - the double quotes (").
Could you unify that? Most probably to the single quotes, as that's what we use in the Handsontable codebase. (with the exception of DOM-related stuff, like declaring props in the templates)

return;
}

const rowData = cellProperties.instance.getSourceDataAtRow(row) as { checked: boolean };
Copy link
Member

Choose a reason for hiding this comment

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

You can use the RowObject type in here (and a couple of lines below).
It's available for importing from:

import type { RowObject } from 'handsontable/types/common';
Suggested change
const rowData = cellProperties.instance.getSourceDataAtRow(row) as { checked: boolean };
const rowData: RowObject = cellProperties.instance.getSourceDataAtRow(row);

value = 0;
}

const isValid = /^\d+$/.test(value.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Instead of creating a second-ish validator, you can use the native Handsontable validator.

To do that, you'd need to set the type of the column (in this case type="numeric") and implement logic similar to the one I suggested in your PR updating the React demo:
#9935 (comment)

value = 0;
}

const isValid = /^\d+$/.test(value.toString());
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as with the Progress Bar renderer.

jansiegel
jansiegel previously approved these changes Feb 17, 2023
@budnix budnix changed the title Feature/issue dev 1072 Add Vue 3 demo to examples Feb 21, 2023
@github-actions
Copy link

github-actions bot commented Mar 10, 2023

Launch the local version of documentation by running:

npm run docs:review c2deac9a4affd9d2b01ef1f508b6c84a4733be40

…existance of vue3

- Correct the component script type definition
@jansiegel
Copy link
Member

@wszymanski I think the demo works correctly, and the only thing left to do is fixing the problem with the build failing on the CI.

@wszymanski
Copy link
Contributor

It seems that problem found by @jansiegel was caused by adding package-lock.json file. It has been fixed by a033161.

Investigation has shown that there are no significant differences in a way how scripts are run locally and by GA. However, I've seen some parts of code which may be problematic. Thus, I suggest to leave also another changes, not related to the problem:

I also added Smoke test for Vue3 wrapper, just by copying them from Vue package. Some unnecessary changes has been reverted within f4bbebe.

It seems that everything works properly, thus I'm leaving PR for review again.

jansiegel
jansiegel previously approved these changes Mar 23, 2023
…eature/issue-dev-1072

# Conflicts:
#	examples/package.json
@kWeb24 kWeb24 requested a review from wszymanski May 24, 2023 13:23
Copy link
Contributor

@wszymanski wszymanski left a comment

Choose a reason for hiding this comment

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

@kWeb24 Could you check whether sass isn't needed?

Screenshot 2023-05-24 at 16 49 18

@kWeb24 kWeb24 requested a review from wszymanski May 24, 2023 16:04
@wszymanski
Copy link
Contributor

@kWeb24 Thank you for your effort. Perhaps I wasn't precise enough. I meant adding dev dependency 🙂

@kWeb24
Copy link

kWeb24 commented May 26, 2023

@wszymanski I think new dependency is not needed for just a few nested selectors. 😄

@wszymanski
Copy link
Contributor

@wszymanski I think new dependency is not needed for just a few nested selectors. 😄

You are right! :) Good job.

wszymanski
wszymanski previously approved these changes May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants