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
Split up src/sweetalert2.js #970
Comments
/cc @limonte @toverux @ACupaJoe @samturrell @FinesseRus |
Agreed, partly why #824 was taking so long. My new code is 95% contained in its own modules so won't cause me too much pain when it is ready to merge. Module at a time might make it easier to review and reason about, if that's possible. |
Good idea. Then I imagine it would be best to start with extracting the utility functions, and do the |
As soon as PR #1008 settles, put proper static methods (simply any and all methods that don't use the top-level |
So, update: the former main module has been completely dissolved. Now the entry point is 4 lines of code including blank lines, the module containing the Swal class/function is 72, and there are many small modules in The issue was "Split up src/sweetalert2.js" so I think it's fair to say this can be closed |
Great work @zenflow 💪 💪 💪 |
1403 lines of code is wayyyy too much for one module. We have a module bundler set up in our build pipe-line, so lets take advantage of it! All the constant scrolling is killing me when I work on this code. If we split up the code into multiple modules, we can (a) find things faster, and (b) easily work in more than one area at a time.
I don't really care how it's split up, so long as it's reasonable, and so long as it's split up.
Like I mentioned here #865 (comment) it's possible to move code into methods on a
SwalContext
object. I think we should do that, and also extract more utility functions.Is anyone opposed to this? Either in general, or at this specific time? Obviously there will be a lot of code change to review and it could result in merge conflicts, but we can try to get all done quickly and at once.
The text was updated successfully, but these errors were encountered: