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

Remove create-react-app development server #642

Merged

Conversation

tulup-conner
Copy link
Collaborator

@tulup-conner tulup-conner commented Mar 3, 2023

Finally, it's time. See #221

https://flowbite-react.vercel.app

@tulup-conner tulup-conner added this to the 1.0.0 milestone Mar 3, 2023
@tulup-conner tulup-conner self-assigned this Mar 3, 2023
@tulup-conner tulup-conner requested review from rluders and removed request for rluders March 3, 2023 07:26
@tulup-conner
Copy link
Collaborator Author

Let's roll #165 #166 #167 into this also

@tulup-conner tulup-conner force-pushed the refactor/goodbye-create-react-app branch 3 times, most recently from ceaaa34 to f96b6ae Compare March 5, 2023 03:58
@codecov
Copy link

codecov bot commented Mar 5, 2023

Codecov Report

Patch coverage: 95.70% and project coverage change: +0.10 🎉

Comparison is base (53c1280) 99.43% compared to head (d0d9734) 99.54%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #642      +/-   ##
==========================================
+ Coverage   99.43%   99.54%   +0.10%     
==========================================
  Files         131      129       -2     
  Lines        6559     6537      -22     
  Branches      493      391     -102     
==========================================
- Hits         6522     6507      -15     
+ Misses         37       30       -7     
Impacted Files Coverage Δ
src/components/Accordion/AccordionPanel.tsx 100.00% <ø> (ø)
src/components/Accordion/AccordionPanelContext.tsx 87.50% <ø> (ø)
src/components/Avatar/index.ts 100.00% <ø> (ø)
src/components/Badge/index.ts 100.00% <ø> (ø)
src/components/Breadcrumb/index.ts 100.00% <ø> (ø)
src/components/Button/index.ts 100.00% <ø> (ø)
src/components/Card/index.ts 100.00% <ø> (ø)
src/components/Carousel/index.ts 100.00% <ø> (ø)
src/components/Checkbox/index.ts 100.00% <ø> (ø)
src/components/Dropdown/index.ts 100.00% <ø> (ø)
... and 40 more

... and 162 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tulup-conner tulup-conner force-pushed the refactor/goodbye-create-react-app branch 2 times, most recently from aaaf25e to 9faa35b Compare March 5, 2023 06:45
@zoltanszogyenyi
Copy link
Member

Hey @tulup-conner,

I've contributed by adding some custom container classes so that it looks nice and tidy. We still have a lot of work to do by adding the TOC and making sure that spaces are well constrained - we'll get there eventually!

Cheers,
Zoltan

@tulup-conner
Copy link
Collaborator Author

Im confused why your commits changed the order of so many class names

@zoltanszogyenyi
Copy link
Member

@tulup-conner I'm pretty sure it's because of the Headwind plugin I had in VS code - I've removed it since I forgot I had on my iMac back at home.

Screenshot 2023-03-05 at 18 30 00

I believe we now use the official Prettier plugin from Tailwind CSS? Is this integrated when pushing code?

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@rluders
Copy link
Collaborator

rluders commented Apr 20, 2023

This PR feelings:
https://www.instagram.com/p/CougVrfDVVq/

@tulup-conner
Copy link
Collaborator Author

@rluders I have a bad history of doing that for which you can definitely put me on blast but this one is actually unavoidable lol

@tulup-conner tulup-conner force-pushed the refactor/goodbye-create-react-app branch from fb96f6f to 8f3f4db Compare April 25, 2023 09:34
@zoltanszogyenyi
Copy link
Member

Hey everyone,

The docs redesign is based on this Figma file if anyone wants to contribute:

https://www.figma.com/file/9niSMwJTN8HU45pmY9xuil/Flowbite-react?type=design&node-id=1%3A231694&t=vfYrkIDkLYFi5b9C-1

I've already built a couple of sections for the homepage layout and the main docs looks pretty good, but there's still work to be done with the sidebar and some other functionalities.

Here's how it should look in the end:

Screenshot 2023-05-05 at 12 20 15

Cheers,
Zoltan

@tulup-conner tulup-conner force-pushed the refactor/goodbye-create-react-app branch 3 times, most recently from fa1d549 to 931e857 Compare May 25, 2023 00:07
tulup-conner and others added 19 commits May 25, 2023 10:43
Please don't change this! We want the yarn lockfile, just not the npm one. @zoltanszogyenyi
…text`

React Server Components don't like it when we dynamically change state based on whether we're in the
server or client. Those should be achieved by `useEffect` once mounted.
@tulup-conner tulup-conner force-pushed the refactor/goodbye-create-react-app branch from 19cf04e to 2884e8e Compare May 26, 2023 01:56
@vercel
Copy link

vercel bot commented May 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flowbite-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2023 2:13am

@tulup-conner tulup-conner marked this pull request as ready for review May 26, 2023 01:56
@tulup-conner tulup-conner force-pushed the refactor/goodbye-create-react-app branch from 23d3d01 to d0d9734 Compare May 26, 2023 02:11
@tulup-conner tulup-conner merged commit 6e2b091 into themesberg:main May 26, 2023
@tulup-conner tulup-conner deleted the refactor/goodbye-create-react-app branch May 26, 2023 02:19
rtraficante pushed a commit to rtraficante/flowbite-react that referenced this pull request May 26, 2023
…g#642)

* chore(.editorconfig): remove `.editorconfig`

We already use `prettier`.

* chore(package.json): upgrade dependencies to latest

* chore(.gitignore): add `nextjs` ignores to `.gitignore`

* chore(.npmignore): add more files irrelevant to build

* chore(.prettierignore): remove pointless ignore file

We can just provide `.gitignore` to `prettier`.

* build: migrate `create-react-app` -> `next.js`

We currently use `react-app-rewired`, via `create-react-app`, to run the
development server for local testing of the library.

In this step, we migrate config files to appropriate settings for `next.js` and remove dependencies
we no longer need.

* refactor(/lib/components/*): migrate `/src/lib/*` -> `/src/*`

* refactor(/src/docs/*): migrate `/src/docs/*` -> `/pages/*`

* chore(prettier): run `prettier`

* build(husky): remove `husky`

We already run mandatory CI checks on pull requests and indicate in the contributing guide how to
format and run tests. I don't think this is really necessary.

* refactor(/src/lib/helpers): rename `windowExists` -> `isClient`

This is more consistent with the new React Server Components terminology where `"use client"` is a
new explicit requirement for many components.

* refactor(/src/lib/theme): move to `/src/theme`

* chore(package.json): change `flowbite` to normal dependency

* fix(/src/components/modal): fix server/client mismatch with `next.js`, etc

thanks to @multiwebinc - see themesberg#606

* refactor: resolve `eslint` errors

* refactor(/pages/*): migrate docs to `/pages/docs/*`

Move the theme documentation to `/pages/docs/theme`, and all components to `/pages/docs/components`.
We'll want to create a new page that's just for `DarkThemeToggle` in the latter folder, as well.

* chore(tsconfig.json): add root `path`: `~` -> `.`

Add a relative path via `tsconfig.json`'s `paths` field. Now, instead of chaining `../../`s in
`import`s, we can just refer to the base directory as `~`, e.g., `~/src/components/Alert`.
Additionally, because we are exporting the contents of the library , the vast majority of imports
can simply be achieved via `import { X } from ` 'src';`

* refactor: use `~` paths where applicable

* feat(/src/components/navbar): allow `<Navbar.Brand as={CustomComponent} ..>`

We needed `Record<string, unknown>` so users can add any additional props their custom component
needs.

* fix(/components/navbar): allow `<Navbar.Link as={CustomComponent} ..>`

* fix(/src/theme): add missing border to `<Navbar>` theme

We provided border colors, but did not actually provide a `border-width` property, for some reason.

* feat(/pages/*): add Inter font from `flowbite` to docs pages

* docs(/pages/*): update logo, docs pages layout

resolve themesberg#166 and themesberg#165

* docs(/pages/index): add docs page: `/`

* docs(/pages/docs/index): add docs page: `/docs`

* docs(/pages/*): add missing docs links to `<Sidebar>`

* chore(package.json): upgrade `flowbite` -> `1.6.4`

* chore(package.json): upgrade `flowbite` -> `1.6.3`

* revert(/pages/index): remove homepage redesign

We'll get to this later.

* docs(/pages/*): add missing images

* chore(.vscode): add Visual Studio Code settings

* refactor(next.js): migrate to `next.js` `13` `app/` directory

* chore(package.json): upgrade deps to latest

* refactor(/src/components/table): fix broken import on `merge-deep`

* chore(tailwind.config): import Tailwind CSS classes from `app/`

* refactor(/app/docs/components): migrate components' docs pages to `nextjs`

* chore(format): format project with `prettier`

* chore(lint): lint project with `eslint`

* feat(tailwind.config.js): add `primary` color values

* refactor(general): use `primary` instead of `blue` across components and theming settings

* docs(navbar): update style for the menu items

* docs(general): use styled components

* docs(general): use font smoothing across the docs

* docs(navbar): update logo and text size

* docs(layout): add general layout and improve navbar

* docs(styles): set up basic styles for markdown

* docs(footer): update styles

* docs(markdown): setup basic `mdx` content for accordion

* docs(colors): update `primary` to `cyan`

* chore(lock files): remove lock files

* chore: ignore lock files

* docs(config): setup full font family settings and max width class

* docs(homepage): add gallery thumbnail for hero section

* docs(homepage layout): add layout for homepage

* docs(homepage): move navbar and footer to homepage layout

* docs(components layout): add `max-w-4xl` container for content

* docs(config): move maxWidth values to `extend``

* revert(next.config): undo use styled components

* refactor(nextjs): fix `MDX` implementation in `nextjs` `13`

Note: currently, MDX files don't update until `yarn dev` is stopped and started again. Urgently want
to fix.

* chore(prettier): format with `prettier`

* docs(homepage): create separate component for hero section

* docs(homepage): finish "featured in" section with links

* docs(homepage): add components section and update thumbnails

* fix(homepage): component card key prop and string type

* docs(homepage): add contributors section with live GH data

* docs(contributors): improve content

* docs(prettier): add VS code settings json file & format

* docs(layout): add dividers for main content

* chore(next): update to `v13.4.0`

* docs(layout): add root layout with `html` and `body` tags as recommended by Next JS docshttps://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#layouts

* chore(vs code): disable linting on paste

* docs(homepage): fix contributors data by using useEffect instead of SSC fetch

* docs(navbar): make navigation bar sticky

* docs(component cards): fix dark mode size of thumbnails

* docs(feature section): add first homepage feature section

* docs(homepage): rename React section

* docs(homepage): dark mode section content and images

* docs(homepage): add new tailwind css section

* docs(homepage): add Figma section

* docs(homepage): add social proof section with live data from GitHub, NPM, and Discord

* docs(homepage): use live data for number of components in text

* docs(homepage): fix typo for `f` letter

* docs(homepage): React instead of Svelte :)

* docs(homepage): improve copywriting content of the hero section

* chore(.vscode/settings): ignore output folders in VS Code

* build(storybook): fix `storybook` for `nextjs` build system

* refactor(/src/components/floating): update `@floating-ui/react` to
newest API

* perf(next.config): let `nextjs` compile `mdx` with `rust`

* docs(/app/components/code-preview): add syntax highlighting to code previews

* refactor(prismjs): look for `prismjs` code blocks on every page

* docs(/): link Get started `Button` to `/quickstart`

* revert(next.config): revert experimental `mdxRs`

Unfortunately, it looks like the Rust-based MDX generator breaks (some?) Remark plugins, so we can't
use it yet.

* docs(getting-started/contributing): add page, Getting started->Contributing

* docs(getting-started/contributing): update for new dev process

* revert(tailwind.config): undo only look for `.mdx`, `.tsx`

* docs(getting-started/nextjs): add page, Getting started->Next.js

* docs(app/docs.css): sync styles for markdown with `flowbite-svelte.com`

* docs(app/docs/layout): match `Navbar` to `flowbite-svelte.com`

* docs(customize/theme): add page, Customize->Theme

* revert(tailwind.config): undo look in all folders

This was an unintentional oversight caused by the brief use of `mdx-components.tsx`.

* docs(*): refresh syntax highlighter on page loads

* docs(customize/dark-mode): add page, Customize->Dark mode

* docs(getting-started/introduction): add docs, Getting started->Introduction

* docs(getting-started/quickstart): add docs, Getting started->Quickstart

* chore(package.json): upgrade `nextjs` -> `13.4.3.`

* docs(/): change Get started `Button` link to Introduction docs

* docs(app/docs/layout): change color for current page in `Sidebar` links

* docs(getting-started/license): add page, Getting started->License

* docs(getting-started/typescript): add page, Getting started->TypeScript

* docs(sidebar): improve spacing between sidebar items

* docs(content): create content layout component

* docs(general): use `DocsContentLayout` component for main layout

* docs(alert): set up `mdx` files and content for the Alert component

* docs(avatar): setup `mdx` docs content for Avatar

* docs(badge): setup `mdx` file for Badge component

* docs(breadcrumb): setup `mdx` file for Breadcrumb

* docs(buttons): add `mdx` file for Button

* docs(button group): add `mdx` content for Button Group

* docs(cards): add `mdx` files to Card

* docs(carousel): move carousel to `mdx`

* docs(dropdown): move dropdown to `mdx`

* docs(sidebar): add missing sidebar links

* docs(footer): add footer component to `mdx`

* docs(app/docs/layout): fix `Sidebar` on small screens

* build(src/components/*): add `displayName` to components without one

Next.js seems to rename components in production if they do not have an explicit `displayName`.

* docs(/): add `npm i flowbite-react` with copy-to-clipboard action

* docs(app/components/code-preview): only display function's name in code previews, for now

We would like to be able to show function bodies, but that creates an undesirable result for FCs
that are imported inside props, like `icon={<HiInformationCircle />}`, which becomes a mess. Same
with `icon={HiInformationCircle}`.  We should revisit this in the future, but for now, changing the
default to only display the name of the function is sufficient. We can probably attach
`displayName`s to external components we use to get their proper name, but there might be an even
easier solution.

* docs(components/*): add SEO "short descriptions" to components

* docs(components/*): add SEO "long descriptions" for components

These are about a paragraph long, and go into more specific detail about how to use components
(e.g., common use cases like FAQ for Accordion).

* build(next.config): add 301 redirects for old docs pages

* docs(/): fix `Navbar` should be container width

* refactor(app/docs/*): replace absolute paths with `~`

* docs(app/docs/layout): fix more subtle differences to `flowbite-svelte.com`

In the `Navbar` and `Sidebar`.

* refactor(src/components/*): add missing `"use client";` directives

* docs(app/components/navbar): fix `Badge` color for latest semver

* docs(*): fix various hydration errors

* revert(.gitignore): undo ignore lockfiles

Please don't change this! We want the yarn lockfile, just not the npm one. @zoltanszogyenyi

* docs(app/layout): add favicon

* revert(package.json): return `flowbite` -> `peerDependencies`

* fix(src/components/flowbite): set uniform default state for `ThemeContext`

React Server Components don't like it when we dynamically change state based on whether we're in the
server or client. Those should be achieved by `useEffect` once mounted.

* ci(.github/workflows/*): remove `storybook` build step from CI

* chore(flowbite): move `flowbite` from peerDependency to dependency

* docs(styles): fix main content typography style targeting

* docs(sidebar): reduce gap between sidebar category items

* docs(app/components/code-preview): change default code highlighter style to `.tsx`

* ci(.github/workflows/build): remove Github Pages deploy step

* docs(*): add base `<meta/>` tags and `<title>`

* docs(components/*): add `<title>`, `<meta description/>` to component pages

* refactor(src/components/*): remove pointless `'use client';` directives

---------

Co-authored-by: Zoltán Szőgyényi <zoltan.szogyenyi@gmail.com>
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

Successfully merging this pull request may close these issues.

3 participants