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

[Class modifiers] Language feature docs #4497

Closed
MaryaBelanger opened this issue Jan 9, 2023 · 0 comments · Fixed by #4754
Closed

[Class modifiers] Language feature docs #4497

MaryaBelanger opened this issue Jan 9, 2023 · 0 comments · Fixed by #4754
Assignees
Labels
a.language Relates to the Dart language tour e2-days Can complete in < 5 days of normal, not dedicated, work from.team Reported by Dash docs team member meta.umbrella Collects multiple related issues p2-medium Necessary but not urgent concern. Resolve when possible. st.triage.ltw Indicates Lead Tech Writer has triaged

Comments

@MaryaBelanger
Copy link
Contributor

MaryaBelanger commented Jan 9, 2023

Summary

Class modifiers determine how a class can be implemented, extended, or mixed in relative to the library it's defined in. Invariants like this are up to the library author; they can make types easier to understand and use.

Evaluation

  1. Class modifiers will be a stand-alone page under "Language > Classes & objects" in the side nav

    There may also be coverage, or at least references to the core coverage, somewhere in the "Libraries" content.

  2. The table of combinations:impacts is NOT necessary

    • just the use cases, start with important ones
  3. Mixin docs need to be updated: classes can't be used as a mixin by default anymore, must explicitly use the modifier mixin class

  • Class modifiers content needs to come after existing mixin content, because all the modifiers apply to mixins and classes.
  • See Mixin restrictions section of spec for changes to mixins around the allowance of constructor declaration (currently can't declare a constructor, restrictions loosened)
  1. Potentially, for each new class modifier/class modifiers combination, briefly mention the use cases under "Motivation" in the spec to give users an idea of when to use this.

    e.g. "The final modifier` ... disallowing implementation and extension of a type makes it entirely safe to add new members to"

    Another way to organize this information would be the inverse, i.e. by motivation: "The modifiers disallow implementing or extending, which is good for.... "

  2. Make sure to add the page link to related diagnostics e.g. + implicit_reopen linter#4101

  3. See [Dart 3] Document general use of class modifier by Dart core libraries in Library Tour #4730

  • will open another PR to address this since the first one is pretty large
  1. (maybe) add something to development or package content about how modifiers are for package maintainers / developers who want to limit the usage capabilities for others using their package
  • skip
  1. "extend a class" page and "implicit interfaces" section need to point to class modifiers page ("class modifiers restrict how classes can be extended/implemented")
  • think I'll skip this for now
  1. (maybe) move "abstract classes" section to class modifiers page?
  • need to find and fix links to it across the site, add redirect
  1. add mention + link to class modifiers in intro paragraph of main "Classes" page

  2. Not sure if anything needs to change in "nosuchmethod" section based on this note:

    If you have a class that is marked base or final, that means that you are ensured when an instance of that class is passed into your library that any access of a private member on it will never throw a nosuchmethod error

  3. Change link for interface on 'Keywords' page #4662

Resources

@MaryaBelanger MaryaBelanger self-assigned this Jan 9, 2023
@parlough parlough added a.language Relates to the Dart language tour p2-medium Necessary but not urgent concern. Resolve when possible. docs e2-days Can complete in < 5 days of normal, not dedicated, work labels Jan 9, 2023
@MaryaBelanger MaryaBelanger linked a pull request Apr 12, 2023 that will close this issue
@atsansone atsansone added meta.umbrella Collects multiple related issues and removed docs labels Apr 12, 2023
@atsansone atsansone added this to the Next Major Release milestone Apr 29, 2023
@atsansone atsansone added the st.triage.ltw Indicates Lead Tech Writer has triaged label Apr 29, 2023
MaryaBelanger added a commit that referenced this issue May 8, 2023
- New class modifiers page 
- Minor changes to mixin page
- Added modifiers to Keywords page
- Moved "Abstract classes" section off of "Classes" page and to "Class
modifiers > `abstract`" section

Fixes #4497 
Fixes #4662 
Fixes #4581
@atsansone atsansone added the from.team Reported by Dash docs team member label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.language Relates to the Dart language tour e2-days Can complete in < 5 days of normal, not dedicated, work from.team Reported by Dash docs team member meta.umbrella Collects multiple related issues p2-medium Necessary but not urgent concern. Resolve when possible. st.triage.ltw Indicates Lead Tech Writer has triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants