Skip to content

Commit

Permalink
Introduce a JSON (v3) protocol (#2669)
Browse files Browse the repository at this point in the history
* work on a json protocol

* merge to main

* fix analysis issues

* rename AnalysisResults => AnalysisResponse

* updates for the json protocol

* add tests for v3 protocol

* update .gitattributes

* review feedback

* introduce a common package:dartpad_shared package

* don't commit the lock file

* update gitattributes file
  • Loading branch information
devoncarew committed Oct 11, 2023
1 parent 3cab198 commit c222c96
Show file tree
Hide file tree
Showing 43 changed files with 1,325 additions and 841 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pkgs/dart_pad/lib/src/protos/** linguist-generated=true
pkgs/sketch_pad/lib/src/protos/** linguist-generated=true
pkgs/sketch_pad/web/codemirror/** linguist-generated=true
40 changes: 40 additions & 0 deletions .github/workflows/dartpad_shared.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: package:dartpad_shared

permissions: read-all

on:
push:
branches: [ main ]
paths:
- '.github/workflows/dartpad_shared.yml'
- 'pkgs/dartpad_shared/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/dartpad_shared.yml'
- 'pkgs/dartpad_shared/**'
schedule:
- cron: '0 0 * * 0' # weekly

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pkgs/dartpad_shared/

steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f

- name: Install dart dependencies
run: dart pub get

- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

- name: Regenerate model classes
run: dart run build_runner build --delete-conflicting-outputs

- name: Analyze project source
run: dart analyze --fatal-infos
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and Flutter. You can access it at [dartpad.dev](http://dartpad.dev).
| --- | --- | --- |
| [dart_pad](pkgs/dart_pad/) | The front end of DartPad. | [![dart_pad](https://github.com/dart-lang/dart-pad/actions/workflows/dart_pad.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/dart_pad.yml) |
| [dart_services](pkgs/dart_services/) | The backend service for DartPad. | [![dart_services](https://github.com/dart-lang/dart-pad/actions/workflows/dart_services.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/dart_services.yml) |
| [dartpad_shared](pkgs/dartpad_shared/) | Common code shared between the DartPad frontend and backend. | [![dartpad_shared](https://github.com/dart-lang/dart-pad/actions/workflows/dartpad_shared.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/dartpad_shared.yml) |
| [samples](pkgs/samples/) | Sample code snippets for DartPad. | [![samples](https://github.com/dart-lang/dart-pad/actions/workflows/samples.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/samples.yml) |
| [sketch_pad](pkgs/sketch_pad/) | An experimental redux of the DartPad UI. | [![sketch_pad](https://github.com/dart-lang/dart-pad/actions/workflows/sketch_pad.yml/badge.svg)](https://github.com/dart-lang/dart-pad/actions/workflows/sketch_pad.yml) |

Expand Down
63 changes: 0 additions & 63 deletions pkgs/dart_pad/lib/src/protos/dart_services.pb.dart

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

13 changes: 0 additions & 13 deletions pkgs/dart_pad/lib/src/protos/dart_services.pbjson.dart

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

82 changes: 41 additions & 41 deletions pkgs/dart_pad/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051
sha256: "36a321c3d2cbe01cbcb3540a87b8843846e0206df3e691fa7b23e19e78de6d49"
url: "https://pub.dev"
source: hosted
version: "64.0.0"
version: "65.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893"
sha256: dfe03b90ec022450e22513b5e5ca1f01c0c01de9c3fba2f7fd233cb57a6b9a07
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.3.0"
archive:
dependency: transitive
description:
name: archive
sha256: "49b1fad315e57ab0bbc15bcbb874e83116a1d78f77ebd500a4af6c9407d6b28e"
sha256: "7e0d52067d05f2e0324268097ba723b71cb41ac8a6a2b24d1edf9c536b987b03"
url: "https://pub.dev"
source: hosted
version: "3.3.8"
version: "3.4.6"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -93,18 +93,18 @@ packages:
dependency: transitive
description:
name: build_modules
sha256: "14a8e9bf4b1ae3f5d6c925c1386da59e818c68cc6f1f6fda991f7c6b74c6ebb9"
sha256: bd2e3693a33761fce4260704fcfa519042573457c8cf61c50249a7dde2fbe5e1
url: "https://pub.dev"
source: hosted
version: "5.0.4"
version: "5.0.5"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: a7417cc44d9edb3f2c8760000270c99dba8c72ff66d0146772b8326565780745
sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.4.1"
build_runner:
dependency: "direct dev"
description:
Expand All @@ -117,26 +117,26 @@ packages:
dependency: transitive
description:
name: build_runner_core
sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41"
sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185
url: "https://pub.dev"
source: hosted
version: "7.2.10"
version: "7.2.11"
build_test:
dependency: "direct dev"
description:
name: build_test
sha256: "2c3d7c70455803a8b904b85001aa87ae21bb2a9d694baeedb019012b0972df0e"
sha256: "178a9e8989cbd40b3104b88cb6ab8cbf6e3293d90b31ba44420745cba54730f1"
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.2.1"
build_web_compilers:
dependency: "direct dev"
description:
name: build_web_compilers
sha256: "49270bd113959ac061512d2bdf0046cf97395b88b04a6baed2b9b276c88559ec"
sha256: "66a068988c1c409021a2fe646f428c362ab49021bbf2380b6965a34fbc90c8f8"
url: "https://pub.dev"
source: hosted
version: "4.0.5"
version: "4.0.6"
built_collection:
dependency: transitive
description:
Expand All @@ -149,10 +149,10 @@ packages:
dependency: transitive
description:
name: built_value
sha256: ff627b645b28fb8bdb69e645f910c2458fd6b65f6585c3a53e0626024897dedf
sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74
url: "https://pub.dev"
source: hosted
version: "8.6.2"
version: "8.6.3"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -197,10 +197,10 @@ packages:
dependency: transitive
description:
name: code_builder
sha256: "315a598c7fbe77f22de1c9da7cfd6fd21816312f16ffa124453b4fc679e540f1"
sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677"
url: "https://pub.dev"
source: hosted
version: "4.6.0"
version: "4.7.0"
codemirror:
dependency: "direct main"
description:
Expand Down Expand Up @@ -229,10 +229,10 @@ packages:
dependency: transitive
description:
name: coverage
sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097"
sha256: "595a29b55ce82d53398e1bcc2cba525d7bd7c59faeb2d2540e9d42c390cfeeeb"
url: "https://pub.dev"
source: hosted
version: "1.6.3"
version: "1.6.4"
crypto:
dependency: transitive
description:
Expand All @@ -253,26 +253,26 @@ packages:
dependency: "direct dev"
description:
name: dart_flutter_team_lints
sha256: "66517b1f6a53e3275938eece5fe0df6960d1e86a82bad074d7364a9a5c97ae10"
sha256: "0917c8b64a29532a7e6835e164131c89a5925fbf1e3a4319558b95f4ef623d64"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
version: "2.1.0"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55"
sha256: abd7625e16f51f554ea244d090292945ec4d4be7bfbaf2ec8cccea568919d334
url: "https://pub.dev"
source: hosted
version: "2.3.2"
version: "2.3.3"
encrypt:
dependency: "direct main"
description:
name: encrypt
sha256: "4fd4e4fdc21b9d7d4141823e1e6515cd94e7b8d84749504c232999fba25d9bbb"
sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2"
url: "https://pub.dev"
source: hosted
version: "5.0.1"
version: "5.0.3"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -413,10 +413,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
sha256: "5e5a8fdb6c327a998e3e14b611829e080b3bee14bdd9ae41bbc2efac77bc0dca"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "3.0.0-beta.2"
logging:
dependency: "direct main"
description:
Expand Down Expand Up @@ -453,10 +453,10 @@ packages:
dependency: "direct main"
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.11.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -692,10 +692,10 @@ packages:
dependency: "direct dev"
description:
name: test
sha256: "9b0dd8e36af4a5b1569029949d50a52cb2a2a2fdaa20cebb96e6603b9ae241f9"
sha256: a20ddc0723556dc6dd56094e58ec1529196d5d7774156604cb14e8445a5a82ff
url: "https://pub.dev"
source: hosted
version: "1.24.6"
version: "1.24.7"
test_api:
dependency: transitive
description:
Expand All @@ -708,10 +708,10 @@ packages:
dependency: transitive
description:
name: test_core
sha256: "4bef837e56375537055fdbbbf6dd458b1859881f4c7e6da936158f77d61ab265"
sha256: "96382d0bc826e260b077bb496259e58bc82e90b603ab16cd5ae95dfe1dfcba8b"
url: "https://pub.dev"
source: hosted
version: "0.5.6"
version: "0.5.7"
timing:
dependency: transitive
description:
Expand All @@ -732,10 +732,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
sha256: a13d5503b4facefc515c8c587ce3cf69577a7b064a9f1220e005449cf1f64aad
url: "https://pub.dev"
source: hosted
version: "11.10.0"
version: "12.0.0"
watcher:
dependency: transitive
description:
Expand All @@ -756,10 +756,10 @@ packages:
dependency: "direct dev"
description:
name: webdriver
sha256: "3c923e918918feeb90c4c9fdf1fe39220fa4c0e8e2c0fffaded174498ef86c49"
sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.0.3"
webkit_inspection_protocol:
dependency: transitive
description:
Expand All @@ -777,4 +777,4 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.1.0 <3.3.0"
dart: ">=3.1.0 <3.4.0"
1 change: 1 addition & 0 deletions pkgs/dart_services/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ analyzer:
- project_templates/**
errors:
lines_longer_than_80_chars: ignore
unreachable_from_main: ignore

linter:
rules:
Expand Down
Loading

0 comments on commit c222c96

Please sign in to comment.