iTwin / iTwinUI-react

A react component library for iTwinUI.
https://github.com/iTwin/iTwinUI
Other
83 stars 23 forks source link

chore: Add nextjs and astro playgrounds #951

Closed mayank99 closed 1 year ago

mayank99 commented 1 year ago

This PR adds examples for nextjs and astro to showcase the ability to SSR our ThemeProvider, as well as allow easily testing things. The nextjs example uses next-transpile-modules to resolve css imports within components (this is a limitation in nextjs). The astro example doesn't hydrate the ThemeProvider (no client:*) because hydrating it results in an extra <body> tag being added. I think this is a bug in astro.

yarn build will build these playgrounds (as well as the existing vite one) so we can be sure that our package will continue to work with these frameworks in every future release. Currently these examples only contain a Button and ThemeProvider. We could add more things in the future.

Other interesting notes:

mayank99 commented 1 year ago

Could you add some info in readme how to run these? It's kinda obvious but it's nice to have some info for users or new team members who is not familiar with this environment.

Updated the contributing guide. It mentions the dev server and ports. I didn't add any READMEs to individual workspaces because i thought that would kinda become hidden and too many files to maintain.