Skip to content

Conversation

@Orpheus-3145
Copy link
Contributor

@Orpheus-3145 Orpheus-3145 commented May 2, 2025

The fiddle data (code files, title, ...) previously encoded and stored inside a URL parameter, is now stored in a fragment; main changes:

  1. fragment is updated everytime there is a change in the editor, a favourite or an example in selected, or a new file is created
  2. removed [[id]] directory since there are no parameters anymore, 'merged' together files /[[id]]/+layout.svelte and /+layout.svelte
  3. pressing 'share' now just stores the URL in the clipboard, it doesn't update it (since it's not necessary)
  4. removed /+layout.ts: the handling of fiddle data has been moved in its currespondant +layout.svelte

@coder0107git
Copy link

From what I can tell, the old URLs aren't migrated to the new format. Is this intended? If so, I better quickly backup my links so I can fix them when they break.

@alexp-sssup
Copy link
Member

Good point. @Orpheus-3145 please add logic to support the old link format, while never generating new ones in that style

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 6, 2025

Deploying javafiddle with  Cloudflare Pages  Cloudflare Pages

Latest commit: 47e89ce
Status: ✅  Deploy successful!
Preview URL: https://e1f75204.javafiddle.pages.dev
Branch Preview URL: https://fixurl.javafiddle.pages.dev

View logs

@Orpheus-3145
Copy link
Contributor Author

support for legacy URLs added

@Orpheus-3145 Orpheus-3145 requested a review from alexp-sssup May 6, 2025 13:04
Copy link
Member

@saarikoski-jules saarikoski-jules left a comment

Choose a reason for hiding this comment

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

I've left a bunch of cosmetic and review ease related comments. Please address those, do some general cleanup and structure your commits in a way where each commit contains minimal updates on the same change and is it's own logical whole. If you're also copying code for the original url handling, you should just originally keep that functionality in the code base, rather than deleting it and then adding it back.

updated: $fiddleUpdated,
files: $files
});
Copy link
Member

Choose a reason for hiding this comment

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

Avoid unnecessary changes like these

@@ -0,0 +1,32 @@
import { decompress, type Fiddle } from '$lib/compress-fiddle.js';
Copy link
Member

Choose a reason for hiding this comment

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

It would simplify review and improve history if you made your changes to this file in one commit and renamed it in another one. Please also do the same for other applicable cases

import { favouriteIndex, favourites, fiddleTitle, fiddleUpdated, files } from '../state';
import { onNavigate } from '$app/navigation';
Copy link
Member

Choose a reason for hiding this comment

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

Why is this line changed? Is there some spurious white space character here?

@@ -1,32 +1,17 @@
import { decompress, type Fiddle } from '$lib/compress-fiddle.js';
// import { decompress, type Fiddle, defaultFiddle } from '$lib/compress-fiddle.js';
Copy link
Member

Choose a reason for hiding this comment

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

Don't leave around commented out code

});
$favouriteIndex = index;
// update URL with fragment
const fiddleFragmentURL = compress($favourites[index]);
Copy link
Member

Choose a reason for hiding this comment

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

I don't see why the order of these lines has changed, it shouln't make a logical difference if I'm not wrong

Copy link
Member

@saarikoski-jules saarikoski-jules left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, a few small things. While you're at it, would you remove the console.log that occurs on every key input (you can do it in a new commit since its unrelated)

Copy link
Member

@saarikoski-jules saarikoski-jules left a comment

Choose a reason for hiding this comment

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

@alexp-sssup This pr is ready for your final review

@alexp-sssup alexp-sssup merged commit 780c736 into main May 8, 2025
1 check passed
@Orpheus-3145 Orpheus-3145 deleted the fixURL branch June 26, 2025 08:52
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.

5 participants