This week, I did some some maintenance work on Starchart. The project hasn't been worked on in a while so we're trying to update it's dependencies.
DevelopingSpace
/
starchart
A self-serve tool for managing custom domains and certificates
Starchart
Starchart makes it easy for the Seneca developer community to create and manage their own custom subdomains and SSL certificates, without cost or having to provide personal information.
For information about running Starchart, see our deployment guide. For development information, see our contributing guide. For further technical background, planning, and initial designs, please see the wiki.
Introduction
The internet is evolving, and what used to be hard has become simple. For example, hosting your own website used to require knowledge of server administration, operating systems, networking, etc. Today, many developers host their personal and project websites without ever touching a remote server, opting for (free) cloud services like GitHub Pages, Vercel, Netlify, or AWS.
The internet's security model is also evolving. For example, browser vendors have embraced HTTPS everywhere. This is good for security, as it enables certificate-based encryption between clients and servers. However, as with…
The plan was to fix the CI workflow, which we found out was broken last week:
But before I could work out a fix, one of the previous developers, Eakam, solved the issue - turns out it was just because Playwright was outdated.
Bump playwright to 1.49.1
#772

Playwright install is failing in CI (E2E Tests). Bumping playwright version should fix that.
Ref:
I felt like I should make up for it by finding more stuff to work on and thought updating more dependencies would be a great starting point.
Since the project hadn't been worked on for 2 years, there were a bunch of security vulnerabilities stemming from outdated packages. I was able to fix most of them with npm audit fix.
There were a couple more fixes that led to breaking changes in @remix-run/eslint-config and @remix-run/react, so I bumped those manually.
One of the updates (I bumped them at the same time so I can't say for sure but my bet is on /react) led to a type-check error because [@remix-run/react].useNavigation().formData may now be of the type undefined. I fixed it with optional chaining.
// Before const isLoading = navigation.state === 'submitting' && Number(navigation.formData.get('id')) === dnsRecord.id; // After const isLoading = navigation.state === 'submitting' && Number(navigation.formData?.get('id')) === dnsRecord.id;
The other changes I made had to do with some lint errors that popped up (At this point I realized I had my ESLint extension turned off, but I'm sure these warnings came with the update, since it never happened in CI in the past).
- Instances of importing the same module multiple times in one file:
// Before import { getCertificateByUsername } from '~/models/certificate.server'; import { deleteCertificateById } from '~/models/certificate.server'; import { isAdmin } from '~/models/user.server'; import { getUserByUsername } from '~/models/user.server'; // After import { getCertificateByUsername, deleteCertificateById } from '~/models/certificate.server'; import { isAdmin, getUserByUsername } from '~/models/user.server';
- Using let when const is preferred:
// Before let date = val.toLocaleDateString('en-US', { // After const date = val.toLocaleDateString('en-US', {
Surprised it didn't catch these before.
Also, when I turned on the ESLint extension I was a little taken aback because there were ~900 linter errors. Turned out it was because ESLint was linting the output generated by Playwright. So I added /playwright-report to .eslintignore.
And that was the sum of my maintenance work for this sprint. Ended up fixing 30 severe security issues, so not bad.
Update dependencies
#775

Should fix a bunch of security vulnerabilities.
Changes
- [x] Bump dependencies
- [x] Add /playwright-report to .eslintignore
- [x] Fix typecheck and linter errors
I also re-activated Dependabot which bumped vitest a couple minor versions. It'll be nice to not have to manually investigate and patch security vulnerabilities.
In other news, one of my pull requests to Mattermost was finally merged!
[GH-29548] Avoid SELECT * in `tokens_store.go`
#29558

Summary
This PR:
- Switches SQL queries in token_store.go to use SQLBuilder
- Explicitly defines columns in SELECT queries to TokenStore.
- Factors out common queries into the constructor.
Ticket Link
Fixes #29548
Screenshots
Release Note
// Before const isLoading = navigation.state === 'submitting' && Number(navigation.formData.get('id')) === dnsRecord.id; // After const isLoading = navigation.state === 'submitting' && Number(navigation.formData?.get('id')) === dnsRecord.id;
It'd been approved a while ago but it took a few weeks to be merged into main.
In the meantime I've been working on my other PR. I was asked to make some changes and I'm waiting on a re-review.
[MM-53650] Add disable emoticon rendering setting to webapp
#29414

Summary
This pull request adds a user setting to the webapp to toggle rendering emoticons (:D) as emojis (?).
The setting is added as a component in components/user_settings/display/render_emoticons_as_emoji/ which is imported in components/user_settings/display/user_settings_display.tsx.
I've added a renderOnOffLabel() function to user_settings_display.tsx, lifted from components/user_settings/advanced/user_settings_advanced.tsx to help render the new component.
The setting is stored as a user preference using the savePreferences() action.
I've added constants for the preference to utils/constants.tsx and webapp/channels/src/packages/mattermost-redux/src/constants/preferences.ts.
To actually use the setting, I've modified components/post_markdown to receive it's value as a prop, for which I've used getBool() and added a default value to the config. post_markdown passes this value down to Markdown on the options object, which then passes it down to utils/text_formatting.tsx, which finally passes the value to emoticons.tsx as a newly added parameter. emoticons.tsx checks whether the value is true and if it is, it transforms the emoticons into emojis.
I've updated affected tests and created unit tests for the new component. I've also updated the English translation file.
QA Test Steps
- Navigate to User Settings.
- Go to the Display category.
- Find the section labelled "Auto-render emoticons as emoji" and click "Edit".
- Toggle the setting and click "Save".
- Emoticon rendering on messages sent by the current user and other users should be toggled client-side with the setting.
Ticket Link
Fixes (partially) https://github.com/mattermost/mattermost/issues/26504 Jira https://mattermost.atlassian.net/browse/MM-53650
Note the issue and ticket describe adding this feature to the mobile app as well, which this PR does not.
Screenshots
before | after |
---|---|
![]() |
![]() |
Release Note
// Before const isLoading = navigation.state === 'submitting' && Number(navigation.formData.get('id')) === dnsRecord.id; // After const isLoading = navigation.state === 'submitting' && Number(navigation.formData?.get('id')) === dnsRecord.id;
Working on this PR was interesting because when I first submitted it I didn't even entirely understand my changes. Going back into it after a long while away and with the feedback from the reviews helped me look at it from a fresh perspective and understand it better.
The Mattermost app gets user setting state from both "preferences" and from a "config". I added my setting to both, mimicking one of the existing settings I was advised to reference, but it turned out the "config" is for server-level settings, while this new setting was intended to be a client-side option. The reviews helped me understand where I went wrong, and it actually ended up being a smaller change than I thought necessary.
Overall I'd say it was a fairly productive week.
The above is the detailed content of Reviving An Outdated Project. For more information, please follow other related articles on the PHP Chinese website!

JavaScript core data types are consistent in browsers and Node.js, but are handled differently from the extra types. 1) The global object is window in the browser and global in Node.js. 2) Node.js' unique Buffer object, used to process binary data. 3) There are also differences in performance and time processing, and the code needs to be adjusted according to the environment.

JavaScriptusestwotypesofcomments:single-line(//)andmulti-line(//).1)Use//forquicknotesorsingle-lineexplanations.2)Use//forlongerexplanationsorcommentingoutblocksofcode.Commentsshouldexplainthe'why',notthe'what',andbeplacedabovetherelevantcodeforclari

The main difference between Python and JavaScript is the type system and application scenarios. 1. Python uses dynamic types, suitable for scientific computing and data analysis. 2. JavaScript adopts weak types and is widely used in front-end and full-stack development. The two have their own advantages in asynchronous programming and performance optimization, and should be decided according to project requirements when choosing.

Whether to choose Python or JavaScript depends on the project type: 1) Choose Python for data science and automation tasks; 2) Choose JavaScript for front-end and full-stack development. Python is favored for its powerful library in data processing and automation, while JavaScript is indispensable for its advantages in web interaction and full-stack development.

Python and JavaScript each have their own advantages, and the choice depends on project needs and personal preferences. 1. Python is easy to learn, with concise syntax, suitable for data science and back-end development, but has a slow execution speed. 2. JavaScript is everywhere in front-end development and has strong asynchronous programming capabilities. Node.js makes it suitable for full-stack development, but the syntax may be complex and error-prone.

JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1
Powerful PHP integrated development environment

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
