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

remove the older protocol implementation #2722

Merged
merged 5 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/pubspec.lock linguist-generated=true
pkgs/dart_services/lib/src/shared/** linguist-generated=true
pkgs/sketch_pad/lib/samples.g.dart linguist-generated=true
pkgs/sketch_pad/web/codemirror/** linguist-generated=true
4 changes: 0 additions & 4 deletions .github/workflows/dart_pad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ jobs:
sdk: ${{ matrix.sdk }}
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65

- name: Install apt dependencies
run: sudo apt-get install -y protobuf-compiler

- name: Install dart dependencies
run: dart pub get

Expand All @@ -52,5 +49,4 @@ jobs:
- name: Run buildbot
run: |
export PATH=$PATH:$HOME/.pub-cache/bin
dart pub global activate protoc_plugin
dart run tool/grind.dart buildbot
3 changes: 0 additions & 3 deletions .github/workflows/dart_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ jobs:
channel: ${{ matrix.sdk }}
- run: flutter --version

- name: Install apt dependencies
run: sudo apt-get install -y protobuf-compiler redis

- name: Install dart dependencies
run: dart pub get

Expand Down
36 changes: 4 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Contributing to DartPad

Want to contribute? Great! First, read this page (including the small print at the end).

## Before you contribute
Expand Down Expand Up @@ -40,39 +41,10 @@ Contributions made by corporations are covered by a different agreement than the

## How to run DartPad locally

* To run the DartPad against the regular serving backend:

Install the [`protoc` compiler](https://grpc.io/docs/protoc-installation/).
To run the server, see https://github.com/dart-lang/dart-pad/blob/main/pkgs/dart_services/README.md.

Run these commands:
To run the front-end, from the `pkg/dart-pad` directory, run:

```bash
# Get all Dart dependencies
dart pub get
# Install the Dart protobuf compiler & grinder tool
dart pub global activate protoc_plugin
dart pub global activate grinder
# Serve
grind serve
```
This serves the DartPad frontend locally on port 8000.

* To run DartPad against a local version of the dart-services backend:
```bash
cd ..
git clone git@github.com:dart-lang/dart-services.git
cd dart-services
dart pub get
# Change the SDK version dart-services serves to the one you currently have installed
grind update-docker-version
# Begin serving the backend locally on port 8080.
FLUTTER_CHANNEL="stable" grind serve &

cd ../dart-pad
# Begin serving the front-end locally on port 8000, with the given backend on the default port 8080 this is defined in tools/grind.dart
grind serve-local-backend
dart tool/grind.dart serve
```

You can adjust the DARTPAD_BACKEND variable to match different versions of the dart-pad backend
serving on AppEngine for test purposes as well, e.g.:
`DARTPAD_BACKEND=https://20180822t110058-dot-dart-services.appspot.com/`
46 changes: 23 additions & 23 deletions pkgs/dart_pad/pubspec.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkgs/dart_pad/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
collection: ^1.17.2
dartpad_shared: any
encrypt: ^5.0.1
fluttering_phrases: ^0.5.0
fluttering_phrases: ^1.0.0
html_unescape: ^2.0.0
http: ^1.1.0
js: ^0.6.7
Expand All @@ -21,7 +21,6 @@ dependencies:
mdc_web: ^0.6.0
meta: ^1.8.0
path: ^1.8.0
protobuf: ^3.0.0
pub_semver: ^2.1.0
sass_builder: ^2.2.1
shelf: ^1.3.0
Expand Down
2 changes: 1 addition & 1 deletion pkgs/dart_services/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2014, the Dart project authors.
Copyright 2014, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down
73 changes: 26 additions & 47 deletions pkgs/dart_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,48 @@ A server backend to support DartPad.

## What is it? What does it do?

This project is a small, stateless Dart server, which powers the front-end of DartPad.
It provides many of DartPad's features, including static analysis (errors and warnings),
compilation to JavaScript, code completion, dartdoc information, code formatting, and
quick fixes for issues.
This project is a small, stateless Dart server, which powers the front-end of
DartPad. It provides many of DartPad's features, including static analysis
(errors and warnings), compilation to JavaScript, code completion, dartdoc
information, code formatting, and quick fixes for issues.

## Getting set up

This project is built with [grinder](https://pub.dev/packages/grinder). To install, please run:
### Initialize Flutter

```bash
$ dart pub global activate grinder
```
The Flutter SDK needs to be downloaded and setup; see
https://docs.flutter.dev/get-started/install.

The dart-services v2 API is defined in terms of Protobuf, which requires the
installation of the Protobuf `protoc` compiler. Please see [Protocol
Buffers](https://developers.google.com/protocol-buffers/) for detailed
installation instructions. On macOS, you may also install with Homebrew via:
### Running

```bash
$ brew install protobuf
```

The Dart protoc plugin is also required for the above `protoc` compiler
to generate Dart code. To install, please run:
To run the server, run:

```bash
$ dart pub global activate protoc_plugin
$ dart bin/server.dart
```

## Initialize Flutter

The Flutter SDK needs to be downloaded and setup.

```bash
$ dart pub get
$ dart run tool/update_sdk.dart stable
```
The server will run from port 8080 and export several JSON APIs, like
`/api/v3/analyze` and `/api/v3/compile`.

## Build the subsidiary files
### Testing

The Dart Services server depends on generated files. Run the following to generate all the required binaries.
To run tests:

```bash
$ dart tool/grind.dart deploy
```
`dart test`

## Running
### Re-renerating source

To run the server, run:
To rebuild the shelf router, run:

```bash
$ dart tool/grind.dart serve
```
dart run build_runner build --delete-conflicting-outputs
```

The server will run from port 8080 and export several JSON APIs, like
`/api/v3/compile` and `/api/v3/analyze`.

## Testing

To run tests:
And to update the shared code from dartpad_shared, run:

`dart test`
```
dart tool/grind.dart copy-shared-source
devoncarew marked this conversation as resolved.
Show resolved Hide resolved
```

## Redis

Expand All @@ -79,12 +59,11 @@ To configure the server to use the local redis cache, run `dart bin/server.dart`

## Issues and bugs

Please file reports on the
[GitHub Issue Tracker for DartPad](https://github.com/dart-lang/dart-pad/issues).
Please report issues at https://github.com/dart-lang/dart-pad/issues.

## License and Contributing

Contributions welcome! Please read this short
[guide](https://github.com/dart-lang/dart-services/wiki/Contributing) first.
[guide](https://github.com/dart-lang/dart-pad/blob/main/CONTRIBUTING.md) first.
You can view our license
[here](https://github.com/dart-lang/dart-services/blob/master/LICENSE).
[here](https://github.com/dart-lang/dart-pad/blob/main/LICENSE).
6 changes: 6 additions & 0 deletions pkgs/dart_services/dart_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Configure test execution; documentation available at:
# https://github.com/dart-lang/test/blob/master/pkgs/test/doc/configuration.md.

# Some of the project_creator_test.dart tests don't like to run in parallel with
# other tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this might be something we should investigate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably; I don't think it's necessary a serious underlying issue, and even w/ this the tests finish in ~30 seconds. As you say though, it would be good to investigate, esp. to rule out something serious.

concurrency: 1
Loading
Loading