{"id":21612111,"url":"https://github.com/alexseitsinger/react-ssr-frontend","last_synced_at":"2025-04-11T05:35:41.134Z","repository":{"id":48020764,"uuid":"158935650","full_name":"alexseitsinger/react-ssr-frontend","owner":"alexseitsinger","description":"A webpack compiler and provider for rendering and serving server-side react.","archived":false,"fork":false,"pushed_at":"2023-01-07T04:02:18.000Z","size":3586,"stargazers_count":5,"open_issues_count":18,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T18:02:32.396Z","etag":null,"topics":["react","server-side-rendering"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexseitsinger.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-24T12:47:14.000Z","updated_at":"2021-03-29T21:11:32.000Z","dependencies_parsed_at":"2023-02-06T11:15:26.301Z","dependency_job_id":null,"html_url":"https://github.com/alexseitsinger/react-ssr-frontend","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-ssr-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-ssr-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-ssr-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexseitsinger%2Freact-ssr-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexseitsinger","download_url":"https://codeload.github.com/alexseitsinger/react-ssr-frontend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248348798,"owners_count":21088922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","server-side-rendering"],"created_at":"2024-11-24T21:16:45.638Z","updated_at":"2025-04-11T05:35:41.090Z","avatar_url":"https://github.com/alexseitsinger.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-SSR (Frontend)\n\nA webpack compiler and provider for render and serving server-side react. Expected to be used in combination with [React-SSR (Backend)](https://github.com/alexseitsinger/react-ssr-backend)\n\n## Installation\n\n```\nyarn add @alexseitsinger/react-ssr\n```\n\n## Modules\n\n#### browserBundle\n\nThe entry point for the client-side bundle.\n\n```javascript\nimport { browserBundle } from \"@alexseitsinger/react-ssr\"\n\nexport const store = browserBundle({\n  App,\n  createStore,\n  render: (PreparedApp, { store, browserHistory }) =\u003e {\n    hydrate(\u003cPreparedApp /\u003e, document.getElementById(\"app\"))\n  }),\n})\n```\n\n#### serverBundle\n\nThe entry point for a server-side bundle.\n\n```javascript\nimport { serverBundle } from \"@alexseitsinger/react-ssr\"\n\nexport default serverBundle({\n  App,\n  createStore,\n  render: (PreparedApp, { store, serverHistory, url }) =\u003e {\n    const html = renderToString(\u003cPreparedApp /\u003e)\n    const state = store.getState()\n    return {\n      html,\n      state,\n    }\n  },\n})\n```\n\n## Scripts\n\nThe script to start the compilation (development only) and provider servers.\n\n```bash\nyarn react-server [--address \u003cvalue\u003e ...]\n```\n\n#### Options\n\nName                 | Description                                                               | Default           | Required\n---                  | ---                                                                       | ---               | ---\naddress              | The address the servers should listen on.                                 | 0.0.0.0           | yes\ncompilerPort         | The port the compiler server should use.                                  | 8081              | no\nproviderPort         | The port the provider server should ue.                                   | 8082              | no\nbrowserConfig        | The path to the browser-side webpack config.                              | undefined         | yes\nserverConfig         | The path to the server-side webpack config                                | undefined         | yes\nrenderURL            | The endpoint that provides server-side renders.                           | /render           | no\nreducerDirs          | Extra paths to reducer directories within the app.                        | undefined         | no\nappPath              | The base path to use when finding default state files.                    | undefined         | yes\ndefaultStateURL      | The url to use for retrieving default state.                              | /defaultState     | no\ndefaultStateFileName | The file name to look for which contains the default state.               | defaultState.json | no\nbrowserStatsURL      | The url to use for retrieving the current browser bundle's webpack stats. | /browserStats     | no\nbrowserStatsPath     | The path to prepend to the browser stats file.                            | undefined         | yes\nbrowserStatsFileName | The name of the browser stats file.                                       | stats.json        | no\nsecretKeyValue       | The secret key value to match against when receiving requests.            | undefined         | no\nsecretKeyHeaderName  | The name of the header that will contain the secret key.                  | secret-key        | no\nserverBundlePath     | The path to find the server bundle.                                       | undefined         | yes\nserverBundleName     | The name of the server bundle.                                            | server.js         | no\nallowedFiles         | Names of files that are allowed to be read.                               | webpack.json      | no\nignoredFiles         | Names of files that are never allowed to be read.                         | undefined         | no\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexseitsinger%2Freact-ssr-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexseitsinger%2Freact-ssr-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexseitsinger%2Freact-ssr-frontend/lists"}