Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace custom build scripts w/ Preconstruct #732

Merged
merged 4 commits into from
Feb 21, 2021
Merged

Replace custom build scripts w/ Preconstruct #732

merged 4 commits into from
Feb 21, 2021

Conversation

chaance
Copy link
Member

@chaance chaance commented Jan 26, 2021

This PR replaces the current build scripts, which were forked and simplified based on tsdx, with Preconstruct. The tradeoffs of this change as I see it are:

Pros:

  • Significantly faster build -- the entire repo builds in less than 20s now
  • Similar build output -- we use almost exactly the same babel transforms as before, and preconstruct builds with rollup under the hood
  • Less complexity to manage internally
  • Some DX niceties to automate some tasks when creating new packages
  • No more need for custom TS path aliases for each package (links for the dev env are created by preconstruct dev
  • Preconstruct's source is familiar since it builds on top of rollup, so if we need to patch or fork for any reason it shouldn't be that scary

Cons:

  • No more granular control over the build unless we want to fork the project
  • Ummm...I think that's it?
  • Really, pretty sure that's it
  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code (Compile and run).
  • Add or edit tests to reflect the change (Run with yarn test).
  • Add or edit Storybook examples to reflect the change (Run with yarn start).
  • Ensure formatting is consistent with the project's Prettier configuration.
  • Add documentation to support any new features.

This pull request:

  • Creates a new package
  • Fixes a bug in an existing package
  • Adds additional features/functionality to an existing package
  • Updates documentation or example code
  • Other

@chaance chaance added the Type: Housekeeping General housekeeping label Jan 26, 2021
@chaance
Copy link
Member Author

chaance commented Jan 26, 2021

@Andarist this change is inspired by your mentioning of this project at one point, so if you have any thoughts or suggestions for effectively working within Preconstruct's constraints I'd be glad to hear them. I've already found myself itching for a few things here that I can no longer access, but I'm trying to convince myself it isn't worth it 😛

@Andarist
Copy link
Contributor

I like how you have summed up the cons :trollface: If you ever find a need to fork - let's discuss it first :)

babel.config.js Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
"tslib": "^2.0.0"
},
"peerDependencies": {
"react": "^16.8.0 || 17.x",
"react-dom": "^16.8.0 || 17.x"
},
"main": "dist/index.js",
"module": "dist/accordion.esm.js",
"typings": "dist/index.d.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe you would be willing to help with this issue: preconstruct/preconstruct#259 ? :>

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 26, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 4680d49:

Sandbox Source
reach-ui-template Configuration

Copy link
Contributor

@Andarist Andarist left a comment

Choose a reason for hiding this comment

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

Excellent! Spread that Preconstruct love ❤️

@chaance chaance merged commit 3d1c2d7 into develop Feb 21, 2021
felixmosh pushed a commit to felixmosh/reach-ui that referenced this pull request Feb 28, 2021
@chaance chaance deleted the preconstruct branch June 28, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Housekeeping General housekeeping
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants