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

feat: state autocompletion for builder settings fields #383

Merged
merged 21 commits into from
Jun 28, 2024

Conversation

raaymax
Copy link
Collaborator

@raaymax raaymax commented Apr 10, 2024

No description provided.

@raaymax raaymax marked this pull request as ready for review April 11, 2024 14:19
@raaymax raaymax requested a review from ramedina86 April 11, 2024 14:19
src/ui/src/builder/BuilderFieldsObject.vue Outdated Show resolved Hide resolved
src/ui/src/builder/BuilderTemplateInput.vue Outdated Show resolved Hide resolved
<script setup lang="ts">
import { inject, ref, nextTick } from "vue";
import injectionKeys from "../injectionKeys";
import Fuse from "fuse.js";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unpacked size on npm looks very chunky (>400kb). How big is the file actually being loaded?

I'd argue we don't need fuzzy search as it's programming, not an e-commerce product search. But keen to discuss.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree on avoiding library just for fuzzy research. I would recommand to write a utility function to perform fuzzy research if we need it. The algorithme looks simple.

Copy link
Collaborator Author

@raaymax raaymax Jun 11, 2024

Choose a reason for hiding this comment

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

You shouldn't look at package size this way...
Here you have real size of this package in production build:
Screenshot 2024-06-11 at 14 29 34
But if you insist it could be minified further to something like 23.1kB (7.2 kB gziped)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wonder why it didn't use minified version...
Screenshot 2024-06-11 at 14 38 39

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

maybe vite is minimizing it by itself? 🤔

@@ -38,16 +43,16 @@
</div>
</div>
<div class="formAdd">
<input
<BuilderTemplateInput
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you can use references to state here, can you please check?

ref="assistedKeyEl"
v-model="formAdd.key"
type="text"
v-model:value="formAdd.key"
Copy link
Collaborator

Choose a reason for hiding this comment

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

To use v-model with BuilderTemplateInput you'll need to use defineModel (at least that's what's documented)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What I used is described here:
https://vuejs.org/guide/components/v-model#under-the-hood
I needed a little more control of update events

@ramedina86 ramedina86 merged commit 2f8d82c into writer:dev Jun 28, 2024
15 checks passed
This pull request was closed.
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.

3 participants