fix: Replace slugify in deploy-preview-netlify with simple regex solution #1543
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
4 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#1543
Loading…
Reference in New Issue
No description provided.
Delete Branch "saibotk/frontend:fix/netlify-preview-slugs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit removes the direct dependency on the "slugify" package, since it produces slugs, which are still invalid to be used as subdomain names.
We now use a custom RegEx scheme which just replaces all white spaces, dots and slashes with a "-" sign for readability and removes all otherwise invalid characters.
To account for specific language characters or unicode variants we first normalize it using the String.prototype.normalize() function, so we can preserve as much characters as possible.
Additionally, we now make sure that our alias is not longer than 37 characters, which is the maximum alias length according to Netlify's documentation 0
Fixes #1058
Example/comparison:
Replace slugify with simple regex solutionto deploy-preview-netlify: Replace slugify with simple regex solutiondeploy-preview-netlify: Replace slugify with simple regex solutionto fix: Replace slugify in deploy-preview-netlify with simple regex solutionce8500a640
toa33e1e45bc
Hi saibotk!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://1543-fix-netlify-preview-slugs--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
Nice, thanks! =)
From my side this is good as long as it works better than now (which is basically not :D).
One little thing:
@saibotk Maybe you can add the relevant comments from above directly in the file for future reference.
Replacing dependencies is always great! Thanks!