{"id":16225922,"url":"https://github.com/bestguy/durandal-delayed-composition","last_synced_at":"2025-04-08T03:43:07.618Z","repository":{"id":12524523,"uuid":"15194386","full_name":"bestguy/durandal-delayed-composition","owner":"bestguy","description":null,"archived":false,"fork":false,"pushed_at":"2013-12-14T23:06:24.000Z","size":652,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T09:18:02.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bestguy.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-14T23:01:17.000Z","updated_at":"2014-09-17T21:19:26.000Z","dependencies_parsed_at":"2022-09-02T06:44:21.513Z","dependency_job_id":null,"html_url":"https://github.com/bestguy/durandal-delayed-composition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fdurandal-delayed-composition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fdurandal-delayed-composition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fdurandal-delayed-composition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestguy%2Fdurandal-delayed-composition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestguy","download_url":"https://codeload.github.com/bestguy/durandal-delayed-composition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773744,"owners_count":20993633,"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":[],"created_at":"2024-10-10T12:46:56.702Z","updated_at":"2025-04-08T03:43:07.574Z","avatar_url":"https://github.com/bestguy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Durandal Delayed Composition\n\nI needed a solution for quickly loading a (mostly) server-side rendered landing page,\nbut also wanted some  [Knockout](http://knockoutjs.com) functionality on the page, and also to use [Durandal](http://durandaljs.com) for SPA functionality for logged in users, etc.\n\nPrior to this, I was using Durandal to render everything SPA-style.\nIt worked well, but in my case it added a few precious seconds to rendering the landing page content\ndue to requirejs, composition, ajax calls, data-binding, etc.\n\nMy constraints were:\n\n- I did not want to trigger another page reload or request to the server to start the SPA functionality.\n- I wanted to replace the server-side content once the SPA started, and without resorting to jQuery hacks, etc.\n\nThis approach uses basically the same code as I had before, but importantly delays the Durandal `app.start()` call until the user takes some action that needs it.\nThis example triggers it when a user clicks a button.\n\nI think this example clearly shows the benefits of Durandal's use of requirejs and Knockout, and a testament to it's overall design.  Great framework!\n\n## To run (requires node.js):\n\n`npm install`\n\n`node app.js`\n\n\n\n## Technologies Used:\n\n### Client-Side\n\n- **Knockout.js** - [http://knockoutjs.com](http://knockoutjs.com)\n\t- Used for data-binding between JavaScript models and the DOM\n- **Durandal** - [http://durandaljs.com](http://durandaljs.com)\n\t- Application library built on Knockout and requirejs that adds advanced modules and view transition functionality.\n- **requirejs** - [http://requirejs.org](http://requirejs.org)\n\t- Client-side loader for JavaScript modules.\n- **Bootstrap 3** - [http://getbootstrap.com/css/](http://getbootstrap.com/css/)\n\t- CSS framework for responsive layout and grids.\n- **Font Awesome** - [http://fontawesome.io/3.2.1/](http://fontawesome.io/3.2.1/)\n\t-  CSS framework for responsive layout and grids.\n\n### Server-Side\n\n- **node.js** - [http://nodejs.org/](http://nodejs.org/)\n\t- Server-side Javascript engine.\n- **express 3** - [http://expressjs.com/](http://expressjs.com/)\n\t- Web application framework for node.js\n- **jade** - [http://jade-lang.com/](http://jade-lang.com/)\n\t- node.js templating engine and HTML shorthand\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestguy%2Fdurandal-delayed-composition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestguy%2Fdurandal-delayed-composition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestguy%2Fdurandal-delayed-composition/lists"}