{"id":19752205,"url":"https://github.com/ipatch/chrisrjones_client","last_synced_at":"2025-02-28T01:19:13.198Z","repository":{"id":44148313,"uuid":"180619698","full_name":"ipatch/chrisrjones_client","owner":"ipatch","description":"A client side app for accessing the chrisrjones_rails API","archived":false,"fork":false,"pushed_at":"2022-12-10T17:11:16.000Z","size":3512,"stargazers_count":0,"open_issues_count":22,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T21:44:23.009Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipatch.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-04-10T16:18:26.000Z","updated_at":"2020-01-07T17:13:38.000Z","dependencies_parsed_at":"2023-01-26T05:30:37.509Z","dependency_job_id":null,"html_url":"https://github.com/ipatch/chrisrjones_client","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/ipatch%2Fchrisrjones_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipatch%2Fchrisrjones_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipatch%2Fchrisrjones_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipatch%2Fchrisrjones_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipatch","download_url":"https://codeload.github.com/ipatch/chrisrjones_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241084209,"owners_count":19907071,"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-11-12T02:48:23.999Z","updated_at":"2025-02-28T01:19:13.180Z","avatar_url":"https://github.com/ipatch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## chrisrjones_client\n\n\u003cem\u003eA React based project\u003c/em\u003e\n\n\u003ca id=\"contents\"\u003e\u003c/a\u003e\n\n## Contents\n\n- [Working with CORS](#working-with-cors)\n- [Updates](#updates)\n- [TODOs](#todos)\n\n\u003ca id=\"working-with-cors\"\u003e\u003c/a\u003e\n\n## Working with CORS\n\n\u003cstrong\u003ewebpack-dev-server\u003c/strong\u003e can be configured to work with CORS, ie. a react based app can send an AJAX request using vanilla JS, or even using a promise based library such **axios** to make an AJAX request. I setup a very primitive AJAX request to experiment with CORS in dev.  Working with CORS is still a total PITA but can be used to get things work.  See changes made to the **webpack.config.dev.js** for settings related to CORS and webpack configuration.  An honorable mention, make certain to disable credentials when making a AJAX request with **axios** in local development.\n\nIf an API is setup properly to handle CORS requests, ie. the rails API I've setup and the **webpack dev server** properly then the last piece of the jig saw puzzle is make sure the web browser is setup properly.\n\n#### Working with CORS \u003e web browser\n\nThe **webpack-dev-server** configured in this app should work out of the box with Firefox on macOS without any browser extensions.  However using a browser such Vivaldi requires a [browser extension](https://github.com/vitvad/Access-Control-Allow-Origin) to work with the CORS requests and responses.\n\n##### Working with CORS \u003e web browsers \u003e Firefox\n\nFirefox should not have a problem accessing,\n\n```conf\nhttp://localhost:4000\n```\n\n##### Working with CORS \u003e web browser \u003e Chromium based browsers\n\nWhen accessing the client side app, avoid using the below web address / URL\n\n```conf\nhttp://localhost:4000\n```\n\n...instead use the below URLs when accessing the client app in **dev**.\n\n```conf\nhttp://[LOCAL.IP.ADDRESS]:[PORT]\nhttp://10.0.1.8:4000\n```\n\n\u003ca id=\"updates\"\u003e\u003c/a\u003e\n\n## Updates\n\n- **@babel/polyfill** has been deprecated in favor of setting a **corejs** value within the **.babelrc**\n\n- add **axios** pkg to make AJAX calls to rails API\n\n- added [**webapp-webpack-plugin**](https://www.npmjs.com/package/webapp-webpack-plugin) to generate favicons for various systems and platforms. Copied the svg that is part of **create-react-app** to be the favicon for this project.\n\n- added **prettier** to project via NPM to make all **.js** files conform to a single Javascript code formatting standard.\n\nTo run **prettier** from a CLI\n\n```shell\nnpx prettier --write \"src/**/*.js\"\n```\n\n- **webpack-dev-server** will default to port **8080**, and if that port is not available it will increment until it finds an available port to bind to.\n\n```conf\nhttp://localhost:8080\n```\n\n- Added support for CSS source maps using [extract-css-chunks-webpack-plugin](https://github.com/faceyspacey/extract-css-chunks-webpack-plugin)\n\n\u003ca id=\"hooks\"\u003e\u003c/a\u003e\n\n### Hooks\n\n**hooks** have been integrated into react as of version 16.8\n\n\n\u003cdetails\u003e\n\u003csummary\u003ePrimary NPM modules used with boilerplate\u003c/summary\u003e\n\n- react v16.8\n- react-dom v16.8\n- eslint\n- webpack 4.x\n  - css-loader\n  - html-webpack-plugin\n  - style-loader\n- webpack-bundle-analyzer\n- webpack-dev-server\n- husky\n- babel v7\n- jest\n- react-hot-loader\n\n\u003c/details\u003e\n\n\u003ca id=\"todos\"\u003e\u003c/a\u003e\n\n## TODOs [🔝](#contents)\n\n- [x] ~~add support for working with various image formats.~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipatch%2Fchrisrjones_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipatch%2Fchrisrjones_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipatch%2Fchrisrjones_client/lists"}