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

Add generated element constructors #185

Merged
merged 8 commits into from
Feb 29, 2024
Merged

Conversation

srujzs
Copy link
Contributor

@srujzs srujzs commented Feb 23, 2024

For every tag that the interface supports, emits a Dart constructor that can be used to create an element of that tag using either createElement or createElementNS. Adds a dependency to @webref/elements to fetch the element data. Modifies existing helper deprecation messages to point to the new constructors instead. Deprecates createAudioElement.

As we remove some members that don't work, and this deprecation is a breaking change, we update the major version number.

For every tag that the interface supports, emits a Dart
constructor that can be used to create an element of that tag
using either createElement or createElementNS. Adds a dependency
to @webref/elements to fetch the element data.

Note that not every element interface has a tag associated with it.
Adds a test and modifies existing helper messages to
point to the new constructors instead.

Also deprecates createAudioElement.

As we remove some members that don't work, and this
deprecation is a breaking change, we update the major
version number.
@srujzs
Copy link
Contributor Author

srujzs commented Feb 23, 2024

FYI @kevmoo - This requires moving to 0.6.X.

CHANGELOG.md Outdated Show resolved Hide resolved
Adds a helper function wrap doc comments as needed to avoid
the analyzer failing on comments exceeding line width.
@kevmoo
Copy link
Member

kevmoo commented Feb 24, 2024 via email

Unneeded as:

- Since the implementation was always broken for
these constructors, it shouldn't be a breaking change to
remove them/fix them.
- Deprecations no longer break Flutter.
@devoncarew
Copy link
Member

@srujzs - I didn't do the create-a-PR-against-a-PR thing, but you might want the last two file changes from srujzs@153424a.

@srujzs
Copy link
Contributor Author

srujzs commented Feb 28, 2024

I didn't do the create-a-PR-against-a-PR thing, but you might want the last two file changes from srujzs@153424a.

Thanks Devon! Unfortunately, it's a little annoying to determine what article is correct even ignoring proper nouns, because words like user and hour defy the vowel rule. For now, I just added a method to only handle the expected inputs. A more general solution is going to be harder: https://stackoverflow.com/questions/4558437/programmatically-determine-whether-to-describe-an-object-with-a-or-an.

I also got rid of the wrapping method I added and used the one you added with no changes to the output.

@srujzs srujzs merged commit 641a8df into dart-lang:main Feb 29, 2024
9 checks passed
Copy link
Member

@sigmundch sigmundch left a comment

Choose a reason for hiding this comment

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

Finally finished taking a look! LGTM too :)

copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Mar 4, 2024
…shelf, sse, test, web

Revisions updated by `dart tools/rev_sdk_deps.dart`.

