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

feat(*): add turbo watch mode #1201

Merged
merged 44 commits into from
Aug 13, 2024
Merged

feat(*): add turbo watch mode #1201

merged 44 commits into from
Aug 13, 2024

Conversation

SEOKKAMONI
Copy link
Collaborator

@SEOKKAMONI SEOKKAMONI commented Aug 7, 2024

Overview

close #1098

  • add turbo watch mode
    • turbo watch mode continuously monitors for real-time code changes and automatically re-runs the task when modifications are detected.

docs: https://turbo.build/repo/docs/reference/watch

PR Checklist

  • I did below actions if need
  1. I read the Contributing Guide
  2. I added documents and tests.

@SEOKKAMONI SEOKKAMONI self-assigned this Aug 7, 2024
Copy link

changeset-bot bot commented Aug 7, 2024

⚠️ No Changeset found

Latest commit: 60bc044

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 2:58pm
v1.suspensive.org 🛑 Canceled (Inspect) Aug 13, 2024 2:58pm
visualization.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 2:58pm

Copy link

github-actions bot commented Aug 7, 2024

Size Change: 0 B

Total Size: 92.9 kB

ℹ️ View Unchanged
Filename Size
packages/cache/dist/Cache.cjs 990 B
packages/cache/dist/Cache.js 158 B
packages/cache/dist/cacheOptions.cjs 539 B
packages/cache/dist/cacheOptions.js 136 B
packages/cache/dist/CacheStore.cjs 1.76 kB
packages/cache/dist/CacheStore.js 134 B
packages/cache/dist/CacheStoreProvider.cjs 660 B
packages/cache/dist/CacheStoreProvider.js 151 B
packages/cache/dist/chunk-6K4XRKNT.js 258 B
packages/cache/dist/chunk-6WOCZ3NQ.js 293 B
packages/cache/dist/chunk-FFFIOY4B.js 258 B
packages/cache/dist/chunk-J4LYH5KM.js 164 B
packages/cache/dist/chunk-JVEIDWQ2.js 249 B
packages/cache/dist/chunk-QETBZSG5.js 521 B
packages/cache/dist/chunk-RN456Z2W.js 145 B
packages/cache/dist/chunk-XLGSBSED.js 1.26 kB
packages/cache/dist/index.cjs 2.27 kB
packages/cache/dist/index.js 240 B
packages/cache/dist/types.cjs 416 B
packages/cache/dist/types.js 66 B
packages/cache/dist/useCache.cjs 739 B
packages/cache/dist/useCache.js 152 B
packages/cache/dist/useCacheStore.cjs 659 B
packages/cache/dist/useCacheStore.js 147 B
packages/jotai/dist/Atom.cjs 660 B
packages/jotai/dist/Atom.js 115 B
packages/jotai/dist/AtomValue.cjs 647 B
packages/jotai/dist/AtomValue.js 120 B
packages/jotai/dist/chunk-PEEO4NPV.js 242 B
packages/jotai/dist/chunk-W2DXKJF6.js 264 B
packages/jotai/dist/chunk-XUG7NR54.js 242 B
packages/jotai/dist/index.cjs 755 B
packages/jotai/dist/index.js 158 B
packages/jotai/dist/SetAtom.cjs 645 B
packages/jotai/dist/SetAtom.js 118 B
packages/react-dom/dist/chunk-YJUMTHWY.js 189 B
packages/react-dom/dist/index.cjs 602 B
packages/react-dom/dist/index.js 122 B
packages/react-dom/dist/TestText.cjs 596 B
packages/react-dom/dist/TestText.js 119 B
packages/react-image/dist/chunk-VVVCPJZH.js 1.11 kB
packages/react-image/dist/chunk-WGTP75MY.js 405 B
packages/react-image/dist/index.cjs 1.54 kB
packages/react-image/dist/index.js 140 B
packages/react-image/dist/Load.cjs 1.32 kB
packages/react-image/dist/Load.js 126 B
packages/react-image/dist/SuspenseImage.cjs 1.53 kB
packages/react-image/dist/SuspenseImage.js 137 B
packages/react-native/dist/chunk-45D2JR5L.js 205 B
packages/react-native/dist/index.cjs 619 B
packages/react-native/dist/index.js 122 B
packages/react-native/dist/TestText.cjs 612 B
packages/react-native/dist/TestText.js 119 B
packages/react-query-4/dist/chunk-2H47PXAH.js 145 B
packages/react-query-4/dist/chunk-4AU4A5TK.js 312 B
packages/react-query-4/dist/chunk-7LC5EH5R.js 308 B
packages/react-query-4/dist/chunk-HJAGY6R3.js 254 B
packages/react-query-4/dist/chunk-JMZC2U4M.js 306 B
packages/react-query-4/dist/chunk-NKKRZH3C.js 269 B
packages/react-query-4/dist/chunk-P5MROV72.js 470 B
packages/react-query-4/dist/chunk-QETBZSG5.js 521 B
packages/react-query-4/dist/chunk-S7L2LUVS.js 277 B
packages/react-query-4/dist/chunk-V5RSZNGB.js 152 B
packages/react-query-4/dist/chunk-W3SOIIM5.js 273 B
packages/react-query-4/dist/index.cjs 1.61 kB
packages/react-query-4/dist/index.js 313 B
packages/react-query-4/dist/infiniteQueryOptions.cjs 548 B
packages/react-query-4/dist/infiniteQueryOptions.js 144 B
packages/react-query-4/dist/Mutation.cjs 821 B
packages/react-query-4/dist/Mutation.js 132 B
packages/react-query-4/dist/QueryErrorBoundary.cjs 1.12 kB
packages/react-query-4/dist/QueryErrorBoundary.js 142 B
packages/react-query-4/dist/queryOptions.cjs 540 B
packages/react-query-4/dist/queryOptions.js 136 B
packages/react-query-4/dist/SuspenseInfiniteQuery.cjs 1.05 kB
packages/react-query-4/dist/SuspenseInfiniteQuery.js 154 B
packages/react-query-4/dist/SuspenseQueries.cjs 923 B
packages/react-query-4/dist/SuspenseQueries.js 149 B
packages/react-query-4/dist/SuspenseQuery.cjs 1.04 kB
packages/react-query-4/dist/SuspenseQuery.js 147 B
packages/react-query-4/dist/useSuspenseInfiniteQuery.cjs 833 B
packages/react-query-4/dist/useSuspenseInfiniteQuery.js 147 B
packages/react-query-4/dist/useSuspenseQueries.cjs 833 B
packages/react-query-4/dist/useSuspenseQueries.js 142 B
packages/react-query-4/dist/useSuspenseQuery.cjs 824 B
packages/react-query-4/dist/useSuspenseQuery.js 140 B
packages/react-query-5/dist/chunk-4MX6YXXC.js 471 B
packages/react-query-5/dist/chunk-FKG24WFN.js 170 B
packages/react-query-5/dist/chunk-G4UWQXSU.js 310 B
packages/react-query-5/dist/chunk-GXSI7FXZ.js 306 B
packages/react-query-5/dist/chunk-KI4RNNHO.js 173 B
packages/react-query-5/dist/chunk-LHMCCR64.js 262 B
packages/react-query-5/dist/chunk-LQDNL5GK.js 172 B
packages/react-query-5/dist/chunk-QETBZSG5.js 521 B
packages/react-query-5/dist/chunk-RX5QN4OH.js 167 B
packages/react-query-5/dist/chunk-XFQQRL67.js 319 B
packages/react-query-5/dist/chunk-XRWCGESR.js 168 B
packages/react-query-5/dist/index.cjs 1.56 kB
packages/react-query-5/dist/index.js 309 B
packages/react-query-5/dist/infiniteQueryOptions.cjs 573 B
packages/react-query-5/dist/infiniteQueryOptions.js 144 B
packages/react-query-5/dist/Mutation.cjs 821 B
packages/react-query-5/dist/Mutation.js 132 B
packages/react-query-5/dist/QueryErrorBoundary.cjs 1.12 kB
packages/react-query-5/dist/QueryErrorBoundary.js 142 B
packages/react-query-5/dist/queryOptions.cjs 563 B
packages/react-query-5/dist/queryOptions.js 136 B
packages/react-query-5/dist/SuspenseInfiniteQuery.cjs 833 B
packages/react-query-5/dist/SuspenseInfiniteQuery.js 145 B
packages/react-query-5/dist/SuspenseQueries.cjs 671 B
packages/react-query-5/dist/SuspenseQueries.js 139 B
packages/react-query-5/dist/SuspenseQuery.cjs 825 B
packages/react-query-5/dist/SuspenseQuery.js 137 B
packages/react-query-5/dist/useSuspenseInfiniteQuery.cjs 577 B
packages/react-query-5/dist/useSuspenseInfiniteQuery.js 148 B
packages/react-query-5/dist/useSuspenseQueries.cjs 571 B
packages/react-query-5/dist/useSuspenseQueries.js 142 B
packages/react-query-5/dist/useSuspenseQuery.cjs 569 B
packages/react-query-5/dist/useSuspenseQuery.js 140 B
packages/react-query/dist/index.cjs 551 B
packages/react-query/dist/index.js 121 B
packages/react-query/dist/v4.cjs 550 B
packages/react-query/dist/v4.js 116 B
packages/react-query/dist/v5.cjs 550 B
packages/react-query/dist/v5.js 116 B
packages/react/dist/chunk-3JGKMCLB.js 415 B
packages/react/dist/chunk-6NAWCGK4.js 596 B
packages/react/dist/chunk-6QHNBDVP.js 1.57 kB
packages/react/dist/chunk-CB36VYEF.js 348 B
packages/react/dist/chunk-HVDFXOFP.js 414 B
packages/react/dist/chunk-INLOGI26.js 282 B
packages/react/dist/chunk-KBH2PMLJ.js 578 B
packages/react/dist/chunk-NDHQ7FSM.js 821 B
packages/react/dist/chunk-NF2UFYHD.js 433 B
packages/react/dist/chunk-TTRGFZ2C.js 136 B
packages/react/dist/chunk-VPAB2GWT.js 247 B
packages/react/dist/chunk-WQJTGHBN.js 517 B
packages/react/dist/chunk-YBVPLMLQ.js 665 B
packages/react/dist/chunk-YZFC5ZRA.js 449 B
packages/react/dist/ClientOnly.cjs 736 B
packages/react/dist/ClientOnly.js 141 B
packages/react/dist/DefaultProps.cjs 1.05 kB
packages/react/dist/DefaultProps.js 167 B
packages/react/dist/Delay.cjs 1.11 kB
packages/react/dist/Delay.js 149 B
packages/react/dist/DevMode.cjs 530 B
packages/react/dist/DevMode.js 131 B
packages/react/dist/ErrorBoundary.cjs 2.67 kB
packages/react/dist/ErrorBoundary.js 208 B
packages/react/dist/ErrorBoundaryGroup.cjs 1.36 kB
packages/react/dist/ErrorBoundaryGroup.js 180 B
packages/react/dist/index.cjs 4.12 kB
packages/react/dist/index.js 368 B
packages/react/dist/Suspense.cjs 1.3 kB
packages/react/dist/Suspense.js 172 B
packages/react/dist/Suspensive.cjs 1.26 kB
packages/react/dist/Suspensive.js 175 B
packages/react/dist/wrap.cjs 3.6 kB
packages/react/dist/wrap.js 210 B
packages/utils/dist/chunk-5XT623M4.js 263 B
packages/utils/dist/chunk-FWXVSCJA.js 125 B
packages/utils/dist/chunk-OSQ3QLKJ.js 276 B
packages/utils/dist/chunk-PKN4LMAV.js 137 B
packages/utils/dist/chunk-TUVDYELP.js 191 B
packages/utils/dist/ConstructorType.cjs 424 B
packages/utils/dist/ConstructorType.js 76 B
packages/utils/dist/increase.cjs 533 B
packages/utils/dist/increase.js 119 B
packages/utils/dist/index.cjs 1.58 kB
packages/utils/dist/index.js 926 B
packages/utils/dist/noop.cjs 522 B
packages/utils/dist/noop.js 115 B
packages/utils/dist/Nullable.cjs 419 B
packages/utils/dist/Nullable.js 69 B
packages/utils/dist/OmitKeyof.cjs 420 B
packages/utils/dist/OmitKeyof.js 70 B
packages/utils/dist/RequiredKeyof.cjs 425 B
packages/utils/dist/RequiredKeyof.js 74 B
packages/utils/dist/useIsomorphicLayoutEffect.cjs 588 B
packages/utils/dist/useIsomorphicLayoutEffect.js 136 B
packages/utils/dist/usePreservedCallback.cjs 697 B
packages/utils/dist/usePreservedCallback.js 144 B
packages/utils/dist/useTimeout.cjs 769 B
packages/utils/dist/useTimeout.js 144 B

compressed-size-action

Copy link

codspeed-hq bot commented Aug 7, 2024

CodSpeed Performance Report

Merging #1201 will create unknown performance changes

Comparing turbo/watch (60bc044) with main (45401c5)

Summary

⚠️ No benchmarks were detected in both the base of the PR and the PR.

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.96%. Comparing base (45401c5) to head (60bc044).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1201   +/-   ##
=======================================
  Coverage   77.96%   77.96%           
=======================================
  Files          65       65           
  Lines         599      599           
  Branches      123      123           
=======================================
  Hits          467      467           
  Misses        123      123           
  Partials        9        9           
Components Coverage Δ
@suspensive/utils 47.16% <ø> (ø)
@suspensive/react 100.00% <ø> (ø)
@suspensive/react-dom 100.00% <ø> (ø)
@suspensive/react-native 100.00% <ø> (ø)
@suspensive/react-query 72.09% <ø> (ø)
@suspensive/react-query-4 0.00% <ø> (ø)
@suspensive/react-query-5 0.00% <ø> (ø)
@suspensive/jotai 0.00% <ø> (ø)
@suspensive/cache 98.16% <ø> (ø)
@suspensive/react-image 80.39% <ø> (ø)

package.json Outdated
"ci:sherif": "sherif --ignore-package \"./examples/*\" --ignore-package \"./websites/*\" --ignore-package \"./docs/*\" --ignore-dependency \"@tanstack/react-query\" ",
"ci:test": "turbo run ci:test",
"ci:test:watch": "turbo run ci:test:watch --parallel",
"ci:test:watch": "turbo watch ci:test",
"ci:test:watch:ui": "turbo run ci:test:watch:ui --parallel",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I named it ci:test:watch:ui because, unlike ci:test:watch which operates in turbo watch mode, this version has a more intuitive UI in the browser.

