feat: add home page#149
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
There was a problem hiding this comment.
@avivkeller wdyt ?, i just replicated the reference u pasted in #96
There was a problem hiding this comment.
They are brands and they may or may not use us (I have no idea about most of them), but naming them kind of gives the impression that “we’ve already talked to them to have them there” (and it’s also marketing for them, while many of them don’t give us anything in return).
Also, it doesn’t really bring benefits. It’s better to focus on sponsors, since they actually provide funding that helps us keep going.
There was a problem hiding this comment.
@TusharThakur04 The image I showed was a demo, but if Sebastian doesn't think it fits, we can remove it. What if we replace it with, as he said "Sponsored by"?
There was a problem hiding this comment.
sure, just wanted to confirm.
as we have whole separate page for the sposors, i was thinking of adding the BackerWall and a link to the sponsors page
wdyt?
| const [isCopied, setIsCopied] = useState(false); | ||
|
|
||
| const handleCopy = async () => { | ||
| const textToCopy = activeSyntax === 'js' ? jsCode : mjsCode; |
There was a problem hiding this comment.
We also support configuration files written in TypeScript
| import path from 'path'; | ||
| import { fileURLToPath } from 'url'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
There was a problem hiding this comment.
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
| entry: './src/index.js', | ||
| output: { | ||
| filename: 'bundle.js', | ||
| path: path.resolve(__dirname, 'dist') |
There was a problem hiding this comment.
| path: path.resolve(__dirname, 'dist') | |
| path: path.resolve(import.meta.dirname, 'dist') |
|
|
||
| import styles from './index.module.css'; | ||
|
|
||
| import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; |
There was a problem hiding this comment.
Rather than adding a needless dependency, I've opened nodejs/doc-kit#845 to allow us to supply this via Markdown.
There was a problem hiding this comment.
will it work ? because the HomeLayout is all react driven and index.md only exposes the layout prop so that homelayout can be displayed at the root level.
There was a problem hiding this comment.
Could you try using the branch to test it? That way, we'll know whether it would work
There was a problem hiding this comment.
I can, just waiting for the doc-kit PR to land, but I can set up a #-based npm install to test
|
I feel that the home page should be pretty simple. Think of nodejs.org, but even simpler as all it is needed is a npm i webpack. (maybe with multiple tabs per package manager) but I wouldn't add sponsors to home page, and keep home page a simple hero. |
|
@TusharThakur04 MDX support landed |
|
@ovflowd I like the bigger design with more basic info on config, sponsors, etc |
I actually prefer the current design. I don't think following the Node.js design is a good idea, and I think sponsors should be part of the homepage, similar to ESLint or Vue.js. We should give value to that money, and the homepage is naturally the most visited page. We already have a separate sponsors page, but that's a different thing and doesn't replace having a small sponsors section on the homepage. That said, I think this is more of a TSC decision, and it's something we should discuss internally. |
233c7ad to
d979a72
Compare
|
@avivkeller now code block is rendering through the doc-kit mdx support and i have also pushed the homesponsors section, happy to revert if tsc doesnt want it |
146238c to
d80d757
Compare
| ```javascript | ||
| // webpack.config.mjs |
There was a problem hiding this comment.
| ```javascript | |
| // webpack.config.mjs | |
| ```javascript displayName="webpack.config.mjs" |
i know this won't render correctly right now, but that's a doc-kit bug
| <Hero /> | ||
| <ConfigSection> | ||
|
|
There was a problem hiding this comment.
| <Hero /> | |
| <ConfigSection> |
Let's try and limit what's in the markdown versus what's in the layout, e.g. keep the code boxes here in the MD, but the JSX at the top and bottom in the layout
| const configFeatures = [ | ||
| 'Zero-config for common setups', | ||
| 'Tree-shaking out of the box', | ||
| 'Hot Module Replacement', | ||
| 'Long-term caching with content hashes', | ||
| ]; |
There was a problem hiding this comment.
nit: declare this outside the function, and then use:
export default ({ children }) => (<MyComponent/>)
| export default function FeaturesSection() { | ||
| return ( |
There was a problem hiding this comment.
| export default function FeaturesSection() { | |
| return ( | |
| export default () => ( |
| export default function Hero() { | ||
| return ( |
There was a problem hiding this comment.
| export default function Hero() { | |
| return ( | |
| export default () => ( |
There was a problem hiding this comment.
Can we share a lot of this logic with the main sponsors section, i.e. import helpers from there?
There was a problem hiding this comment.
| export default function Home({ metadata, children }) { | ||
| return ( |
There was a problem hiding this comment.
| export default function Home({ metadata, children }) { | |
| return ( | |
| export default ({ metadata, children }) => ( |
d80d757 to
8fe1650
Compare
| export default ({ children }) => { | ||
| return <div className="config_code_block">{children}</div>; | ||
| }; |
There was a problem hiding this comment.
What's the point of this component?
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..'); | ||
|
|
||
| const VERSION = process.env.VERSION; | ||
| const VERSION = undefined; |
There was a problem hiding this comment.
| const VERSION = undefined; | |
| const VERSION = process.env.VERSION; |
| <> | ||
| <NavBar metadata={metadata} /> | ||
| <Hero /> | ||
| <ConfigSection codeBlock={children} /> |
There was a problem hiding this comment.
| <ConfigSection codeBlock={children} /> | |
| <ConfigSection>{children}</ConfigSection> |
| <span className={styles.dots} aria-hidden="true"> | ||
| · · · | ||
| </span> |
There was a problem hiding this comment.
| <span className={styles.dots} aria-hidden="true"> | |
| · · · | |
| </span> |
| module.exports = { | ||
| entry: './src/index.js', | ||
| output: { | ||
| filename: 'bundle.js', | ||
| path: path.resolve(\_\_dirname, 'dist'), | ||
| }, | ||
| mode: 'production', | ||
| }; |
There was a problem hiding this comment.
Can you fix the indentation here?
| ``` | ||
|
|
||
| ```javascript displayName="webpack.config.mjs" | ||
| // webpack.config.mjs |
There was a problem hiding this comment.
We can remove the // comment, it's in the title (I know it doesn't render correctly, but that's a doc-kit bug that will be fixed)
| /* blue-50 (#eff6ff) at 50% opacity */ | ||
| background: radial-gradient( | ||
| ellipse 80% 60% at 50% 0%, | ||
| rgb(239 246 255 / 50%) 0%, | ||
| transparent 100% | ||
| ); |


Closes: #96
Summary
This PR adds the Home Page
What kind of change does this PR introduce?
feat
Did you add tests for your changes?
no
Does this PR introduce a breaking change?
no
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Use of AI
used for discussion and repetitive tasks