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

Move the examples to a separate repo #3565

Closed
wants to merge 1 commit into from
Closed

Move the examples to a separate repo #3565

wants to merge 1 commit into from

Conversation

timdorr
Copy link
Member

@timdorr timdorr commented Sep 7, 2019

I'd like to move the examples out of the repo. They add a lot of time to the build process and generally don't change significantly. They also don't require the source copy of Redux, so it's not like they are a canary for changes we make on master.

Moving them to their own home means it's more reasonable to accept new additions, which is something we've been hesitant to do for a long while (years!).

I've set them up in a new repo: reduxjs/examples

Is this a terrible idea? Anything we should do besides updating the docs and creating a new README in the examples path (which is temporarily gone at the moment).

@timdorr
Copy link
Member Author

timdorr commented Sep 7, 2019

Also of note:

  • Typical build time today: 3:30-4:10
  • This PR build time: 1:10

That's a 3-3.5x faster build time.

@netlify
Copy link

netlify bot commented Sep 7, 2019

Deploy preview for redux-docs ready!

Built with commit 4cb4a5e

https://deploy-preview-3565--redux-docs.netlify.com

@markerikson
Copy link
Contributor

Thoughts and concerns:

  • The approach shown here and in the other repo appears to blow away all the accumulated Git history. Could we at least do some git filter-branch work to extract the examples folder history as the starting point of the new repo, so that we can maintain that history?
  • We have a bunch of links in the docs, and there's probably also external links:
    • Yeah, we'd need to do a bunch of fixing up for our docs.
    • External links would result in a 404. Can we at least leave placeholder README files that point to the new location?
  • What additional examples would you want to have in the future repo?

@markerikson
Copy link
Contributor

Out of curiosity, what about the examples is slowing down the build process?

@timdorr
Copy link
Member Author

timdorr commented Sep 9, 2019

There are so many of them and they all require separate npm ci commands.

@markerikson
Copy link
Contributor

But why are we even building / testing them at all as part of the main lib? Where are they getting kicked off?

@timdorr
Copy link
Member Author

timdorr commented Sep 9, 2019

@markerikson
Copy link
Contributor

Oh. Well, at a minimum, we should remove those lines from Travis. No reason to be checking those on every commit.

@timdorr
Copy link
Member Author

timdorr commented Sep 10, 2019

Redid the examples repo with history intact: https://github.com/reduxjs/examples

@markerikson
Copy link
Contributor

I'm still really not seeing a point to this. If we're concerned about Travis build times for some reason, let's just configure Travis to not worry about the examples on every build or something.

@nickmccurdy
Copy link
Contributor

nickmccurdy commented Oct 13, 2019

I tried to figure out how to conditionally build certain examples based on the changed files using Travis' environment variables, but unfortunately it seems difficult to do this consistently. For example TRAVIS_COMMIT_HASH doesn't only show the commits from the PR which would cause false positives where examples are build when they shouldn't be, and if multiple commits are pushed outside of a pull request TRAVIS_COMMIT would only show the latest commit which could cause examples to break without being rerun in CI.

Here are the alternatives I'm thinking of:

  • Remove the examples with this pull request, but replace the existing files with links to the new repository and move the example CI test scripts to the other repository
  • Keep things the way there are, but make a separate Travis job for the internal and example tests so they can run independently in parallel (GitHub Checks will still be delayed by both, but you could check Travis to see if the internal tests pass and ignore the example job)
  • Use a monorepo with yarn workspaces or lerna (hopefully this will make installs and tests fast enough that we wouldn't need to disable the example builds)

Also note that the docs rebuild on Netlify even when they aren't changed, but it's separate from the Travis build configuration.

@markerikson
Copy link
Contributor

We never did move these out, and tbh I'd like to keep them in here. Closing.

@markerikson markerikson closed this Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants