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 initialisation of the formBuilder plugin to ensure two or more concurrent initialisations cannot interfere with each other #1459

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

lucasnetau
Copy link
Collaborator

@lucasnetau lucasnetau commented Oct 19, 2023

Initialising two formBuilders concurrently would cause all but the last instance to be incorrectly initialised. Refactor this to using a initialisation function to isolate the plugin instance and store it in a data attribute for later use.

Additionally an uninitialised placeholder function has been put in place when actions are called before the formBuilder is initialised (when not using promise interface)

Both of these changes should reduce issue spam and also improve new developer experience by not having to load multi formBuilders in a recursive function or awaiting in a loop.

Tests have been added to check for concurrent loading, all existing tests pass after this change.

Closes: #1087
Closes: #1000
References: #965
References: #1088
References: #1340
References: #1383

@lucasnetau lucasnetau changed the title Refactor initialisation of the formBuilder plugin to ensure that) two or more concurrent initialisations cannot interfere with each other Refactor initialisation of the formBuilder plugin to ensure two or more concurrent initialisations cannot interfere with each other Oct 19, 2023
… two or more concurrent initialisations cannot interfere with each other
Copy link
Owner

@kevinchappell kevinchappell left a comment

Choose a reason for hiding this comment

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

excellent change. should eliminate one of the most common issues faced when using formBuilder

@kevinchappell kevinchappell merged commit a7a15c8 into kevinchappell:master Oct 19, 2023
1 check passed
@github-actions
Copy link

🎉 This PR is included in version 3.16.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple forms on the same page Duplicates data in multi-page form
2 participants