@SEOKKAMONI SEOKKAMONI marked this pull request as ready for review August 7, 2024 13:15
@SEOKKAMONI SEOKKAMONI marked this pull request as draft August 7, 2024 13:21
Copy link
Member

@manudeli manudeli left a comment

Choose a reason for hiding this comment

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

How about this? double build will be gone (because of dev depend on prepack)

package.json Outdated
Comment on lines 34 to 35
"dev": "concurrently \"pnpm dev:build\" \"pnpm dev:test\"",
"dev:build": "turbo watch build --filter=./packages/**",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"dev": "concurrently \"pnpm dev:build\" \"pnpm dev:test\"",
"dev:build": "turbo watch build --filter=./packages/**",
"dev": "concurrently \"pnpm dev:prepack\" \"pnpm dev:test\"",
"dev:prepack": "turbo watch prepack",

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's such a great idea I didn't expect a double build, but thanks!

Copy link
Member

@manudeli manudeli left a comment

Choose a reason for hiding this comment

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

When I use dev:test, I realize that we don't need dev:prepack too

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@SEOKKAMONI
Copy link
Collaborator Author

@manudeli The reason we use watch in prepack is to ensure that various aspects like build and eslint are properly checked during development. However, if we remove this, it will only perform a one-time check initially. Is this the direction we intended?

