René's URL Explorer Experiment


Title: PureScript 与 React · Issue #3 · lambda-forum/lambda-forum.github.io · GitHub

Open Graph Title: PureScript 与 React · Issue #3 · lambda-forum/lambda-forum.github.io

X Title: PureScript 与 React · Issue #3 · lambda-forum/lambda-forum.github.io

Description: 1. React with PureScript Clone create-react-app-purescript. Run npm install or yarn install. Step by step instructions: Create react application with TypeScript. npx create-react-app create-react-app-purescript --template typescript Foll...

Open Graph Description: 1. React with PureScript Clone create-react-app-purescript. Run npm install or yarn install. Step by step instructions: Create react application with TypeScript. npx create-react-app create-react-a...

X Description: 1. React with PureScript Clone create-react-app-purescript. Run npm install or yarn install. Step by step instructions: Create react application with TypeScript. npx create-react-app create-react-a...

Opengraph URL: https://github.com/lambda-forum/lambda-forum.github.io/issues/3

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PureScript 与 React","articleBody":"## 1. React with PureScript\r\n\r\n- Clone [create-react-app-purescript](https://github.com/andys8/create-react-app-purescript). Run `npm install` or `yarn install`.\r\n- Step by step instructions: \r\n  - Create react application with TypeScript.\r\n  \r\n  ```shell\r\n  npx create-react-app create-react-app-purescript --template typescript\r\n  ```\r\n\r\n  - Follow [the craco guide](https://github.com/gsoft-inc/craco/blob/master/packages/craco/README.md#installation) to overwrite parts of the `create-react-app` configuration.\r\n  - Extend craco configuration to use [`craco-purescript-loader`](https://github.com/andys8/craco-purescript-loader).\r\n  - Install PureScript (compiler) and initialize spago (package manager).\r\n  \r\n  ```shell\r\n  npm install purescript spago --save-dev\r\n  npx spago init\r\n  ```\r\n\r\n  - Add npm script in `package.json` and install dependencies with `npm install`\r\n  \r\n  ```json\r\n  {\r\n    \"postinstall\": \"spago build --deps-only\"\r\n  }\r\n  ```\r\n\r\n  - Install [`react-basic`](https://github.com/lumihq/purescript-react-basic) and [`react-basic-hooks`](https://github.com/spicydonuts/purescript-react-basic-hooks).\r\n  \r\n  ```shell\r\n  npx spago install react-basic react-basic-dom react-basic-hooks\r\n  ```\r\n\r\n  - Add a PureScript component: `Counter.ps`.\r\n  \r\n  ```haskell\r\n  module Counter where\r\n\r\n  import Prelude\r\n  import Effect (Effect)\r\n  import Effect.Unsafe (unsafePerformEffect)\r\n  import React.Basic.DOM as R\r\n  import React.Basic.Events (handler_)\r\n  import React.Basic.Hooks\r\n  import React.Basic.Hooks as React\r\n\r\n  mkCounter :: ReactComponent {}\r\n  mkCounter = unsafePerformEffect counter\r\n\r\n  counter :: Effect (ReactComponent {})\r\n  counter = do\r\n    reactComponent \"Counter\" \\_ -\u003e React.do\r\n      count /\\ setCount \u003c- useState 0\r\n      let\r\n        handleClick = handler_ \u003c\u003c\u003c setCount\r\n      pure\r\n        $ R.div_\r\n            [ R.button { \r\n              onClick: handleClick (_ - 1), \r\n              children: [ R.text \"-\" ] }\r\n            , R.div_ [ R.text (show count) ]\r\n            , R.button { onClick: handleClick (_ + 1), \r\n            children: [ R.text \"+\" ] }\r\n            ]\r\n  ```\r\n\r\n  - Allow module import in TS: `purescript-module.d.ts`.\r\n  - Import the component and use it: `App.tsx`.\r\n\r\n  ```tsx\r\n  import { mkCounter as Counter } from \"./Counter.purs\";\r\n  // ...\r\n  function App() {\r\n    return \u003cCounter /\u003e;\r\n  }\r\n  ```\r\n- [`purescript-tsd-gen`](https://github.com/minoki/purescript-tsd-gen): TypeScript Declaration File (.d.ts) generator for PureScript. It helps to use PureScript modules from TypeScript. However it does not support higher-kinded types currently because emulating HKT in TypeScript is a little bit complicated. But maybe we can have a look at the implementation of [`fp-ts`](https://github.com/gcanti/fp-ts).\r\n- Some examples:\r\n  - [`purescript-react-realworld`](https://github.com/jonasbuntinx/purescript-react-realworld): A real world implementation of Conduit.\r\n  - [`gatsby-purescript-example`](https://github.com/jonasbuntinx/gatsby-purescript-example): Simple example app using Gatsby.js with PureScript.\r\n  - [`next-purescript-example`](https://github.com/jonasbuntinx/next-purescript-example):  Simple example app using Next.js with PureScript.\r\n \r\n## 2. React Native with PureScript\r\n\r\n- `create-react-native-app purescript-app`\r\n- `pulp init --force`\r\n- `pulp build` \r\n- `src/Main.js`\r\n```javascript\r\nvar React = require(\"react\");\r\nvar RN = require(\"react-native\");\r\n\r\nexports.text = function(props){\r\n  return function(str){\r\n    return React.createElement(RN.Text, props, str); \r\n  };\r\n};\r\n```\r\n- `src/Main.purs`\r\n\r\n```haskell\r\nmodule Main where\r\n\r\nforeign import data ReactElement :: Type\r\n\r\nforeign import text :: forall props. props -\u003e String -\u003e ReactElement\r\n\r\nmain :: ReactElement\r\nmain = text { \r\n  style : { \r\n    color : \"green\", \r\n    fontSize : 50 \r\n    } \r\n  } \"Hello from PureScript!\" \r\n```\r\n\r\n- `./App.js`\r\n\r\n```javascript\r\nimport React from 'react';\r\nimport Main from \"./output/Main\";\r\n\r\nexport default class App extends React.Component {\r\n  render() {\r\n    return Main.main;\r\n  }\r\n}\r\n```\r\n- `pulp build`\r\n- `yarn start` (npm may also work)\r\n","author":{"url":"https://github.com/lambda-forum","@type":"Person","name":"lambda-forum"},"datePublished":"2021-05-08T12:10:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/3/lambda-forum.github.io/issues/3"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:79b45c69-1301-7f7a-8ba6-af13654acf0c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id817A:985FF:B5A6B:E2E13:6991D6B3
html-safe-nonced6dc153a7940cf866cedb47f829060c1d60987b4edff9d614aeb6b690c078eef
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTdBOjk4NUZGOkI1QTZCOkUyRTEzOjY5OTFENkIzIiwidmlzaXRvcl9pZCI6IjY0MTEzMDA3MTE5MDk0MTQ1NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2fe355695895f1aac84847a761b0d78fbced76684782f2e292f77497c274bcab
hovercard-subject-tagissue:880740209
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lambda-forum/lambda-forum.github.io/3/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d17a91557fef20ee34018e7c549afc310948d009267d83fb9ac966736a72b813/lambda-forum/lambda-forum.github.io/issues/3
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d17a91557fef20ee34018e7c549afc310948d009267d83fb9ac966736a72b813/lambda-forum/lambda-forum.github.io/issues/3
og:image:alt1. React with PureScript Clone create-react-app-purescript. Run npm install or yarn install. Step by step instructions: Create react application with TypeScript. npx create-react-app create-react-a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelambda-forum
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/lambda-forum/lambda-forum.github.io git https://github.com/lambda-forum/lambda-forum.github.io.git
octolytics-dimension-user_id83862771
octolytics-dimension-user_loginlambda-forum
octolytics-dimension-repository_id365469812
octolytics-dimension-repository_nwolambda-forum/lambda-forum.github.io
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id365469812
octolytics-dimension-repository_network_root_nwolambda-forum/lambda-forum.github.io
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release848bc6032dcc93a9a7301dcc3f379a72ba13b96e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues/3#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Flambda-forum%2Flambda-forum.github.io%2Fissues%2F3
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Flambda-forum%2Flambda-forum.github.io%2Fissues%2F3
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=lambda-forum%2Flambda-forum.github.io
Reloadhttps://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues/3
Reloadhttps://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues/3
Reloadhttps://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues/3
lambda-forum https://patch-diff.githubusercontent.com/lambda-forum
lambda-forum.github.iohttps://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Flambda-forum%2Flambda-forum.github.io
Fork 0 https://patch-diff.githubusercontent.com/login?return_to=%2Flambda-forum%2Flambda-forum.github.io
Star 0 https://patch-diff.githubusercontent.com/login?return_to=%2Flambda-forum%2Flambda-forum.github.io
Code https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io
Issues 2 https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues
Pull requests 0 https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/pulls
Actions https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/actions
Projects 0 https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/projects
Security 0 https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/security
Insights https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/pulse
Code https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io
Issues https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues
Pull requests https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/pulls
Actions https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/actions
Projects https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/projects
Security https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/security
Insights https://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/lambda-forum/lambda-forum.github.io/issues/3
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/lambda-forum/lambda-forum.github.io/issues/3
PureScript 与 Reacthttps://patch-diff.githubusercontent.com/lambda-forum/lambda-forum.github.io/issues/3#top
haskellhttps://github.com/lambda-forum/lambda-forum.github.io/issues?q=state%3Aopen%20label%3A%22haskell%22
https://github.com/lambda-forum
https://github.com/lambda-forum
lambda-forumhttps://github.com/lambda-forum
on May 8, 2021https://github.com/lambda-forum/lambda-forum.github.io/issues/3#issue-880740209
create-react-app-purescripthttps://github.com/andys8/create-react-app-purescript
the craco guidehttps://github.com/gsoft-inc/craco/blob/master/packages/craco/README.md#installation
craco-purescript-loaderhttps://github.com/andys8/craco-purescript-loader
react-basichttps://github.com/lumihq/purescript-react-basic
react-basic-hookshttps://github.com/spicydonuts/purescript-react-basic-hooks
purescript-tsd-genhttps://github.com/minoki/purescript-tsd-gen
fp-tshttps://github.com/gcanti/fp-ts
purescript-react-realworldhttps://github.com/jonasbuntinx/purescript-react-realworld
gatsby-purescript-examplehttps://github.com/jonasbuntinx/gatsby-purescript-example
next-purescript-examplehttps://github.com/jonasbuntinx/next-purescript-example
haskellhttps://github.com/lambda-forum/lambda-forum.github.io/issues?q=state%3Aopen%20label%3A%22haskell%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.