ux icon indicating copy to clipboard operation
ux copied to clipboard

Add "playground" sub-project for directly testing components

Open fkleuver opened this issue 7 years ago • 3 comments

I'm offering to implement this as a follow-up to #151. I already got the concept to work here. Before I submit a large PR, I'd like to know the team's thoughts on this as there is an important choice to be made.

The basic idea:

  • Add a "playground" folder to the project root, containing a project similar to app-ux-showcase.
  • Add a webpack-dev-server script (with HMR) that runs the project in-memory, directly referencing the aurelia-ux source through its imports rather than through the npm package

I found the current steps involved with testing components to be a large bottleneck and time-consumer when I attempted ux-select a year ago, eventually having me run out of time to spend on it before I could finish - and making it hard to pick up again at a later time.

With my proposed changes, the ease and efficiency of working with both the core and components should be greatly improved as things can directly be tested in the browser with full freedom over fidgeting with the core source during development.

I need an opinion:

Like I did with the plugin I linked earlier, this "playground" could be the home for the showcase (rather than being in its own repository). It can have its own build step that automatically generates the outputs to a separate branch for github pages (like I do with the plugin) or some variation of that.

This could further simplify the overall workflow of keeping everything up-to-date and in sync, and indirectly improves the test coverage of in-development branch of ux since the playground uses the source directly (rather than the package)

I was able to completely automate this from testing and building to pushing and publishing, with fairly simple scripts (see package-scripts.js).

Would you be interested in something like this, or is something else perhaps already being worked on?

fkleuver avatar Mar 03 '18 18:03 fkleuver

@ZHollingshead Can you look into this?

EisenbergEffect avatar Mar 03 '18 21:03 EisenbergEffect

With the current structure being moved to a monorepo, we could probably merge app-ux-showcase into this to be perfectly honest. However the testing becomes slightly more complicated. Each component should contain their tests separately from each other. The test folder at the root of the project would only apply to the app-ux-showcase or demo app, if either was added.

I do like the idea of having them together in a single repository, it would make developing components with UX much quicker.

serifine avatar Mar 04 '18 13:03 serifine

Yep, I figured as much. I was deliberately being reserved with adding/modifying too much as I wasn't sure. So I left out the individual components. Now that you've confirmed that's the direction it should be going, I made an initial draft. Please see the latest commit in this pr #151

fkleuver avatar Mar 04 '18 22:03 fkleuver