dartdoc (https://github.com/dart-lang/dartdoc/compare/eed92d3..cec45fb):
  cec45fbe  2024-02-29  Kallen Tu  Deprecate --resources-dir option. (dart-lang/dartdoc#3696)
  40fef4c2  2024-02-29  Sam Rawlins  In PackageBuilder._discoverLibraries, initialize newFiles outside loop. (dart-lang/dartdoc#3695)
  2760d254  2024-02-28  Sam Rawlins  Deprecate the 'include-externals' option. (dart-lang/dartdoc#3694)
  c1c0854d  2024-02-28  Sam Rawlins  Improve support for package-with-macro-application (dart-lang/dartdoc#3687)
  b28ee1f8  2024-02-28  Sam Rawlins  Deprecate the `--nodoc` Option (dart-lang/dartdoc#3690)
  7988d91f  2024-02-28  Sam Rawlins  Improve some exception messaging and comments (dart-lang/dartdoc#3691)
  a1610aa6  2024-02-28  Sam Rawlins  Bump to 8.0.6 (dart-lang/dartdoc#3692)

ecosystem (https://github.com/dart-lang/ecosystem/compare/3e4f286..49a3cbb):
  49a3cbb  2024-03-01  dependabot[bot]  Bump peter-evans/find-comment (dart-lang/ecosystem#241)
  9dd8384  2024-03-01  dependabot[bot]  Bump subosito/flutter-action from 2.12.0 to 2.13.0 (dart-lang/ecosystem#240)
  7acf3bc  2024-03-01  dependabot[bot]  Bump actions/download-artifact from 4.1.1 to 4.1.3 (dart-lang/ecosystem#242)
  5d6a0c0  2024-03-01  dependabot[bot]  Bump peter-evans/create-or-update-comment (dart-lang/ecosystem#238)
  91fcd1d  2024-03-01  dependabot[bot]  Bump actions/upload-artifact from 4.0.0 to 4.3.1 (dart-lang/ecosystem#239)

glob (https://github.com/dart-lang/glob/compare/ef5f065..379d60c):
  379d60c  2024-02-28  Kevin Moore  Require Dart 3.3 (dart-lang/glob#88)

http (https://github.com/dart-lang/http/compare/6e0a46f..470d2c3):
  470d2c3  2024-03-01  dependabot[bot]  Bump actions/cache from 4.0.0 to 4.0.1 (dart-lang/http#1145)
  a5b17e0  2024-03-01  dependabot[bot]  Bump actions/setup-java from 4.0.0 to 4.1.0 (dart-lang/http#1144)
  c1d3481  2024-02-29  Brian Quinlan  Split package:http_profile into multiple files (dart-lang/http#1143)
  69332d3  2024-02-29  Brian Quinlan  API adjustments based on cupertino_http usage experience (dart-lang/http#1141)
  199f9fa  2024-02-28  Brian Quinlan  Add a dart:io WebSocket implementation (dart-lang/http#1139)
  37fceb8  2024-02-28  Brian Quinlan  Fix incorrect documentation that used the old `isOwned` name (dart-lang/http#1140)

markdown (https://github.com/dart-lang/markdown/compare/62e3349..dd47c5d):
  dd47c5d  2024-02-28  Kevin Moore  WIP: v0.31.2 spec updates (dart-lang/markdown#591)

pool (https://github.com/dart-lang/pool/compare/782da82..c118f69):
  c118f69  2024-02-28  Kevin Moore  Latest lints, test wasm on dev channel (dart-lang/pool#81)

protobuf (https://github.com/dart-lang/protobuf/compare/ef0ab7d..b761358):
  b761358  2024-03-04  Nate Biggs  Support unknown json data and add internal set/clear field methods for generated accessors. (google/protobuf.dart#918)
  1822b81  2024-03-01  dependabot[bot]  Bump dart-lang/setup-dart from 1.5.0 to 1.6.2 (google/protobuf.dart#917)
  adab58c  2024-03-01  dependabot[bot]  Bump actions/cache from 3.3.1 to 4.0.1 (google/protobuf.dart#916)
  c283db5  2024-03-01  Ömer Sinan Ağacan  Ignore the UnmodifiableUint8ListView deprecation warning (google/protobuf.dart#915)

shelf (https://github.com/dart-lang/shelf/compare/b432620..da6a69b):
  da6a69b  2024-03-01  dependabot[bot]  Bump actions/cache from 4.0.0 to 4.0.1 (dart-lang/shelf#415)

sse (https://github.com/dart-lang/sse/compare/13ec752..b53ba14):
  b53ba14  2024-02-29  Kevin Moore  Prepare release of v4.1.5 (dart-lang/sse#105)

test (https://github.com/dart-lang/test/compare/26953ba..525f77b):
  525f77b2  2024-03-01  dependabot[bot]  Bump actions/cache from 4.0.0 to 4.0.1 (dart-lang/test#2191)
  b1041775  2024-03-01  dependabot[bot]  Bump github/codeql-action from 3.23.2 to 3.24.6 (dart-lang/test#2193)

web (https://github.com/dart-lang/web/compare/fa4280c..8870d04):
  8870d04  2024-02-29  Devon Carew  update the format of the web idl versions file (dart-lang/web#194)
  641a8df  2024-02-29  Srujan Gaddam  Add generated element constructors (dart-lang/web#185)
  5e5adc8  2024-02-28  Srujan Gaddam  Use URI instead of library name (dart-lang/web#191)
  2f00226  2024-02-28  Kevin Moore  Move IDL version details (dart-lang/web#189)
  23475c0  2024-02-28  Devon Carew  Include MDN API documentation as class and member dartdoc comments (dart-lang/web#143)

Change-Id: Ia08bf4a304a1073473d6abddb64275cca84dea13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/355521
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
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

5 participants