LearnNewsExamplesServices
Frontmatter
id5512
titleNeo.setupClass() => create a protection for not creating singleton instances more than once
stateClosed
labels
enhancement
assigneestobiu
createdAtJul 2, 2024, 10:33 AM
updatedAtJul 2, 2024, 10:47 AM
githubUrlhttps://github.com/neomjs/neo/issues/5512
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJul 2, 2024, 10:47 AM

Neo.setupClass() => create a protection for not creating singleton instances more than once

Closed v8.1.0 enhancement
tobiu
tobiu commented on Jul 2, 2024, 10:33 AM

The current singleton implementation works fine, in case we are sticking to one Neo.mjs version per app.

For the LivePreview, the dynamic code can not be bundled, so when trying to build the Portal app, it could happen that we have both, the dist/production and the development versions of neo in parallel.

In this case, singleton files will get pulled in from multiple locations (file-paths). setupClass() needs to check if the namespace already exists and if so, not create a new instance or override the ns.

tobiu added the enhancement label on Jul 2, 2024, 10:33 AM
tobiu assigned to @tobiu on Jul 2, 2024, 10:33 AM
tobiu referenced in commit f761db9 - "Neo.setupClass() => create a protection for not creating singleton instances more than once #5512" on Jul 2, 2024, 10:47 AM
tobiu closed this issue on Jul 2, 2024, 10:47 AM