-
Notifications
You must be signed in to change notification settings - Fork 82
Add offline mode #2483
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
Add offline mode #2483
Conversation
Sorry for the delay on this @RossComputerGuy! Overall, this change looks good to me, but we should add some tests before landing. |
73346a6
to
e1105ac
Compare
I've gone ahead and rebased it. I will look into getting tests in shortly. |
Can't figure out how the test should be done, I see there's configuration tests but none invoke read. |
I think you can either add a test like this or something similar to what's done in this file. Basically, you'll just want a test that runs |
e1105ac
to
e2abbf1
Compare
Ok, I added the test. |
@@ -30,6 +30,14 @@ void main() { | |||
Process? serveProcess; | |||
Directory? tempDir0; | |||
|
|||
final testScript = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure what's going on with these lines. Could we not get the package directory simply by doing p.dirname(p.dirname(Platform.script.toFilePath())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That gives me /tmp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, because the test runner generates an entrypoint...
In that case, I think we should continue to activate webdev
from pub instead of using --source path
. This test should still work as long as we don't run dart pub get
on the created project before running webdev serve --offline
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, I was assuming we would do it the way I did so new updates would actually work. I was getting an error saying --offline
wasn't a recognized flag even if I did activate it outside the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, that's a great point. Given that, I think we should move the test to webdev/test/integration_test.dart
. The tests there run webdev
from source so we won't have to worry about publishing before this new test will pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbf, I could see how it could fit into both. Especially since once the next update is published and this PR is in that, then the flag would be available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got the test added to the integration set.
418f680
to
6fbec3a
Compare
Sorry for the delay on this @RossComputerGuy. Can you take this over the line @jyameo? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for your contribution! Apologies for the delay in getting this over the line. Overall looks good! We really appreciate your work on this!
6fbec3a
to
8d03205
Compare
@RossComputerGuy Can you please address the CI failures below and include an entry in |
8d03205
to
90b7878
Compare
I was able to address everything except the |
|
15dfec8
to
c8dae6f
Compare
You should be able to resolve the
Similar to what's being done in the |
Oh, I was looking at the wrong test. |
c8dae6f
to
6139573
Compare
Thanks for the update @RossComputerGuy. To finalize this PR, can you please address the following issue:
Also please pull and merge the latest version of the main branch before making the changes above. Once these are addressed, we should be good to go. |
6139573
to
c151099
Compare
Done all those now. |
Awesome. We just need to pull down and merge the latest version of the main branch and resolve the conflicts and we should be good |
c151099
to
de46747
Compare
Done |
Apologies @RossComputerGuy. I made a mistake... the version the |
de46747
to
9f9529b
Compare
Done |
Hey @RossComputerGuy, for some reason the |
Looks like it's caused by some white whitespace issues. the Readme needs to match exactly the output of the command |
9f9529b
to
02ab574
Compare
Thanks @RossComputerGuy for your contribution and patience in landing this. Your changes are in and will be part of the next release. |
Revisions updated by `dart tools/rev_sdk_deps.dart`. core (https://github.com/dart-lang/core/compare/61e6771..a6e81e0): a6e81e0b 2025-03-31 Lasse R.H. Nielsen Make URL strategy better at recognizing URLs. (dart-lang/core#873) 379e9c2e 2025-03-25 dependabot[bot] Bump dart-lang/setup-dart from 1.7.0 to 1.7.1 in the github-actions group (dart-lang/core#869) dartdoc (https://github.com/dart-lang/dartdoc/compare/d400676..cbc1885): cbc18857 2025-03-25 Sam Rawlins Improve the error message when an import cannot be resolved (dart-lang/dartdoc#4023) 18a7631d 2025-03-25 Parker Lougheed Place footer below main content (dart-lang/dartdoc#4014) f41bd3ab 2025-03-24 Sam Rawlins Improve failure when import cannot be found (dart-lang/dartdoc#4022) ecosystem (https://github.com/dart-lang/ecosystem/compare/2317263..391a80c): 391a80c 2025-04-01 Brian Wilkerson Update prompts.dart (dart-lang/ecosystem#349) 6a89899 2025-04-01 Brian Wilkerson Update create_tuning_data.dart (dart-lang/ecosystem#350) http (https://github.com/dart-lang/http/compare/1b6e28d..e988925): e988925 2025-03-31 Brian Quinlan Remove .gitignored files (dart-lang/http#1728) 29c5733 2025-03-25 Brian Quinlan Improve the reliability of cronet_http/ok_http workflows (dart-lang/http#1736) dd56b86 2025-03-21 Brian Quinlan Remove cronet_http.impl (dart-lang/http#1734) 7f5ad18 2025-03-21 Brian Quinlan Adding missing license headers (dart-lang/http#1735) fedead7 2025-03-20 Brian Quinlan [cronet_http] Prepare to release 1.3.3 (dart-lang/http#1733) i18n (https://github.com/dart-lang/i18n/compare/d9cce0b..2701040): 2701040 2025-04-01 dependabot[bot] Bump the github-actions group with 2 updates (dart-lang/i18n#959) 5101533 2025-04-01 Moritz Fix hashes.dart formatting (dart-lang/i18n#960) shelf (https://github.com/dart-lang/shelf/compare/2af8529..082d3ac): 082d3ac 2025-04-01 dependabot[bot] Bump actions/cache from 4.2.2 to 4.2.3 in the github-actions group (dart-lang/shelf#475) test (https://github.com/dart-lang/test/compare/9e349d0..c1fa1e6): c1fa1e69 2025-04-01 dependabot[bot] Bump the github-actions group with 3 updates (dart-lang/test#2476) 31a2d64c 2025-03-31 Nate Bosch Sort reporter options (dart-lang/test#2475) webdev (https://github.com/dart-lang/webdev/compare/302b6db..697f2f7): 697f2f7f 2025-03-24 Jessy Yameogo renamed DWDS injector parameter (dart-lang/webdev#2602) af33df71 2025-03-21 Tristan Ross Add offline mode (dart-lang/webdev#2483) 5c805f14 2025-03-21 Jessy Yameogo Updated DWDS to include a boolean flag that enables debugging support when set to true (dart-lang/webdev#2601) Change-Id: I7af88306b77efa3dab2bdef0d7543663317448f1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419682 Auto-Submit: Devon Carew <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
--offline
flag which is useful for sandbox/networkless build systems such as Nix.Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.