Skip to content

[internal] Fix playground structure#6466

Merged
LukasTy merged 4 commits into
mui:nextfrom
LukasTy:fix-playground
Oct 12, 2022
Merged

[internal] Fix playground structure#6466
LukasTy merged 4 commits into
mui:nextfrom
LukasTy:fix-playground

Conversation

@LukasTy

@LukasTy LukasTy commented Oct 12, 2022

Copy link
Copy Markdown
Member

The existing git structure was not as expected for playground usage.

  • Remove playground.example.tsx
  • Create playground/example.tsx explaining how to use it
  • Remove redundant .gitignore entry

@LukasTy LukasTy added docs Improvements or additions to the documentation. internal Behind-the-scenes enhancement. Formerly called “core”. dx labels Oct 12, 2022
@mui-bot

mui-bot commented Oct 12, 2022

Copy link
Copy Markdown

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 556.4 1,155.4 561.8 825.7 236.389
Sort 100k rows ms 601.6 1,133.1 1,133.1 963.8 195.512
Select 100k rows ms 255.7 360.5 269 294.18 40.711
Deselect 100k rows ms 150.6 294.8 257.1 235.08 56.471

Generated by 🚫 dangerJS against 6863d15

Comment thread .gitignore Outdated
@LukasTy
LukasTy merged commit fa1db44 into mui:next Oct 12, 2022
@LukasTy
LukasTy deleted the fix-playground branch October 12, 2022 09:25
@oliviertassinari

oliviertassinari commented Oct 12, 2022

Copy link
Copy Markdown
Member

I think that this change defeats the purpose of the introduction of the playground. The problem I tried to solve was:

  1. I need to test a change in isolation
  2. I open docs/pages/x/introduction/index.js
  3. I copy & paste the reproduction on the GitHub issue
  4. I make a fix
  5. I start to make a commit
  6. 💥 pain. I need to git reset the changes done in docs/pages/x/introduction/index.js

We are introducing pain 6 back with this PR:

Screenshot 2022-10-12 at 16 54 26


I think that the trap is that gitignore only applies to files that are not tracked yet. This PR tracks docs/pages/playground/example.tsx so gitignore has no impact anymore.


An improved version proposal: mui/material-ui#34739

@LukasTy

LukasTy commented Oct 12, 2022

Copy link
Copy Markdown
Member Author

@oliviertassinari The original implementation had the same "issue" you are referring to—if you were to modify playground.example.tsx—the changes appear in git.
The idea is that developers would create their own playgrounds in playground folder and example.tsx just serves as that—an example.

I was initially unaware of this workflow to test components in isolation and changes were made to adapt to the way others (Siriwat, Flavian) got used to using it.

By no means—I do agree that this process could be improved and it's discoverability made better (like what you are suggesting in your PR 👍 ).

@oliviertassinari

oliviertassinari commented Oct 12, 2022

Copy link
Copy Markdown
Member

The original implementation had the same "issue" you are referring to—if you were to modify playground.example.tsx—the changes appear in git.

@LukasTy Ah right makes sense 👍, I misinterpreted how this new file was supposed to be used. The changes looks good then.

So mui/material-ui#34739 is only about pushing the solution a step forward with, e.g. documentation on how to use it.

@flaviendelangle

flaviendelangle commented Oct 12, 2022

Copy link
Copy Markdown
Member

My current usage is as followed:

I have one playground which is cleaned several times a day (pages/playground.tsx right now, could be pages/playground/temp.tsx for instance).
On this one I do basically what @oliviertassinari describes.
I copy paste reproduction cases, doc examples etc... anything I want to play with right now.

But I also have other playgrounds (currently new-pickers.tsx) which I can keep for weeks and that I don't want to loose between two sessions of work on a given PR.

I never touch pages/playground/examples.tsx.

@oliviertassinari oliviertassinari changed the title [core] Fix playground structure [internal] Fix playground structure Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants