{"id":16259456,"url":"https://github.com/daliborgogic/guess-nuxt","last_synced_at":"2025-03-16T13:30:58.336Z","repository":{"id":40953323,"uuid":"147707294","full_name":"daliborgogic/guess-nuxt","owner":"daliborgogic","description":"Predict the next page (or pages) a user is likely to visit and prefetch these pages, improving perceived page load performance and user happiness. During the build process, the GuessPlugin will fetch report from Google Analytics, build a model used for predictive pre-fetching and add a small runtime to the main bundle of your application.","archived":false,"fork":false,"pushed_at":"2023-01-04T12:06:44.000Z","size":5249,"stargazers_count":132,"open_issues_count":20,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T09:34:37.296Z","etag":null,"topics":["guess","nuxt","predictive-prefetching"],"latest_commit_sha":null,"homepage":"","language":"Vue","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/daliborgogic.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":"2018-09-06T17:11:18.000Z","updated_at":"2024-09-19T01:11:27.000Z","dependencies_parsed_at":"2023-02-02T11:30:49.638Z","dependency_job_id":null,"html_url":"https://github.com/daliborgogic/guess-nuxt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daliborgogic%2Fguess-nuxt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daliborgogic%2Fguess-nuxt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daliborgogic%2Fguess-nuxt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daliborgogic%2Fguess-nuxt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daliborgogic","download_url":"https://codeload.github.com/daliborgogic/guess-nuxt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243815576,"owners_count":20352194,"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":["guess","nuxt","predictive-prefetching"],"created_at":"2024-10-10T16:02:44.636Z","updated_at":"2025-03-16T13:30:57.220Z","avatar_url":"https://github.com/daliborgogic.png","language":"Vue","funding_links":[],"categories":["Vue"],"sub_categories":[],"readme":"# Guess.js + Nuxt.js\n\n**[Guess.js](https://github.com/guess-js/guess) is a collection of libraries \u0026 tools for enabling data-driven user-experience on the web.**\n\n**[Nuxt.js](https://github.com/nuxt/nuxt.js) is a Vue.js Meta Framework to create complex, fast \u0026 universal web applications quickly.**\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://guess-nuxt.now.sh/\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/daliborgogic/guess-nuxt/master/assets/demo.gif\"\u003e\u003cbr\u003e\n    DEMO\n  \u003c/a\u003e\n\u003c/p\u003e\n\nIn this particular example, we combine Guess.js with Nuxt.js to introduce predictive prefetching of JavaScript bundles. Based on user navigation patterns collected from Google Analytics or other source, Guess.js builds a machine-learning model to predict and prefetch JavaScript that will be required in each subsequent page.\n\nBased on early benchmarks, this can improve the perceived page load performance with 20%.\n\nFor more information on Guess.js, take a look at the following links:\n* [Google I/O announcement](https://www.youtube.com/watch?time_continue=2093\u0026v=Mv-l3-tJgGk) by Addy Osmani\n* [Introducing Guess.js - a toolkit for enabling data-driven user-experiences on the Web](https://blog.mgechev.com/2018/05/09/introducing-guess-js-data-driven-user-experiences-web/)\n* [Using Guess.js with static sites](https://github.com/guess-js/guess/tree/master/experiments/guess-static-sites)\n* [Using Guess.js with Angular, React, and Gatsby](https://github.com/guess-js/guess/tree/master/packages/guess-webpack)\n\n### Usage\n\n```bash\n$ git clone git@github.com:daliborgogic/guess-nuxt \u0026\u0026 \\\ncd guess-nuxt \u0026\u0026 \\\nnpm i\n\n$ mv .env.example .env\n# Update GA in .env\n\n# Dev\n$ npm run dev\n\n# Build\n$ npm run build\n\n# Start\n$ npm start\n```\n\n### Integration\n\nGuess.js (**0.1.5 and above**) works with Nuxt.js with only two points of integration. All you need to do is add the `GuessPlugin` to `nuxt.config.js` and introduce a snippet for prefetching the pages which are likely to be visited Nuxt.\n\nThe following sections describe both points in details.\n\n### Webpack Config\n\nAll you need is to extend the webpack config of your Nuxt.js application is to add the `GuessPlugin` to `nuxt.config.js` file, located in the root of your project. If the file does not exist, create it and add the following content:\n\n```javascript\nconst { GuessPlugin } = require('guess-webpack')\nconst { GA } = process.env\n\nmodule.exports = {\n  build: {\n    extend(config, ctx) {\n      if (ctx.isClient) {\n        config.plugins.push(\n          new GuessPlugin({\n          GA,\n          runtime: {\n            delegate: true\n          },\n          routeProvider: false\n        })\n      )\n    }\n  }\n}\n```\n\nThe routes that `guess()` returns depend on the Google Analytics report that it has extracted, together with the user's effective connection type.\n\n### Credits\n\nBased on [guess-next](https://github.com/mgechev/guess-next) by Minko Gechev [mgechev](https://github.com/mgechev) and Sébastien Chopin [Atinux](https://github.com/Atinux) for pull request [#1](https://github.com/daliborgogic/guess-nuxt/pull/1).\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaliborgogic%2Fguess-nuxt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaliborgogic%2Fguess-nuxt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaliborgogic%2Fguess-nuxt/lists"}