-
Notifications
You must be signed in to change notification settings - Fork 23
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
Only emit APIs that are standards track and not experimental #239
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7ed6d20
Only emit APIs that are standards track and not experimental
srujzs 4e9e15b
Generate APIs based on standards track and not experimental
srujzs 708f294
Handle some TODOs that came up when addressing #209
srujzs 3cfe941
Address some lints
srujzs bdb5c4b
Update CHANGELOG and README
srujzs fe9fce2
Add types to the field declaration
srujzs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
// | ||
// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). | ||
// Attributions and copyright licensing by Mozilla Contributors is licensed | ||
// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. | ||
|
||
// Generated from Web IDL definitions. | ||
|
||
@JS() | ||
library; | ||
|
||
import 'dart:js_interop'; | ||
|
||
import 'generic_sensor.dart'; | ||
|
||
typedef AccelerometerLocalCoordinateSystem = String; | ||
extension type AccelerometerSensorOptions._(JSObject _) | ||
implements SensorOptions, JSObject { | ||
external factory AccelerometerSensorOptions({ | ||
num frequency, | ||
AccelerometerLocalCoordinateSystem referenceFrame, | ||
}); | ||
|
||
external AccelerometerLocalCoordinateSystem get referenceFrame; | ||
external set referenceFrame(AccelerometerLocalCoordinateSystem value); | ||
} | ||
|
||
/// The **`LinearAccelerationSensor`** interface of the | ||
/// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs) | ||
/// provides on each reading the acceleration applied to the device along all | ||
/// three axes, but without the contribution of gravity. | ||
/// | ||
/// To use this sensor, the user must grant permission to the `'accelerometer'` | ||
/// device sensor through the | ||
/// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). | ||
/// In addition, this feature may be blocked by a | ||
/// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy) | ||
/// set on your server. | ||
/// | ||
/// --- | ||
/// | ||
/// API documentation sourced from | ||
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/LinearAccelerationSensor). | ||
extension type LinearAccelerationSensor._(JSObject _) | ||
implements Sensor, JSObject { | ||
external factory LinearAccelerationSensor( | ||
[AccelerometerSensorOptions options]); | ||
} | ||
|
||
/// The **`GravitySensor`** interface of the | ||
/// [Sensor APIs](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs) | ||
/// provides on each reading the gravity applied to the device along all three | ||
/// axes. | ||
/// | ||
/// To use this sensor, the user must grant permission to the `'accelerometer'` | ||
/// device sensor through the | ||
/// [Permissions API](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API). | ||
/// In addition, this feature may be blocked by a | ||
/// [Permissions Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy) | ||
/// set on your server. | ||
/// | ||
/// --- | ||
/// | ||
/// API documentation sourced from | ||
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/GravitySensor). | ||
extension type GravitySensor._(JSObject _) implements Sensor, JSObject { | ||
external factory GravitySensor([AccelerometerSensorOptions options]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
// | ||
// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). | ||
// Attributions and copyright licensing by Mozilla Contributors is licensed | ||
// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. | ||
|
||
// Generated from Web IDL definitions. | ||
|
||
@JS() | ||
library; | ||
|
||
import 'dart:js_interop'; | ||
|
||
extension type AttributionReportingRequestOptions._(JSObject _) | ||
implements JSObject { | ||
external factory AttributionReportingRequestOptions({ | ||
required bool eventSourceEligible, | ||
required bool triggerEligible, | ||
}); | ||
|
||
external bool get eventSourceEligible; | ||
external set eventSourceEligible(bool value); | ||
external bool get triggerEligible; | ||
external set triggerEligible(bool value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
// | ||
// API docs from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web). | ||
// Attributions and copyright licensing by Mozilla Contributors is licensed | ||
// under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/. | ||
|
||
// Generated from Web IDL definitions. | ||
|
||
@JS() | ||
library; | ||
|
||
import 'dart:js_interop'; | ||
|
||
import 'dom.dart'; | ||
import 'html.dart'; | ||
|
||
/// The `BatteryManager` interface of the [Battery Status API] provides | ||
/// information about the system's battery charge level. The | ||
/// [navigator.getBattery] method returns a promise that resolves with a | ||
/// `BatteryManager` interface. | ||
/// | ||
/// Since Chrome 103, the `BatteryManager` interface of [Battery Status API] | ||
/// only expose to secure context. | ||
/// | ||
/// --- | ||
/// | ||
/// API documentation sourced from | ||
/// [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager). | ||
extension type BatteryManager._(JSObject _) implements EventTarget, JSObject { | ||
/// The **`BatteryManager.charging`** property is a Boolean value indicating | ||
/// whether or not the device's battery is currently being charged. When its | ||
/// value changes, the [BatteryManager.chargingchange_event] event is fired. | ||
/// | ||
/// If the battery is charging or the user agent is unable to report the | ||
/// battery status information, this value is `true`. Otherwise, it is | ||
/// `false`. | ||
external bool get charging; | ||
|
||
/// The **`BatteryManager.chargingTime`** property indicates the amount of | ||
/// time, in seconds, that remain until the battery is fully charged, or `0` | ||
/// if the battery is already fully charged or the user agent is unable to | ||
/// report the battery status information. | ||
/// If the battery is currently discharging, its value is `Infinity`. | ||
/// When its value changes, the [BatteryManager.chargingtimechange_event] | ||
/// event is fired. | ||
/// | ||
/// > **Note:** Even if the time returned is precise to the second, | ||
/// > browsers round them to a higher interval | ||
/// > (typically to the closest 15 minutes) for privacy reasons. | ||
external num get chargingTime; | ||
|
||
/// The **`BatteryManager.dischargingTime`** property indicates the amount of | ||
/// time, in seconds, that remains until the battery is fully discharged, | ||
/// or `Infinity` if the battery is currently charging rather than discharging | ||
/// or the user agent is unable to report the battery status information. | ||
/// When its value changes, the [BatteryManager.dischargingtimechange_event] | ||
/// event is fired. | ||
/// | ||
/// > **Note:** Even if the time returned is precise to the second, browsers | ||
/// > round them to a higher | ||
/// > interval (typically to the closest 15 minutes) for privacy reasons. | ||
external num get dischargingTime; | ||
|
||
/// The **`BatteryManager.level`** property indicates the current battery | ||
/// charge level as a value between `0.0` and `1.0`. | ||
/// A value of `0.0` means the battery is empty and the system is about to be | ||
/// suspended. | ||
/// A value of `1.0` means the battery is full or the user agent is unable to | ||
/// report the battery status information. | ||
/// When its value changes, the [BatteryManager.levelchange_event] event is | ||
/// fired. | ||
external num get level; | ||
external EventHandler get onchargingchange; | ||
external set onchargingchange(EventHandler value); | ||
external EventHandler get onchargingtimechange; | ||
external set onchargingtimechange(EventHandler value); | ||
external EventHandler get ondischargingtimechange; | ||
external set ondischargingtimechange(EventHandler value); | ||
external EventHandler get onlevelchange; | ||
external set onlevelchange(EventHandler value); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not for this PR, but it would be nice to be able to have course descriptions of how the generated API changed between major versions. So, something like:
Foo
,Bar
, andBaz
Qux
Perhaps this could be done by iterating over the code_builder model and generating a very high-level overview to a text file? Just the list of classes perhaps. If that was committed to the repo, then a simple diff would give us enough info to write a changelog.
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.
Yeah, I think generating a log file of the emitted classes and members and then doing some kind of diff between the two logs should be able to accomplish this. With large changes like this, though, the changelog becomes very long. We could reference some other file that contains that diff to avoid making the changelog too verbose.