- Issue created by @dcam
- πΊπΈUnited States dcam
Copying credit from π Move JS library definitions into libraries.yml Active .
Automatically closed - issue fixed for 2 weeks with no activity.
Copied from the original "Settings overhaul" issue:
The settings provided by the module are out-of-sync with the settings provided by the DAP JS. Over the years settings have been added and removed. We need to update the module to provide those offered by DAP v8.
While I'm at it, I really want to redesign the settings form. I want to simplify the library selection into a single radios element. All of the binary settings ought to be changed from true/false radios to checkboxes. And I want to add a status checkbox to enable/disable the module. The functionality is already in the module. It just isn't presented as an option to the admin.
Finally, I want to rewrite the configuration schema. All of the root-level settings retained their old, long D7 variable names. Functionally, they aren't hurting anything, but it makes for bad DX. I also want to flatten the schema a bit. This alone will force the release of version 3.0.0.
Full disclosure: I've had this code mostly ready for a couple of weeks. There are so many changes that are now intertwined with each other that I can't separate them out anymore. They have to go in as one big commit. But I'll try to summarize what's going on in addition to the other things I mentioned wanting to do above.
The hooks and other stuff in the .module file were moved into new OOP Hook classes. Moving the hooks into classes made them WAY more testable. The functional tests that were covering them were converted to unit tests. The whole test suite runs in seconds now. In my local environment the suite can be executed in 4 seconds without UpdateSettingsTest. With UpdateSettingsTest it takes 12 seconds. That's still pretty good. And I'm not even done optimizing yet. Now that hook_requirements() can be converted to OOP there's yet another functional test that might be able to be converted.
Accordingly, moving JS library definitions and implementing hook_js_alter() for adding parameters has to be done in this issue. π Move JS library definitions into libraries.yml Active will be closed.
Removing the deprecated settings has to be done in this issue. I can't split that part out. π Remove deprecations Active will be closed.
I haven't added all of the DAP v8 parameters, but most of them are in there now. I didn't add all the parallel tracking parameters because I don't understand what they do. And I didn't add the custom URL and custom title parameters because I didn't think they were very relevant. The nice thing is that adding new parameters is easier and will be less error-prone because the tests are set up to automatically test all parameters, including new ones. If they aren't added correctly, then the tests will let you know that you messed up.
Active
3.0
Code
Copying credit from π Move JS library definitions into libraries.yml Active .
Automatically closed - issue fixed for 2 weeks with no activity.