Skip to content

Rewrite status #19

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

Open
JulianCataldo opened this issue Apr 17, 2025 · 1 comment
Open

Rewrite status #19

JulianCataldo opened this issue Apr 17, 2025 · 1 comment

Comments

@JulianCataldo
Copy link
Contributor

JulianCataldo commented Apr 17, 2025

I'm going to do a major rewrite for JSFE, to make it much more modular and easy to integrate in any kind of setups.

This issue will keep track of the tasks on a next branch, until some tests are properly setup, and the rewrite finished, of course.

For now, it's a bit of a dump that will be more structured later.


  • Make an external form controller, a subclass of EventTarget with TC39 signals (via Lit) for various states
  • Focus on Shoelace and System (bare widgets), update Shoelace to WebAwesome
  • Make a ready to consume Shoelace/WA form, preloaded with presets and with swappable widgets
    • Slots were evaluated for swapping specific fields, but sadly, it's too boilerplatey to pass the inputs event in the light DOM to a shadowed form
    • Make this implementation (100-200 LOC max) with both Lit and React, to demonstrate versatility
  • Tests with playwright(with SSR, React, Lit…) with WebAwesome and Gracile
  • Unit tests for the core (node:test and c8)
  • In the prolongation of SSR (but that's not a strict requirement), ensure progressive enhancements with native form functioning at 100% + smooth JS take-over.
  • Maintain a coherent integration with native JS APIs (notably, events), while providing reactive helpers for userland templates (e.g. for advanced errors reporting)
  • Make strong typings all over the boards, with aligned semantics and well defined mapping for HTML / JS / JSON Schema / "widgets"… vocabularies.
  • Re-organize the repos, remove a lot of stuff (like alternative UI implementation)
  • Reflect all the changes to the playground
  • Use Vite for distributing both the lib and the themes (separately), so we can do further optimizations
  • Fix the SCSS to CSS.TS pipeline. It's flaky right now in dev.
@JulianCataldo
Copy link
Contributor Author

JulianCataldo commented Apr 28, 2025

For those who are impatient, I've pushed the rewrite on the next branch. See the example-app, e2e and unit tests (for the pure engine) for references. Coverage for units is 80-90%.

It's already possible to play with the generics form system and helpers (formerly called system). All tests are green (e2e, a11y) for it.

Shoelace is almost ready, but I have to fix e2e with it, before releasing all three packages.
I've face some playwright bugs and accessibility nuances (tests are using Axe core for a11y).
See microsoft/playwright#35715 (getByLabel not working with some SL CEs).

For tests I'm doing close to real world all keyboard controls for filling the form. Some widgets, like the SL color picker have slightly different behaviour compared to native browser widgets (Tab, Space, Enter key…). Not a big deal, I'll make some bifurcations in the tests for theme specifics (Also, SL has unique widgets like Rating or Button Group).

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

No branches or pull requests

1 participant