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

Naming conventions - linting #16455

Draft
wants to merge 64 commits into
base: master
Choose a base branch
from
Draft

Conversation

RaananW
Copy link
Member

@RaananW RaananW commented Apr 7, 2025

If you have any questions, contact me!

Draft to give everyone time to review and present me with questions.

NOTE - lint currently fails due to javascript out of heap memory. The last few commits are just attempts to get the CI to play nicely. Once I have the solution I will clean the config file and the command running eslint

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16455/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16455/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16455/merge/?snapshot=refs/pull/16455/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 9, 2025

Copy link
Contributor

@docEdub docEdub left a comment

Choose a reason for hiding this comment

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

I looked over the audio engine changes and they all look good to me. Thanks!

Copy link
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

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

I reviewed some files (up to camera inputs, skipping the audio files). There are many similar issues, so I'm going to stop until we decide what to do with them.

@@ -10,8 +10,8 @@ import type { Observer } from "core/Misc/observable";
import { Logger } from "core/Misc/logger";
import type { AbstractEngine } from "core/Engines";

const _positionUpdateFailMessage = "Failed to update html mesh renderer position due to failure to get canvas rect. HtmlMesh instances may not render correctly";
const babylonUnitsToPixels = 100;
const _PositionUpdateFailMessage = "Failed to update html mesh renderer position due to failure to get canvas rect. HtmlMesh instances may not render correctly";
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need an underscore?

Copy link
Member Author

@RaananW RaananW Apr 9, 2025

Choose a reason for hiding this comment

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

No, this was an old rule that was changed and will be reverted tomorrow. Same with all of those that I didn't revert
Sorry - no, we don't need the underscore, but those had underscore already. No underscore was added, it is just the unchanged defined naming convention. I will remove all underscores from non-exported global members to stay consistent and will remove the underscore from the rule

@@ -297,7 +297,7 @@ export class HtmlMeshRenderer {
}

// prettier-ignore
protected _getCameraCSSMatrix(matrix: Matrix): string {
protected _getCameraCssMatrix(matrix: Matrix): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Our coding standards doc (not public) says to use all caps for initialisms. Can linting even tell the difference between initialisms and abbreviations? Maybe we need to modify the doc.

Copy link
Member Author

Choose a reason for hiding this comment

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

Abbreviations are an interesting topic that I will be happy to discuss. We do support abbreviations, but they need to be manually added to the lint file. Let's talk about it tomorrow.

Copy link
Member Author

@RaananW RaananW Apr 10, 2025

Choose a reason for hiding this comment

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

Our coding standards doc (not public) says to use all caps for initialisms.

Not the new docs, which states:

Abbreviations
[Strict] case (e.g. getMeshById, not getMeshByID)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what new docs you mean, but abbreviations are not the same as initialisms.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, but that was what it meant. we can discuss this. Anyhow, abbreviations are supported (and configured). You can see it in the linting file (the first line).
StringPascalCase for example, does not support abbreviations. so It should be HtmlCssSupportId. However, with known and supported abbreviations (or initialisms :-) ) we fallback to CamelCase

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

Graph tools CI has failed you can find the test results at:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/TOOLS/refs/pull/16455/merge/testResults/

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16455/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16455/merge/?snapshot=refs/pull/16455/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16455/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16455/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16455/merge/?snapshot=refs/pull/16455/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16455/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Apr 10, 2025

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.

4 participants