Skip to content

Improved DX for working on Relay as non-FB dev#2749

Closed
alloy wants to merge 7 commits intofacebook:masterfrom
alloy:improved-non-fb-dx
Closed

Improved DX for working on Relay as non-FB dev#2749
alloy wants to merge 7 commits intofacebook:masterfrom
alloy:improved-non-fb-dx

Conversation

@alloy
Copy link
Copy Markdown
Contributor

@alloy alloy commented Jun 3, 2019

  • Only clean build on install when publishing, not just any yarn install.
  • Add a yarn build:watch task which leaves the dist dir in tact, which makes yarn link work and allows for easy integration into the dev’s project.
  • Use incremental builds for yarn build and yarn build:watch.

@alloy
Copy link
Copy Markdown
Contributor Author

alloy commented Jun 3, 2019

The one thing I’m unsure about is the change to not always build on yarn install. Perhaps it works best when using JIT compilation in one’s test setup 🤔

Ok, I ended up reverting this somewhat. Now we do perform a build on yarn install, but it will be an incremental one instead.

"repository": "facebook/relay",
"scripts": {
"build": "gulp",
"build": "gulp dist",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will now perform incremental builds, so running yarn install after a git pull will be faster.

"jest": "NODE_ENV=test jest \"$@\"",
"lint": "eslint --max-warnings 0 .",
"prepublish": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && npm run build",
"postinstall": "npm run build",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This triggers the build after yarn install.

"lint": "eslint --max-warnings 0 .",
"prepublish": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && npm run build",
"postinstall": "npm run build",
"prepublishOnly": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && npm run build:clean",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only runs when actually invoking npm publish and will perform a clean before the build.

@alloy alloy changed the title Improved DX for non-FB devs Improved DX for working on Relay as non-FB dev Jun 4, 2019
@alloy alloy force-pushed the improved-non-fb-dx branch from ce46d03 to d84d535 Compare June 4, 2019 12:28
@alloy alloy force-pushed the improved-non-fb-dx branch from d84d535 to 1e5bac8 Compare June 5, 2019 11:01
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jstejada has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jstejada has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@jstejada merged this pull request in 62351b2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants