Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Vue Route in demo App #183

Merged
merged 11 commits into from
Sep 11, 2024
Merged

Conversation

sadiqkhoja
Copy link
Contributor

@sadiqkhoja sadiqkhoja commented Aug 12, 2024

The existing mechanism of using History API to handle routing is not foolproof, I noticed it breaks when demo app is run from a subdirectory. Hence, I have install vue-router. This was also suggested in #164 (comment)

Copy link

changeset-bot bot commented Aug 12, 2024

⚠️ No Changeset found

Latest commit: e385230

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sadiqkhoja sadiqkhoja marked this pull request as draft August 12, 2024 14:55
@sadiqkhoja sadiqkhoja changed the title Features/UI/vue router Vue Route in demo App Aug 12, 2024
Copy link
Member

@eyelidlessness eyelidlessness left a comment

Choose a reason for hiding this comment

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

I'm excited to get this in. I do have several changes to suggest, on the review/features/ui/vue-router branch (see the diff), with each suggestion and reasoning in a separate commit. Feel free to cherry pick as you like, or make changes with adjustments as you see fit!

I know the separate branch/diff isn't necessarily an ideal format for review. I was finding it difficult to make some of the suggestions inline, and to make some it clear where some related changes would be implied across modules or with larger gaps between affected lines within the same module.

Hopefully none of these are particularly controversial. Looking forward to getting this in. I think it'll reduce a lot of little daily paper cuts that the manual history management approach has.

- We should consider the `optimizeDeps` change regardless. We do this in all of the other packages.
- We should probably not make the changes to `showPopover` and `hidePopover` calls without deeper consideration of fallback behavior, if we are in fact supporting weird edge cases where otherwise-supported browsers are mysteriously lacking certain expected APIs

Much more detail about the latter in getodk#211
…ped globals

Note that `RouterLink` is already imported, so it’s superfluous in the ESLint config regardless.
We’ll be better off when we [automate Vue script/style code formatting](getodk#210), but this helped me better understand the styling structure
Not a huge deal, but it has some really surprising results with the fixtures as they’re currently named.

It’s worth considering pulling the titles out of the fixtures themselves (this is done in ui-solid). My hesitation recommending this is that it slows down page load as we add more/larger form fixtures.

I plan to introduce a change later which will make fixture loading asynchronous, but pulling the titles out of them for the listing isn’t trivially compatible with that.
All of this state and logic is reinventing functionality already provided by HTML, and well-supported by all target browsers. In general, let’s try to lean into the platform when it has perfectly good slutions to problems we’re working on!
It is very difficult to tell **what a thing is** when we frequently use the same name form different things with different meanings in different contexts.

In many cases, we benefit from TypeScript type annotations to reduce this confusion, but it’s especially challenging where types are inferred.

This naming is intended to match the same format used by `categoryName`. Symmetry of naming for like things is also a very helpful device for improving code comprehension!
The hover styles for the whole block were super confusing to me in a lot of ways. I do think there’s some value in a hover style to emphasize their clickability. But I think it makes much more sense to only style the category name for that purpose.
This consistency would already have been preferable. It now also simplifies:

- Categorization of fixtures in FormList.vue
- Route handling in FormPreview.vue
Same reasoning as earlier commit changing `form` -> `formName`
Please let’s not make it harder to debug when unexpected things happen
@sadiqkhoja
Copy link
Contributor Author

Thanks for the review, I have merged all the changes you suggested.

Copy link
Member

@eyelidlessness eyelidlessness left a comment

Choose a reason for hiding this comment

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

🚀

@sadiqkhoja sadiqkhoja merged commit b0f141d into getodk:main Sep 11, 2024
43 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants