You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The react-web generator depends upon the #6 generator.
The react-web parser receives a JSX Node. Then it builds into a JavaScript bundle by using esbuild JavaScript APIs and finally returns the output from the ESbuild pipeline into VFiles (?) (This is an open topic, as the build will probably return a bunch of different outputs which are probably the numerous chunks if we use chunk loading of the build);
The react-web generator aims to receive a top-level JSX element, wrap it with ReactDOM, build it as an ES2017 (or newer) target output, and return the parsed/built content to be stored in files.
Also, the react-web will receive the final contents of the generated pipeline. The output is pretty much JavaScript, which can then be used/added elsewhere.
I'm not sure if we should use esbuild or how to deal with the Web part of the bundling/generation of the API docs because:
The mdx-react generator handles individual doc files
Somewhere between mdx-react and react-web we need to handle building the rest of the website (such as navigation, footer, header, etc)
I had an idea that it could look like:
importloadDocFilefrom'./loader.mjs';importparseDocFilefrom'./parser.mjs';importgetNodeReasefrom'./release.mjs';importmdxGeneratorfrom'./generators/mdx';importmdxReactGeneratorfrom'./generators/mdx-react';importwebGeneratorfrom'./generators/react-web';// Returns an array of Promises of VFile'sconstpromises=docFiles.map(fileName=>loadDocFile(fileName).then(parseDocFile).then(mdxGenerator).then(mdxReactGenerator));constvFiles=awaitPromise.all(promises);constrelease=awaitgetNodeRease('22.0');// Web Generator takes an array of VFiles// And then generates the navigation, header, footer, and each page?constjavaScriptBundle=awaitwebGenerator(vFiles,release);// Do something with the bundle ??// Save them on chunk files on the out directory ??Wouldyoupleasedosomething?
Note that the example above is just an example entry point, since we provide a generic API, users can use the CLI entry point which by default outputs to FILES in the given output directory; we can also have the DevServer entry Point with Vite (?) which requires the build to happen first or something...
I'd like input on this cc @nodejs/web-infra as this is the most complex part for outputting to Web
The text was updated successfully, but these errors were encountered:
The
react-web
generator depends upon the #6 generator.The
react-web
parser receives a JSX Node. Then it builds into a JavaScript bundle by usingesbuild
JavaScript APIs and finally returns the output from the ESbuild pipeline into VFiles (?) (This is an open topic, as the build will probably return a bunch of different outputs which are probably the numerous chunks if we use chunk loading of the build);The
react-web
generator aims to receive a top-level JSX element, wrap it with ReactDOM, build it as an ES2017 (or newer) target output, and return the parsed/built content to be stored in files.Also, the
react-web
will receive the final contents of the generated pipeline. The output is pretty much JavaScript, which can then be used/added elsewhere.I'm not sure if we should use esbuild or how to deal with the Web part of the bundling/generation of the API docs because:
mdx-react
generator handles individual doc filesmdx-react
andreact-web
we need to handle building the rest of the website (such as navigation, footer, header, etc)I'd like input on this cc @nodejs/web-infra as this is the most complex part for outputting to Web
The text was updated successfully, but these errors were encountered: