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

[examples] Add shortcut to open example in online IDE #38572

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Aug 20, 2023

I wanted to reproduce a bug, but couldn't without these links. There are probably more examples with whom these online IDE would work but I don't have the time to check them all.

(StackBlitz is first because it loads faster).

@oliviertassinari oliviertassinari added the examples Relating to /examples label Aug 20, 2023
@mui-bot
Copy link

mui-bot commented Aug 20, 2023

@oliviertassinari oliviertassinari force-pushed the examples-links-codesandbox-stackblize branch 3 times, most recently from 693de9c to e70f59f Compare August 20, 2023 21:45
@mapache-salvaje
Copy link
Contributor

mapache-salvaje commented Aug 21, 2023

I haven't checked all of the links, but the Joy UI + Next.js in TS example appears to be broken on Stackblitz:

./src/components/ThemeRegistry/theme.js
NonErrorEmittedError: (Emitted value instead of an instance of Error) 
  ! Plugin is not supported with current @swc/core. Plugin transform will be skipped.

  x Font loaders must be called and assigned to a const in the module scope
   ,-[/home/projects/jvmizgvgy.github/src/components/ThemeRegistry/theme.js:1:1]
 1 | import { Inter } from 'next/font/google';
 2 | import { extendTheme } from '@mui/joy/styles';
 3 | 
 4 | Inter({
   : ^^^^^
 5 |   subsets: ['latin'],
 6 |   display: 'swap',
 7 | });
   `----

Edit: just checked the example locally and it's throwing the same error. Looks like the font needs to be declared as a const.

Edit 2: it appears that #38540 will resolve this error so we shouldn't need to address it here.

@mapache-salvaje
Copy link
Contributor

mapache-salvaje commented Aug 21, 2023

Is there anything we can do about the naming conventions going on here? I think this would be super confusing to most users (this is StackBlitz):

Screenshot 2023-08-21 at 3 34 50 PM

@oliviertassinari
Copy link
Member Author

Next.js in TS example appears to be broken on Stackblitz:

Ah, yes, same as #38306 (comment)

Is there anything we can do about the naming conventions going on here?

Not sure, in https://developer.stackblitz.com/platform/webcontainers/project-config it doesn't seem to have this option. Make a new issue to create like stackblitz/webcontainer-core#82

@oliviertassinari oliviertassinari merged commit e8773b2 into mui:master Sep 10, 2023
@oliviertassinari oliviertassinari deleted the examples-links-codesandbox-stackblize branch September 10, 2023 23:35
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 10, 2023

I did a deep swipe on all the examples. Tried to fix the broken ones and more generally to normalize them. e.g. this PR fixes #38572 (comment).

xcode-it pushed a commit to xcode-it/material-ui that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Relating to /examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants