-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Migrate our js files away from using jquery #8889
Comments
If anyone wants to help with this, please keep your pull requests simple. Migrate a few related functions, or if a file is simple, just one file. Thanks so much! |
It may not be an easy job, but I appreciate it very much and I can try to help with that. However, I have no previous experience collaborating with open source projects. |
We always appreciate help! I'm happy to help with any issues you have as well. The repository's README has some information on contributing and setting up the site. Usually contributing looks like some mix of forking the repository, making and testing your changes in a local branch, then pushing them to GitHub and opening a pull request. From there one of us will review it and provide feedback in a back and forth process. As for this particular issue, perhaps a good place to start would be a single function (or even a part of one) in the If you'd like to work on that, go for it, and let us know if you have any questions about anything or something doesn't work. |
I already hosted this project locally, I have no problem with it. A good starting point could be this archive.js file you mentioned. My questions now are: PS: Good initiative. As awesome as it is, the Jquery era has long since passed. |
If I'm working on part of an issue, generally what I do is create a pull request against this repository with my changes, then in the pull request description add text like
Yeah, I think that sounds good. We don't support Internet Explorer and all other major browsers have supported it for a while.
Yeah for sure :) - Hopefully this will make our little JS code easier to maintain while also being quicker to download. |
Contributes to #8889 --------- Co-authored-by: Parker Lougheed <parlough@gmail.com>
Soon I'll continue working on this. I feel grateful for give some help. |
@ulisseshen I'll assign you then but take your time :) Thanks again for your help! |
@parlough while I was making some changes to the archive.js file, there is a bit of code that is runs in initial page load. Below a code that I'm talking about: website/src/assets/js/archive.js Lines 246 to 258 in 15bc68f
I belive that the code between line 252 and 257 is not used anymore. I did some test to validate this, it look that is not used. I will not migrate those code betwwen those lines and not funcitons |
Thanks for looking into it! I believe the code you linked to is used on the "Windows install", "macOS install", and similar pages to set up the download buttons for the latest release on those pages. An example is here: https://docs.flutter.dev/get-started/install/windows#get-the-flutter-sdk The source for that button is https://github.com/flutter/website/blob/main/src/get-started/install/_get-sdk-win.md?plain=1#L10 Perhaps we should add some comments to the code to make that more clear, because it is pretty easy to miss. |
You are right. I ended up discovering this while investigating a little more. I will continue then migrating this code and i will make some comments to improve understanding by others in the future |
In many cases JQuey return a list of elements in your selector and when apply any input in those elements selected it do it in all elements at once.
To migrate to pure js have two ways. Considered that will have only a single element and to use For this fase of migration I have considerated that always will be one or more elements. So, I used |
Related with #8889 --------- Co-authored-by: Craig Labenz <craig.labenz@gmail.com> Co-authored-by: Parker Lougheed <parlough@gmail.com>
…0793) Introduces new `{% tabs "save-key" %}` and `{% tab "name" %}` 11ty/Liquid paired shortcodes to add tabs to the site and switches the various tab methods across the site (`codesample` and raw HTML) to use them. The `save-key` parameter is optional and allows syncing of tabs across the site to the same tab. For example, the `darwin-language` key is used to switch all tabs with the same key to either `Swift` or `Objective-C`. The `name` parameter tab is not optional. Both `save-key` and `name` must be in quotes or refer to a Liquid/11ty variable that is a string. The `{% endtab %}` and `{% endtabs %}` closing shortcodes are required to close a tab and a tab menu respectively. **Example:** ````liquid {% tabs "darwin-language" %} {% tab "Swift" %} Some words about the following Swift snippet... ```swift let flutterViewController = FlutterViewController( project: nil, initialRoute: "/onboarding", nibName: nil, bundle: nil) ``` {% endtab %} {% tab "Objective-C" %} Some words about the following Objective-C snippet... ```objc FlutterViewController* flutterViewController = [[FlutterViewController alloc] initWithProject:nil initialRoute:@"/onboarding" nibName:nil bundle:nil]; ``` {% endtab %} {% endtabs %} ```` Resolves #8926 Contributes to #8889 Contributes to #8030
…utter#10793) Introduces new `{% tabs "save-key" %}` and `{% tab "name" %}` 11ty/Liquid paired shortcodes to add tabs to the site and switches the various tab methods across the site (`codesample` and raw HTML) to use them. The `save-key` parameter is optional and allows syncing of tabs across the site to the same tab. For example, the `darwin-language` key is used to switch all tabs with the same key to either `Swift` or `Objective-C`. The `name` parameter tab is not optional. Both `save-key` and `name` must be in quotes or refer to a Liquid/11ty variable that is a string. The `{% endtab %}` and `{% endtabs %}` closing shortcodes are required to close a tab and a tab menu respectively. **Example:** ````liquid {% tabs "darwin-language" %} {% tab "Swift" %} Some words about the following Swift snippet... ```swift let flutterViewController = FlutterViewController( project: nil, initialRoute: "/onboarding", nibName: nil, bundle: nil) ``` {% endtab %} {% tab "Objective-C" %} Some words about the following Objective-C snippet... ```objc FlutterViewController* flutterViewController = [[FlutterViewController alloc] initWithProject:nil initialRoute:@"/onboarding" nibName:nil bundle:nil]; ``` {% endtab %} {% endtabs %} ```` Resolves flutter#8926 Contributes to flutter#8889 Contributes to flutter#8030
Describe the problem
We'd eventually like to stop using jquery, especially since Bootstrap 5 (which we hope to migrate to) no longer requires it.
Expected fix
Migrate all code in https://github.com/flutter/website/tree/main/src/assets/js away from using jquery.
Additional context
No response
The text was updated successfully, but these errors were encountered: