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

fix: bug with CSS nesting adding semi colons after rule declarations #9343

Closed
wants to merge 72 commits into from

Conversation

AlbertMarashi
Copy link

Fixes

Critical usability bug: #9320
Partial implementation of CSS nesting #8587

Currently, I am not checking for used & unused CSS nesting selectors, so this PR merely fixes the bugs to enable use of CSS nesting and the code has room for improvement.

I had a lot of trouble and difficulty actually trying to figure out if CSS classes were being used so I abandoned it and just opted to at least fix the bugs preventing their use

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

@changeset-bot
Copy link

changeset-bot bot commented Oct 20, 2023

🦋 Changeset detected

Latest commit: bd2a586

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

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

@AlbertMarashi
Copy link
Author

Not sure if I was supposed to update the package version

@benmccann
Copy link
Member

Svelte 5 has a completely new CSS implementation, so unfortunately we wouldn't be able to merge this PR into the Svelte 5 code base. Svelte 5 doesn't yet support nested CSS. It should, but in addition to parsing, the compiler needs to understand what nesting means, so we've got a little work to do to enable it there

@AlbertMarashi
Copy link
Author

@benmccann where can I find the source code for svelte 5 so I can have a go at implementing nesting?

@benmccann
Copy link
Member

It's not public quite yet. It will be soon

@AlbertMarashi
Copy link
Author

It's not public quite yet. It will be soon

I would like to contribute to implement nesting for Svelte 5. Can I get involved as I consider this a relatively important feature

dummdidumm and others added 10 commits November 10, 2023 15:48
Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Simon Holthausen <[email protected]>
Co-authored-by: Dominic Gannaway <[email protected]>
* lets see if this works

* fix versions

* sigh

* debugging ci is sooo fun

* oh wow

* fix stuff, changelog, add back readme

* appease prettier

* format stuff
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* exclude internal props from spread attributes

* changeset

* tighten up

---------

Co-authored-by: Rich Harris <[email protected]>
* simplify a whole bunch of stuff

* delete more unused stuff

* fix diagnostics

* prettier

---------

Co-authored-by: Rich Harris <[email protected]>
@benmccann
Copy link
Member

Thanks @AlbertMarashi! That would be great! The code for Svelte 5 is now available on main, and we'd welcome any contributions!

Rich-Harris and others added 12 commits November 11, 2023 09:18
* fix runes mode indicator

* tidy up

---------

Co-authored-by: Rich Harris <[email protected]>
* add snippet symbol to children prop

* fix error message for snippet validation

* changeset
* chore: update PR template

* Update .github/PULL_REQUEST_TEMPLATE.md

---------

Co-authored-by: Rich Harris <[email protected]>
* enable dev mode for preview repl

* format

* also add dev mode toggle for compiler options

* whoops
…veltejs#9413)

I came to the conclusion that when we're making up arbitrary types, we might as well keep the old class. That way:
- one less thing to worry about (language tools and other tooling basically can continue to spit out SvelteComponent )
- we can more clearly mark $set , the constructor etc as being deprecated and no longer functioning unless you use that legacy compatibility mode
- much more ergonomic to type for the user:
  - const someInstance: SvelteComponent<..> instead of const someInstance: ReturnType<typeof Component<..>>
  - If you're using generics, you can do export class MyComponent<T> extends SvelteComponent<{ prop: T }> {} instead of having to type out the whole function in a way that I'm not even sure how to do with generics
* chore: add missing svelte/transition functions

* lint
* fix: correctly handle index within each block updates

* changeset
* Split $.each into $.each_keyed/$.each_indexed

* Add changeset

* Update .changeset/quiet-camels-mate.md

* Fix typo

---------

Co-authored-by: Simon H <[email protected]>
* Fix runtime effect issues

* Prettier

* Add changeset

* Fix operations

* Update .changeset/khaki-mails-draw.md

* more tweaks

* more tweaks

---------

Co-authored-by: Simon H <[email protected]>
* chore: remove selector api
* fix tsconfig.json

* prettier

* another apparently-necessary fix

---------

Co-authored-by: Rich Harris <[email protected]>
trueadm and others added 26 commits November 15, 2023 15:20
* chore: improve code size of transitions

* Add changeset
* enforce treeshakeability

* fix

* appease the dweeby little hall monitor

---------

Co-authored-by: Rich Harris <[email protected]>
* fix

* add changeset

* Update .changeset/eighty-bikes-camp.md

Co-authored-by: Ben McCann <[email protected]>

* Update .changeset/eighty-bikes-camp.md

---------

Co-authored-by: Ben McCann <[email protected]>
Co-authored-by: Rich Harris <[email protected]>
when options are added later, we need to ensure the select value still stays in sync
fixes sveltejs#9412
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Revert "fix: address bug in before/after update (sveltejs#9448)"

This reverts commit 9eb969d.

* add changeset
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* failing test for sveltejs#9499

* limit export handling to instance context

* changeset

---------

Co-authored-by: Rich Harris <[email protected]>
* fix: add missing visit for expressions

* fix: add missing visit for expressions

* Add test
* fix: address unowned propagation signal issue

* Add comments
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
)

* fix: stop propagating global intros

* fix: stop propagating global intros

* add test
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* chore: opt for two signal data-structures to reduce memory usage
* fix: address intro transition bugs

* fix: address intro transition bugs
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* chore: rename internal object properties

chore: rename internal object properties

order properties and add comments

add missing remove_in_transitions

* jsdoc
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link

vercel bot commented Nov 20, 2023

@trueadm is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@AlbertMarashi
Copy link
Author

Closing in favour of #9549

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.