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

feat: auto-open a tbody when we detect we need it #12628

Closed
wants to merge 8 commits into from

Conversation

dummdidumm
Copy link
Member

WIP because it currently fails because the dom walking mechanism needs to know that it should walk differently in that case

Svelte 5 rewrite

Please note that the Svelte codebase is currently being rewritten for Svelte 5. Changes should target Svelte 5, which lives on the default branch (main).

If your PR concerns Svelte 4 (including updates to svelte.dev.docs), please ensure the base branch is svelte-4 and not main.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests and linting

  • Run the tests with pnpm test and lint the project with pnpm lint

- relax validation in some places where we know the HTML will not break or only break when using SSR
- consolidate validation in one place and for better reuse, which results in more cases getting caught at runtime

closes #11941
…ly fails because the dom walking mechanism needs to know that it should walk differently in that case
Copy link

changeset-bot bot commented Jul 26, 2024

⚠️ No Changeset found

Latest commit: f76e5a1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@FoHoOV
Copy link
Contributor

FoHoOV commented Jul 28, 2024

IMHO its better when I know I did something wrong to go and fix it, rather than it being automatically fixed and me not knowing it. If this is the chosen direction of things, can we have warning when svelte repairs markup?

  1. current behavior when I immediatly know I did something wrong.
  2. this PRs behavior when everything just works and we don't get a warning or anything

IMHO this is the lands of unkown magic where harry potter lives :D

code vercel-isr-server-route/
@Rich-Harris
Copy link
Member

Having thought through this a bit more I've changed my tune — there's too much scope for ambiguity. Like, if I have something like this...

<table>
  <tr>...</tr>
  {#each things as thing}
    <tr>...</tr>
  {/each}
  <tr>...</tr>
</table>

...where do the <tbody> and </tbody> go? So I too come down on the side of forcing the developer to be explicit. I might go so far as to say that cases that are currently just warnings, like a <tr> inside an {#each ...} inside a <table>, should instead be errors

@dummdidumm
Copy link
Member Author

They are only warnings because it won't cause DOM repairing when you're not using SSR. In case you do, it will fail with an explicit error on SSR at runtime.

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.

3 participants