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

[REFACTOR] Don't use special prefix in private field name #1196

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

tbouffard
Copy link
Member

The BpmnVisualization.bpmnModelRegistry field was previously prefixed by a _
as this is sometime done in other projects as a convention to warn about private
fields in JS code. Remember that we don't produce private JS fields at TS
compilation as this not widely supported by browsers, so such fields are
ultimately visible.

This was not consistent with the rest of the code base, so the prefix has been
removed.

The `BpmnVisualization.bpmnModelRegistry` field was previously prefixed by a `_`
as this is sometime done in other projects as a convention to warn about private
fields in JS code. Remember that we don't produce private JS fields at TS
compilation as this not widely supported by browsers, so such fields are
ultimately visible.

This was not consistent with the rest of the code base, so the prefix has been
removed.
@tbouffard tbouffard added the refactoring Code refactoring label Mar 25, 2021
@github-actions
Copy link

github-actions bot commented Mar 25, 2021

♻️ PR Preview c700db8 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@github-actions
Copy link

github-actions bot commented Mar 25, 2021

♻️ PR Preview c700db8 has been successfully destroyed since this PR has been closed.

🤖 By surge-preview

@tbouffard tbouffard added the decision record Track project and architectural decisions label Mar 25, 2021
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@tbouffard
Copy link
Member Author

Additional information

This underscored field name has been introduced in #1115, and the non consistent issue was detected after the PR merge: #1115 (review)

The private class fields proposal is currently a TC39 stage 3 candidate
Resources about the proposal and the 'underscore convention' for private fields

@tbouffard tbouffard merged commit 6bb6af4 into master Mar 25, 2021
@tbouffard tbouffard deleted the refactor/no_special_syntax_for_private_properties branch March 25, 2021 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision record Track project and architectural decisions refactoring Code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants