-
-
Notifications
You must be signed in to change notification settings - Fork 233
[1.1.8] Implement an opt-in improved JS framework (Snowboard) #401
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Represents the entire current state of the Snowboard framework.
4 tasks
LukeTowers
requested changes
Jan 19, 2022
This can be done per request through the options, or via a global event.
Don't seem to be working at the moment - will look into it later.
Member
|
@bennothommo is the workshop-theme up to date with the latest changes? |
LukeTowers
reviewed
Jan 19, 2022
LukeTowers
reviewed
Jan 19, 2022
Member
Author
I believe so :) |
LukeTowers
reviewed
Jan 20, 2022
LukeTowers
reviewed
Jan 20, 2022
* develop: (25 commits) Use the asset helper for static assets Added asset filter & function versions of all System Twig filters (#428) Improve Japanese Translation (#435) Improved Latvian translation (#434) Improved Ukrainian translation (#433) Redirect to the myaccount page as a final fallback Improve Persian translations (#423) typo fix (#424) Improved Russian translation (#422) Tidy up Style fix Go to User's details page when clicking on related user from the roles update page Update recommend format for implementing controller behaviors Add support for default configuration file names for controller behaviors Attach default permissions to the publisher role Only show role user management in the update context Improve UserRole editing experience Fix support for readOnly on the datepicker formwidget. Sort assets alphabetically in the CMS Theme Editor (#420) VSCode recommended extensions (#417) ...
Member
|
comment moved to #440 |
Closed
…ules, themes, & plugins.
… so this it was unnecessary.
Also added additional checks to improve developer experience when running the commands.
Co-authored-by: Ben Thomson <[email protected]>
Co-authored-by: Ben Thomson <[email protected]>
Add automatic package registration and improved installation to Laravel Mix support
LukeTowers
approved these changes
Feb 15, 2022
LukeTowers
added a commit
to wintercms/docs
that referenced
this pull request
Feb 15, 2022
Framework rewrite documentation for wintercms/winter#401
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documentation: wintercms/docs#45
This PR moves towards introducing a new JavaScript framework for Winter, that uses modern JavaScript and removes the hard-dependency to jQuery that has traditionally been the case with Winter and October before it.
If accepted, we intend to make this opt-in, and still provide the option of using the original framework for legacy apps and older browser support.
Goals
Concepts
The four cornerstones of this framework are as follows:
The
SnowboardclassRepresents the global container for the application. This stores all activated plugins and provides instances of these modules as required. It is synonymous with the
Applicationclass of Laravel, or aVueinstance.The
PluginLoaderclassThe main conduit between a plugin and the Snowboard app. This provides the mechanism for delivering instances of each module (or a single instance of Singleton plugin) and resolves dependencies.
The
PluginBaseclassA plugin is a specific extension to the Snowboard application. It can contain code that provides new functionality or augments other functionality already registered in the application. A plugin can be reused - in essence, each call to the plugin will create a new instance and will be independent from other instances. This would be used for scenarios such as Flash messages, AJAX requests and the like.
The
SingletonclassAn extension of the
PluginBaseclass. It signifies to the application that this plugin should exist once, and all uses of this plugin should use the same instance. This would be useful for things like event handlers, extending functionality of another plugin or global functionality.A singleton is initialized automatically when the DOM is ready, if it is called directly or if it listens to an event that is fired. The singleton instance is then used no matter how many times it is called from the Snowboard class.
What's included
By default, this framework only includes the framework architecture and a couple of utilities. This is an intentional choice to allow the greatest flexibility in how the framework is used. The utilities include:
Vue.newTickfunction in allowing code to run after the previous frame is rendered - useful for ensuring DOM changes are made and events are correctly fired.In addition, some opt-in features include a rewritten
Requestclass that represents a fresh take on the JavaScript AJAX framework available in Winter. This newRequestclass leverages thefetchmethod in all modern browsers to conduct AJAX calls. It supports all options and configuration that were previously available in the original framework.A second extension -
AttributeRequest- provides an augmentation to this functionality and allow the AJAX framework to also handle AJAX calls that use thedata-attributes. By separating these features, the developer has the ability to turn off support for thedata-attribute AJAX framework should they not need it.What's not included
data-attribute callbacks (eg.data-request-success,data-request-erroretc.). This feature, at a minimum, prevented sites using content security policies because of its use of theeval()method in JavaScript - at worst, it presented a potential vector for naughtiness. We will not be including this in the framework.Further notes
To-do