{"id":14977574,"url":"https://github.com/complate/complate-spring","last_synced_at":"2025-10-28T04:31:35.583Z","repository":{"id":46638732,"uuid":"214260674","full_name":"complate/complate-spring","owner":"complate","description":"Server-Side Rendering of JSX based views in Spring MVC","archived":false,"fork":false,"pushed_at":"2024-04-08T07:21:40.000Z","size":351,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-08T08:35:00.480Z","etag":null,"topics":["java","jsx","spring-boot","spring-framework","spring-mvc","template-engine"],"latest_commit_sha":null,"homepage":"https://complate.github.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/complate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-10-10T18:49:09.000Z","updated_at":"2024-04-15T08:59:34.558Z","dependencies_parsed_at":"2022-09-05T14:30:13.820Z","dependency_job_id":"bcdb4d42-46f3-4d85-a4e3-d0c47551da03","html_url":"https://github.com/complate/complate-spring","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complate%2Fcomplate-spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/complate","download_url":"https://codeload.github.com/complate/complate-spring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238597386,"owners_count":19498396,"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":["java","jsx","spring-boot","spring-framework","spring-mvc","template-engine"],"created_at":"2024-09-24T13:55:55.825Z","updated_at":"2025-10-28T04:31:35.560Z","avatar_url":"https://github.com/complate.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# complate-spring\n*- Server-Side Rendering of JSX based views in Spring MVC*\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.complate/complate-spring-mvc/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.complate/complate-spring-mvc)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Open Issues](https://img.shields.io/github/issues/complate/complate-spring.svg)](https://github.com/complate/complate-spring/issues)\n[![Build Status](https://github.com/complate/complate-spring/actions/workflows/main.yml/badge.svg)](https://github.com/complate/complate-spring/actions/workflows/main.yml)\n[![Code Coverage](https://codecov.io/gh/complate/complate-spring/branch/main/graph/badge.svg)](https://codecov.io/gh/complate/complate-spring)\n\n[complate](https://complate.org) adapter that can be used in\n[Spring MVC](https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html)\nfor Server-Side rendering JSX based views.\n\n\n## Quick Start\n\nDownload the jar through Maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.complate\u003c/groupId\u003e\n  \u003cartifactId\u003ecomplate-spring-mvc\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAdditionally you need to declare a second dependency to your desired complate\nengine (Graal, Nashorn, ...).\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.complate\u003c/groupId\u003e\n  \u003cartifactId\u003ecomplate-graal\u003c/artifactId\u003e\n  \u003c!-- or: \u003cartifactId\u003ecomplate-nashorn\u003c/artifactId\u003e --\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo configure the relevant parts within your Spring Boot application you need to\nadd a configuration class like the one shown below.\n\n```java\n@Configuration\npublic class ComplateConfiguration {\n\n    @Bean\n    public ComplateSource complateSource(\n            @Value(\"classpath:/templates/complate/bundle.js\") Resource resource) {\n        /*\n         * Note that you have to make sure that the `/templates/complate/bundle.js`\n         * file exists within your classpath on runtime and that this file exports\n         * a function named `render` by default that has a matching signature:\n         *\n         * ```\n         * export default function render(view, params, stream) {\n         *     ...\n         * }\n         * ```\n         *\n         * Within this function you can use a complate Renderer to render JSX\n         * based views. Because you then need to transpile your JavaScript code\n         * you can use faucet or any other bundler that has support for\n         * transpiling *.jsx files.\n         */\n        return new ResourceComplateSource(resource);\n    }\n\n    @Bean\n    public ComplateRenderer complateRenderer(ComplateSource source) {\n        /*\n         * Note that it's possible to add global bindings or customize other\n         * options via the builder for the GraalComplateRenderer.\n         *\n         * Because `GraalComplateRenderer` only evaluates the given `ComplateSource`\n         * on instantiation changes made to this source afterwards will not be\n         * picked up. If you want to re-evaluate the `ComplateSource` on every call\n         * to `render` you can wrap the `GraalComplateRenderer` within an\n         * `ComplateReEvaluatingRenderer`.\n         *\n         * If you encounter problems that may be related with the multi threaded\n         * nature of a Spring web application you can wrap the `GraalComplateRenderer`\n         * (or `ComplateReEvaluatingRenderer`) within an `ComplateThreadLocalRenderer`.\n         * This will create an instance that is exclusively used within a thread.\n         *\n         * If you do not want to use the Graal base renderer for the time being\n         * there is a `NashornComplateRenderer`, too. Note that this will not work\n         * with a more recent JDK because Nashorn was removed.\n         */\n        return new GraalComplateRenderer.of(source).build();\n    }\n\n    @Bean\n    public ComplateViewResolver complateViewResolver(ComplateRenderer renderer) {\n        return new ComplateViewResolver(renderer);\n    }\n}\n```\n\nIf you want to use the latest unstable version `1.0.1-SNAPSHOT` you need to\nconfigure Sonatype's OSS Nexus as snapshot repository:\n\n```xml\n\u003crepository\u003e\n  \u003cname\u003eCentral Portal Snapshots\u003c/name\u003e\n  \u003cid\u003ecentral-portal-snapshots\u003c/id\u003e\n  \u003curl\u003ehttps://central.sonatype.com/repository/maven-snapshots/\u003c/url\u003e\n  \u003creleases\u003e\n    \u003cenabled\u003efalse\u003c/enabled\u003e\n  \u003c/releases\u003e\n  \u003csnapshots\u003e\n    \u003cenabled\u003etrue\u003c/enabled\u003e\n  \u003c/snapshots\u003e\n\u003c/repository\u003e\n```\n\n\n## Release History\n\nSee [CHANGELOG.md](./CHANGELOG.md)\n\n\n## Code of Conduct\n\n[Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this\nproject you agree to abide by its terms.\n\n\n## License\n\ncomplate-spring is Open Source software released under the\n[Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomplate%2Fcomplate-spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomplate%2Fcomplate-spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomplate%2Fcomplate-spring/lists"}