Copy link
Member

@manudeli manudeli left a comment

Choose a reason for hiding this comment

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

So cool 👍👍👍 Thanks for your digging this together
Let's run just pnpm dev in root when we developing

cc. @gwansikk @kangju2000 @bigsaigon333 @SEOKKAMONI

@manudeli manudeli merged commit fcbb06f into main Aug 13, 2024
18 checks passed
@manudeli manudeli deleted the turbo/watch branch August 13, 2024 15:05
@SEOKKAMONI
Copy link
Collaborator Author

@manudeli The reason we use watch in prepack is to ensure that various aspects like build and eslint are properly checked during development. However, if we remove this, it will only perform a one-time check initially. Is this the direction we intended?

I had a misunderstanding. Since prepack is included in dependsOn for ci:test, when running in the development environment, modifying and saving code will cause the process to rerun from prepack through ci:test. This is why dev:prepack became unnecessary.

2-NOW pushed a commit to 2-NOW/suspensive that referenced this pull request Aug 16, 2024
# Overview
close toss#1098

- add turbo watch mode
- turbo watch mode continuously monitors for real-time code changes and
automatically re-runs the task when modifications are detected.
   
docs: https://turbo.build/repo/docs/reference/watch

<!--
    A clear and concise description of what this pr is about.
 -->

## PR Checklist

- [x] I did below actions if need

1. I read the [Contributing
Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md)
2. I added documents and tests.

---------

Co-authored-by: Jonghyeon Ko <jonghyeon@toss.im>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment