Skip to content

use the new operator to instantiate coreGraph & osmEntity classes#12151

Open
k-yle wants to merge 1 commit intodevelopfrom
kh/new
Open

use the new operator to instantiate coreGraph & osmEntity classes#12151
k-yle wants to merge 1 commit intodevelopfrom
kh/new

Conversation

@k-yle
Copy link
Copy Markdown
Collaborator

@k-yle k-yle commented Mar 31, 2026

blocked by #12150. after that PR is merged, we need to rebase this one before merging.

as discussed in #12093 (comment) and #12093 (comment), we need to a mass update which adds the new operator to everywhere that instatiates the 5 main classes. This will allow us to migrate these files to ES classes in the future.

The PR updates osmNode, osmWay, osmRelation, osmChangeset, coreGraph. All other classes are used in <5 files, so they can be done later.

@k-yle k-yle added the chore Improvements to the iD development experience or codebase label Mar 31, 2026
@k-yle
Copy link
Copy Markdown
Collaborator Author

k-yle commented Mar 31, 2026

@copilot please carefully check every file in this PR, to confirm that this PR only adds the new operator, and does nothing else.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

@copilot please carefully check every file in this PR, to confirm that this PR only adds the new operator, and does nothing else.

I reviewed the full diff carefully. All changes in this PR only add the new operator to instantiations of osmNode, osmWay, osmRelation, osmChangeset, and coreGraph.

One issue I found and fixed (commit d62f993): modules/core/graph.js had an unintended change where the original backward-compatible guard (if (!(this instanceof coreGraph)) return new coreGraph(other, mutable);) was replaced with an error throw. I've reverted it back to the original guard, so the only remaining change in that file is the legitimate new addition in the update function.

@k-yle
Copy link
Copy Markdown
Collaborator Author

k-yle commented Mar 31, 2026

huh, that was actually useful. thanks @copilot

@tyrasd
Copy link
Copy Markdown
Member

tyrasd commented Mar 31, 2026

#12150 is merged now

Base automatically changed from kh/osmEntity5 to develop March 31, 2026 22:08
@k-yle
Copy link
Copy Markdown
Collaborator Author

k-yle commented Mar 31, 2026

thanks, rebased now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Improvements to the iD development experience or codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants