Skip to content
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

Overall improvements #212

Merged
merged 29 commits into from
Mar 1, 2024
Merged

Overall improvements #212

merged 29 commits into from
Mar 1, 2024

Conversation

WarningImHack3r
Copy link
Member

@WarningImHack3r WarningImHack3r commented Feb 11, 2024

Main changes

  • Move SEO stuff (meta tags and JSON LD) to +layout.svelte to avoid duplication and use an inheritance mechanism instead

Note

I'm not a fan of the need to manually tell Inlang which language to use inside load functions, I don't know if it's a bug.
It doesn't alter the behavior of anything, it's just extra verbose for nothing

  • Insanely faster build time and slimmer bundle size by improving image imports, allowing Vite to tree-shake module transformation
    • ~5x faster build time (50s ➜ <10s)
    • ~8x less modules to transform (4k ➜ 500)
  • Use tailwind-merge instead of a dirty manual concatenation within components
  • Improve hero
    • Fix the unreliable positioning of the background
    • Apply the same fix for the magnetic arrow (see 836b8c4)
    • Remove the need for 2 separate texts for the title and subtitle
    • Improve large screens positioning
  • Fix SlideOver not being dismissable with a click outside
  • Fix navbar elements jumping on load

Other changes

  • Add a new Husky hook for checking lint before committing (not a fan of the whole eslint . at each commit though)
  • Move Inlang back to its separate Renovate group (as long as the SvelteKit adapter is 0.x at least)
  • Use text-pretty on all main <p>s we got for a nicer look
  • Slightly tweak hero's 3D positioning
  • Disable scroll-smooth on navigation
  • Remove useless goto()s in favor of direct <a> tags (little follow-up of Convert buttons to links automatically for better accessibility #205)
  • Fix navbar links never being detected as active because of the new Inlang URL format (not visible for now)
  • Replace <slot /> by props for Section's title
  • Improve styling in the left part of the hero
  • Improve contact page markup
  • Fix responsive of the footer's logo
  • Improve SlideOver:
    • Improve callback handling (I love the way I managed to fix that)
    • Fix "undefined" in the DOM
    • Fix useless use of svelte:fragment
  • Improve sitemap.xml, allowing for a cleaner code and the removal of @types/node
  • Dynamize robots.txt, allowing us to use the ROOT_URL variable instead of hardcoding it
  • Add 2 cool ESLint rules (I don't know if the first one is relevant for this project but I'm used to putting it everywhere)
  • And some other very minor tweaks

Things I wish I could fix

  • The 404/error page still never showing (GitHub's default 404 takes the lead), but despite docs, forums and multiple attempts (I didn't give it another try for this PR), I cannot make it work

@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 11, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 11, 2024
10x faster build time
8x less modules to transform
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 16, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 16, 2024
- Improve callback handling (in a very smart way tbh)
- Fix click outside not closing it
- Fix "undefined" in the DOM
- Fix useless use of svelte:fragment
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 16, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 16, 2024
Copy link
Member Author

@WarningImHack3r WarningImHack3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation of that very special component communication mechanism. It allows for a JS callback, within the markup, without any content in the <script> tag.
I don't know what we can do with the let: syntax, but we might even be able to bind something from the +page's <script> to the prop, allowing for an in-place regular callback usage.

*/
export let afterClose: () => void = () => {};
const onCloseStore = writable(() => {});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Creating a store that contains a function, initialized with nothing

</div>
{/if}
<div class="-my-6 h-full">
<slot onClose={onCloseStore} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Passing it as a slot prop, so we can use the let: directive

{item.name}
</button>
{/each}
<SlideOver bind:show={showSlideOver} let:onClose>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Get the store as a prop

on:click={() => {
slideOverCloseCallback = () => goto("/contact");
onClose.set(async () => {
Copy link
Member Author

@WarningImHack3r WarningImHack3r Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Set it to any value we want inside the callback (a simple function wouldn't be editable otherwise, we can't even use the $onClose = () => {} syntax)

leave="ease-in-out duration-500 sm:duration-700"
leaveFrom="translate-x-0"
leaveTo="translate-x-full"
on:outroend={$onCloseStore}
Copy link
Member Author

@WarningImHack3r WarningImHack3r Feb 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Finally, execute the store's function whenever we want on the parent component, with our custom content!
    (Short for on:outroend={() => $onCloseStore()})

@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 16, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 16, 2024
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 16, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 16, 2024
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 18, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 18, 2024
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 18, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 18, 2024
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 19, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 19, 2024
Use absolute instead of junky negative margins, fixing every issue it had. Same change for the magnetic arrow.
For the hero content (text and right art), define its size to 80svh, which is enough to make it feel centered without having any impact on neither the magnetic arrow nor the background.
@WarningImHack3r WarningImHack3r marked this pull request as ready for review February 19, 2024 22:35
@WarningImHack3r WarningImHack3r requested a review from a team as a code owner February 19, 2024 22:35
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 19, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 19, 2024
- Remove the need for 2 texts for title and subtitle
- Improve background sizing
- Improve and fix magnetic arrow positioning
@github-actions github-actions bot changed the title Overall improvements infra: Overall improvements Feb 22, 2024
@WarningImHack3r WarningImHack3r changed the title infra: Overall improvements Overall improvements Feb 22, 2024
- Remove 2 unnecessary goto in favor of "a" tags
- Fix logic of detecting active link with the new Inlang paths
@WarningImHack3r WarningImHack3r merged commit 9ff774f into main Mar 1, 2024
7 checks passed
@WarningImHack3r WarningImHack3r deleted the overall-improvements branch March 1, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants