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

Style HTML tag #467

Merged
merged 5 commits into from
May 1, 2024
Merged

Style HTML tag #467

merged 5 commits into from
May 1, 2024

Conversation

pedrobslisboa
Copy link
Collaborator

@pedrobslisboa pedrobslisboa commented Apr 21, 2024

Why

As mentioned by @purefunctor it would be nice to have full SSR support on styled-ppx:
image

That way the user doesn't need to create a function to handle it and it will work out of the box by the library.

How

  • Deprecating render_style_tag since it doesn't render a tag but the style rules;
    • This avoids breaking change needs.
  • Creating get_string_style_rules based on render_style_tag;
  • Creating get_string_style_hashes to get all hashes;
  • Creating the render_style_html_tag to deliver a full SSR-supported style tag.
    • Example: <style data-s data-emotion="css className1">.css-className1 { display: block; }</style>

Attention, this branch is a extension of this one: #468

Screenshot

The screenshot below shows how the emotion handles it well, only creating on client size only client styles the universal styles were not recreated.

Captura de Tela 2024-04-25 às 14 54 14

Copy link

vercel bot commented Apr 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
styled-ppx ⬜️ Ignored (Inspect) Visit Preview Apr 29, 2024 6:41pm

Copy link
Owner

@davesnx davesnx left a comment

Choose a reason for hiding this comment

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

Thanks for doing this, it's a great improvemenet

Comment on lines 11 to 28

let one_property () =
let className = CssJs.style [| CssJs.display `block |] in
let css = render_style_html_tag () in
assert_string css
(Printf.sprintf
"<style data-s data-emotion=\"css %s\">.%s { display: block; }</style>"
className className)

let multiple_properties () =
let className =
CssJs.style [| CssJs.display `block; CssJs.fontSize (`px 10) |]
in
let css = render_style_html_tag () in
assert_string css
(Printf.sprintf
"<style data-s data-emotion=\"css %s\">.%s { display: block; font-size: \
10px; }</style>"
Copy link
Owner

Choose a reason for hiding this comment

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

We might not need the same tests cases as test_css_js_styles and we can live with one simple case and a "real world" example.

Comment on lines 343 to 368
Stylesheet.get_all instance
|> List.fold_left
(fun (prevDataEmotion, prevStyles) (hash, rules) ->
match rules with
| Classnames rules ->
let rules =
pp_rules hash rules
|> Printf.sprintf "%s %s" prevStyles
|> String.trim
in
let dataEmotion =
Printf.sprintf "%s %s" prevDataEmotion hash |> String.trim
in
dataEmotion, rules
| Keyframes keyframes ->
let rules =
pp_keyframes hash keyframes
|> Printf.sprintf "%s %s" prevStyles
|> String.trim
in
let dataEmotion =
Printf.sprintf "%s %s" prevDataEmotion hash |> String.trim
in
dataEmotion, rules)
("css", "")
|> (fun (dataEmotion, styles) ->
Copy link
Owner

Choose a reason for hiding this comment

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

Can you use render_style_tag inside render_style_html_tag?

Copy link
Collaborator Author

@pedrobslisboa pedrobslisboa Apr 23, 2024

Choose a reason for hiding this comment

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

Hey @davesnx thank you for the review, to use the render_style_tag we would need something like this:

(** Deprecated: Use get_string_style_rules instead*)
let render_style_tag () =
  Stylesheet.get_all instance
  |> List.fold_left
       (fun accumulator (hash, rules) ->
         match rules with
         | Classnames rules ->
           let rules = pp_rules hash rules |> String.trim in
           Printf.sprintf "%s %s" accumulator rules
         | Keyframes keyframes ->
           let rules = pp_keyframes hash keyframes |> String.trim in
           Printf.sprintf "%s %s" accumulator rules)
       ""
  |> String.trim

let get_string_style_rules = render_style_tag

let get_string_style_hashes () =
  Stylesheet.get_all instance
  |> List.fold_left
       (fun accumulator (hash, _) ->
         Printf.sprintf "%s %s" accumulator hash |> String.trim)
       ""

let render_style_html_tag () =
  Printf.sprintf "<style data-s data-emotion=\"css %s\">%s</style>"
    (get_string_style_hashes ()) (get_string_style_rules ())

WDYT?

I'm also trying to define a better name for those functions, any idea about it?

Comment on lines 8 to 9
Test_css_js_tag.tests;
Test_css_tag.tests;
Copy link
Owner

Choose a reason for hiding this comment

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

Having both tests is a bit unnecessary, I would only keep one

@purefunctor
Copy link

This looks good so far! Though, there's one quirk about the style tag rendering that I misspoke about in the screenshot above. The expected output should actually look like this:

<style data-emotion="css id123-someName" data-s>
  .css-id123-someName { }
</style>

Basically, the IDs used in data-emotion should not have the css- prefix. Also, to keep consistent with emotion's client-side behaviour maybe data-s could go second?

To my knowledge, Stylesheet.get_all already returns names prefixed with css-, so the only way to extract the IDs is to mechanically chop the prefix, which works, but is a little unsafe. Thoughts, @davesnx?

@davesnx
Copy link
Owner

davesnx commented Apr 23, 2024

Probably best to add the prefix where it matters only, and render here without any change.

Do you know why emotion doesn't need the "css-" prefix here?

@pedrobslisboa
Copy link
Collaborator Author

This looks good so far! Though, there's one quirk about the style tag rendering that I misspoke about in the screenshot above. The expected output should actually look like this:

<style data-emotion="css id123-someName" data-s>
  .css-id123-someName { }
</style>

Basically, the IDs used in data-emotion should not have the css- prefix. Also, to keep consistent with emotion's client-side behaviour maybe data-s could go second?

To my knowledge, Stylesheet.get_all already returns names prefixed with css-, so the only way to extract the IDs is to mechanically chop the prefix, which works, but is a little unsafe. Thoughts, @davesnx?

@purefunctor What about the animation- prefix? Does it need to be removed?

@purefunctor
Copy link

Do you know why emotion doesn't need the "css-" prefix here?

I'm not entirely sure myself, maybe it's just how emotion encodes it? Ultimately it sees the prefix already as the first word under data-emotion.

What about the animation- prefix? Does it need to be removed?

Not sure as well, it's be good to check but I won't be able to until tomorrow!

@pedrobslisboa
Copy link
Collaborator Author

pedrobslisboa commented Apr 23, 2024

Probably best to add the prefix where it matters only, and render here without any change.

Do you know why emotion doesn't need the "css-" prefix here?

Were you talking about something like this?

- let pp_keyframes hash keyframes =
+ let pp_keyframes preffix hash keyframes =
   let pp_keyframe (percentage, rules) =
     Printf.sprintf "%i%% { %s }" percentage (render_declarations rules)
   in
   let definition = keyframes |> List.map pp_keyframe |> String.concat " " in
-  Printf.sprintf "@keyframes %s { %s }" hash definition
+  Printf.sprintf "@keyframes %s-%s { %s }" preffix hash definition

(* ... *)

(* `resolved_rule` here means to print valid CSS, selectors are nested
   and properties aren't autoprefixed. This function transforms into correct CSS. *)
- let pp_rules hash rules =
+ let pp_keyframes preffix hash keyframes =
   (* TODO: Refactor with partition or partition_map. List.filter_map is error prone.
      Ss might need to respect the order of definition, and this breaks the order *)
   let list_of_rules = rules |> resolve_selectors in
   let declarations =
     list_of_rules
     |> List.map Autoprefixer.prefix
     |> List.flatten
     |> List.filter_map render_declaration
     |> String.concat " "
-    |> fun all -> Printf.sprintf ".%s { %s }" hash all
+    |> Printf.sprintf "@keyframes %s-%s { %s }" preffix hash definition
   in

(* ... *)

- let render_hash prefix hash styles =
+ let render_hash hash styles =
    let is_label = function D ("label", value) -> Some value | _ -> None in
    match List.find_map is_label styles with
-   | None -> Printf.sprintf "%s-%s" prefix hash
-   | Some label -> Printf.sprintf "%s-%s-%s" prefix hash label
+   | None -> Printf.sprintf "%s" hash
+   | Some label -> Printf.sprintf "%s-%s" hash label

let style (styles : rule list) =
  match styles with
  | [] -> ""
  | _ ->
+    let type_ = "css"
     let hash = Emotion_hash.Hash.default (rules_to_string styles) in
-    let className = render_hash "css" hash styles in
+    let className = render_hash hash styles in
     Stylesheet.push instance (type_, className, Classnames styles);
-    className
+    Printf.sprintf "%s-%s" type_ className

let keyframes (keyframes : (int * rule list) list) =
  match keyframes with
  | [] -> ""
  | _ ->
+  let type_ = "animation"
    let hash = Emotion_hash.Hash.default (keyframes_to_string keyframes) in
    Stylesheet.push instance (type_, hash, Keyframes keyframes);
-   animationName
+  "Printf.sprintf "%s-%s" type_ animationName

let get_style_rules () =
  Stylesheet.get_all instance
  |> List.fold_left
        (fun accumulator (type_, hash, rules) ->
          match rules with
          | Classnames rules ->
            let rules = pp_rules type_ hash rules |> String.trim in
            Printf.sprintf "%s %s" hash rules
          | Keyframes keyframes ->
            let rules = pp_keyframes type_ hash keyframes |> String.trim in
            Printf.sprintf "%s %s" hash rules)
        ""
  |> String.trim

@purefunctor
Copy link

Here's an initial fix I came up with, it doesn't account for animations yet:
purefunctor@3032dee

@purefunctor
Copy link

Okay, so with animations, here's what @emotion/server emits on my SSR script. They're stuffed under the css-global namespace with the hashes (as expected):

<style data-emotion="css-global 1acbpvw">
  @-webkit-keyframes animation-1acbpvw {
    0% {
      opacity: 0;
    }

    100% {
      opacity: 1;
    }
  }

  @keyframes animation-1acbpvw {
    0% {
      opacity: 0;
    }

    100% {
      opacity: 1;
    }
  }
</style>

I also discovered that for [%styled.global ...] styles, emotion emits the following, though I'm not entirely sure where it got the hash from.

<style data-emotion="css-global 1dvid4v">
  body {
    background-color: #1F1F1F;
    color: #F5F5F5;
    margin: 0;
    padding: 0;
  }

  #root {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    box-sizing: border-box;
    padding: 1rem;
    min-height: 100vh;
  }

  #root>main {
    -webkit-box-flex: 1;
    -webkit-flex-grow: 1;
    -ms-flex-positive: 1;
    flex-grow: 1;
  }

  @media screen and (min-width: 768px) {
    #root {
      max-width: 900px;
      margin-left: auto;
      margin-right: auto;
    }
  }
</style>

@pedrobslisboa
Copy link
Collaborator Author

@davesnx I have to issue a mea culpa for not testing it on a project using a reasonml SSR.
I'm going to take the @purefunctor details and going to make some changes and test it on a side project. As soon as I have it I'll push to this PR.

@pedrobslisboa
Copy link
Collaborator Author

pedrobslisboa commented Apr 25, 2024

⚠️ To my future me ⚠️

It would be nice to have a demo of this feature on styleppx

| Classnames of rule list
| Keyframes of (int * rule list) list

module Stylesheet = struct
module Hashes = Set.Make (String)

type 'a t = {
mutable rules : (string * declarations) list;
(* rules: (prefix * hash * rules) *)
mutable rules : (string * string * declarations) list;
Copy link
Owner

Choose a reason for hiding this comment

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

maybe a record here would be needed now, wdyt?

Copy link
Collaborator Author

@pedrobslisboa pedrobslisboa Apr 26, 2024

Choose a reason for hiding this comment

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

Due to your comment below (#467 (comment))

I was thinking to keep as before:

Suggested change
mutable rules : (string * string * declarations) list;
mutable rules : (string * declarations) list;

And have the declarations like this:

type declarations =
  | Global of rule list
  | Classnames of (string * rule list)
  | Keyframes of (string * (int * rule list) list)

Maybe declarations Classnames and Keyframes could be a record for better documentation.

type declarations =
  | Global of rule list
  | Classnames of {
      name : string;
      styles : rule list;
    }
  | Keyframes of {
      name : string;
      keyframes : (int * rule list) list;
    }

(* ... *)

let render_style_tag () =
  Stylesheet.get_all instance
  |> List.fold_left
       (fun accumulator (_, rules) ->
         match rules with
         | Global rules ->
           Printf.sprintf "%s %s" accumulator (rules_to_string rules)
         | Classnames { name; styles } ->
           let rules = pp_rules name styles |> String.trim in
           Printf.sprintf "%s %s" accumulator rules
         | Keyframes { name; keyframes } ->
           let rules = pp_keyframes name keyframes |> String.trim in
           Printf.sprintf "%s %s" accumulator rules)
       ""
  |> String.trim

WDYT?

| [] -> ""
| _ ->
let hash = Murmur2.default (rules_to_string styles) in
Stylesheet.push instance ("", hash, Global styles);
Copy link
Owner

Choose a reason for hiding this comment

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

Looking at this I wonder if the prefix can be stored inside Classnames and don't need to do anything in Global, thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nice idea, what about something like this:

let style (styles : rule list) =
  match styles with
  | [] -> ""
  | _ ->
    let hash = render_hash (Murmur2.default (rules_to_string styles)) styles in
    let className = Printf.sprintf "%s-%s" "css" hash in
    Stylesheet.push instance (hash, Classnames (className, styles));
    className

let global (styles : rule list) =
  match styles with
  | [] -> ""
  | _ ->
    let hash = Murmur2.default (rules_to_string styles) in
    Stylesheet.push instance (hash, Global styles);
    hash

let keyframes (keyframes : (int * rule list) list) =
  match keyframes with
  | [] -> ""
  | _ ->
    let hash = Murmur2.default (keyframes_to_string keyframes) in
    let animationName = Printf.sprintf "%s-%s" "animation" hash in
    Stylesheet.push instance (hash, Keyframes (animationName, keyframes));
    animationName

Then we can manage hash, which is a value for all styles, and the variant provides the need for extra info.

The usage can be:

let render_style_tag () =
  Stylesheet.get_all instance
  |> List.fold_left
       (fun accumulator (_, rules) ->
         match rules with
         | Global rules ->
           Printf.sprintf "%s %s" accumulator (rules_to_string rules)
         | Classnames (className, rules) ->
           let rules = pp_rules className rules |> String.trim in
           Printf.sprintf "%s %s" accumulator rules
         | Keyframes (animationName, keyframes) ->
           let rules = pp_keyframes animationName keyframes |> String.trim in
           Printf.sprintf "%s %s" accumulator rules)
       ""
  |> String.trim

Printf.sprintf "%s %s" accumulator hash |> String.trim)
""

let render_style_html_tag () =
Copy link
Owner

@davesnx davesnx Apr 26, 2024

Choose a reason for hiding this comment

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

You moved away from the idea of having a server-reason-react component here?

Copy link
Collaborator Author

@pedrobslisboa pedrobslisboa Apr 26, 2024

Choose a reason for hiding this comment

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

I forgot to add it.
I'm going to apply it like this:

let style_tag =
  React.createElement "style"
    [
      String ("data-emotion", "css " ^ get_string_style_hashes ());
      Bool ("data-s", true);
      DangerouslyInnerHtml (get_string_style_rules ());
    ]
    []

wdyt?

Copy link
Owner

Choose a reason for hiding this comment

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

That's exactly it

Copy link
Collaborator Author

@pedrobslisboa pedrobslisboa Apr 26, 2024

Choose a reason for hiding this comment

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

@davesnx I was trying to create this style_tag to use like <Css.styleTag/>

let style_tag ?key:_ ()=
  React.createElement "style"
    [
      String ("data-emotion", "css " ^ get_string_style_hashes ());
      Bool ("data-s", true);
      DangerouslyInnerHtml (get_string_style_rules ());
    ]
    []

But I'm receiving this issue:

image

A workaround for it is:

let style_tag ?key:_ ?children:_ ()=
  React.createElement "style"
    [
      String ("data-emotion", "css " ^ get_string_style_hashes ());
      Bool ("data-s", true);
      DangerouslyInnerHtml (get_string_style_rules ());
    ]
    []

But seems strange to have children that isn't used and even without breaking the calling when adding it:
<Css.styleTag/> children </Css.styleTag> It should have an error since it shouldn't receive a children value.

Should I use the workaround or do you have any idea how to handle it?

Copy link
Owner

Choose a reason for hiding this comment

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

The error message isn't the best, but it tells about a missing children argument, which should be there, so the function should be:

let style_tag ?key:_ () =
  React.createElement "style"
    [
      String ("data-emotion", "css " ^ get_string_style_hashes ());
      Bool ("data-s", true);
      DangerouslyInnerHtml (get_string_style_rules ());
    ]
    []

actually, not even key should be needed in this case, it doesn't hurt but isn't needed by any chance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought the same, but I guess it is the way JSX is being handled, when calling the make function from the component as , it expects those parameters. Does it make sense?

Copy link
Owner

Choose a reason for hiding this comment

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

Random idea: Do you have server-reason-react.react added as dependency?

Copy link
Collaborator Author

@pedrobslisboa pedrobslisboa Apr 26, 2024

Choose a reason for hiding this comment

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

I'm testing it on e2e-melange which has this dune for the debug:

(executable
 (name debug)
 (public_name e2e_melange_debug)
 (modules :standard \ index)
 (libraries ui_native server-reason-react.react server-reason-react.reactDom styled-ppx.emotion_native styled-ppx.css_native)
 (preprocess
  (pps styled-ppx)))

Here is where I'm testing it:
https://github.com/davesnx/styled-ppx/pull/467/files#diff-91524fce38f09c49377280b9f79564819152a9851f302f5a91ad126a0ea3b991

I update de PR to be better to read the new ideas.

BTW, is this the demo you're talking about at the discord? I didn't find any demo folder.

Copy link
Owner

@davesnx davesnx left a comment

Choose a reason for hiding this comment

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

Really great addition.

@davesnx davesnx merged commit aaec956 into davesnx:main May 1, 2024
7 checks passed
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jun 27, 2024
CHANGES:

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jul 4, 2024
CHANGES:

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jul 18, 2024
CHANGES:

## 0.59.0
- [BREAKING] Change entry point module `CSS` (from `CssJs`) on `styled-ppx.melange`, `styled-ppx.native` and `styled-ppx.rescript` (davesnx/styled-ppx#490) (@davesnx)
- [FEATURE] Add support and interpolation for `zoom`, `will-change` and `user-select` properties (davesnx/styled-ppx#489) (@davesnx)
- [FEATURE] Support content with interpolation davesnx/styled-ppx#494 (@davesnx)
- [FEATURE] Support define CSS variables in global and use CSS variables in properties davesnx/styled-ppx#492 (@davesnx)
- [FEATURE] Support overflow with 2 values
- [FEATURE] Make animation-name abstract (@davesnx)
- [FIX] Add 100 unsupported properties, which will render properly (davesnx/styled-ppx#489) (@davesnx)
- [FIX] Inline all CSS.Var and CSS.Cascading in properties (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Color with support for rgba/hsla and others with calc/min and max (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Warning of kebab-case on emotion client side (davesnx/styled-ppx#493) (@davesnx)

## 0.58.1
- [BREAKING] FontFamilyName.t is now a string (@davesnx)
- [FIX] Make unsafe calls from "Cascading" be camelCase to avoid emotion's warning davesnx/styled-ppx#488 (@davesnx)
- [FIX] Keep classname when ampersand is at the end of the selector (@davesnx)
- [FIX] Fix fontFace in both melange and native (@davesnx)

## 0.58.0
- [FEATURE] Initial @container support davesnx/styled-ppx#476 (@zakybilfagih)
- [FIX] Make selector nested maintain other selectors davesnx/styled-ppx#486 (@davesnx)
- [BREAKING] Remove `Css` module, `styled_label` and friends davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css and styled-ppx.emotion into styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Remove PseudoClass and PseudoClassParam davesnx/styled-ppx#487 (@davesnx)
- Remove functor from Css_Js_Core davesnx/styled-ppx#487 (@davesnx)
- Remove melange.js and melange.belt from styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- Remove server-reason-react.js and server-reason-react.belt from styled-ppx.native davesnx/styled-ppx#487 (@davesnx)

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
davesnx added a commit to davesnx/opam-repository that referenced this pull request Jul 23, 2024
CHANGES:

## 0.59.0
- [BREAKING] Change entry point module `CSS` (from `CssJs`) on `styled-ppx.melange`, `styled-ppx.native` and `styled-ppx.rescript` (davesnx/styled-ppx#490) (@davesnx)
- [FEATURE] Add support and interpolation for `zoom`, `will-change` and `user-select` properties (davesnx/styled-ppx#489) (@davesnx)
- [FEATURE] Support content with interpolation davesnx/styled-ppx#494 (@davesnx)
- [FEATURE] Support define CSS variables in global and use CSS variables in properties davesnx/styled-ppx#492 (@davesnx)
- [FEATURE] Support overflow with 2 values
- [FEATURE] Make animation-name abstract (@davesnx)
- [FIX] Add 100 unsupported properties, which will render properly (davesnx/styled-ppx#489) (@davesnx)
- [FIX] Inline all CSS.Var and CSS.Cascading in properties (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Color with support for rgba/hsla and others with calc/min and max (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Warning of kebab-case on emotion client side (davesnx/styled-ppx#493) (@davesnx)

## 0.58.1
- [BREAKING] FontFamilyName.t is now a string (@davesnx)
- [FIX] Make unsafe calls from "Cascading" be camelCase to avoid emotion's warning davesnx/styled-ppx#488 (@davesnx)
- [FIX] Keep classname when ampersand is at the end of the selector (@davesnx)
- [FIX] Fix fontFace in both melange and native (@davesnx)

## 0.58.0
- [FEATURE] Initial @container support davesnx/styled-ppx#476 (@zakybilfagih)
- [FIX] Make selector nested maintain other selectors davesnx/styled-ppx#486 (@davesnx)
- [BREAKING] Remove `Css` module, `styled_label` and friends davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css and styled-ppx.emotion into styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Remove PseudoClass and PseudoClassParam davesnx/styled-ppx#487 (@davesnx)
- Remove functor from Css_Js_Core davesnx/styled-ppx#487 (@davesnx)
- Remove melange.js and melange.belt from styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- Remove server-reason-react.js and server-reason-react.belt from styled-ppx.native davesnx/styled-ppx#487 (@davesnx)

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

## 0.59.0
- [BREAKING] Change entry point module `CSS` (from `CssJs`) on `styled-ppx.melange`, `styled-ppx.native` and `styled-ppx.rescript` (davesnx/styled-ppx#490) (@davesnx)
- [FEATURE] Add support and interpolation for `zoom`, `will-change` and `user-select` properties (davesnx/styled-ppx#489) (@davesnx)
- [FEATURE] Support content with interpolation davesnx/styled-ppx#494 (@davesnx)
- [FEATURE] Support define CSS variables in global and use CSS variables in properties davesnx/styled-ppx#492 (@davesnx)
- [FEATURE] Support overflow with 2 values
- [FEATURE] Make animation-name abstract (@davesnx)
- [FIX] Add 100 unsupported properties, which will render properly (davesnx/styled-ppx#489) (@davesnx)
- [FIX] Inline all CSS.Var and CSS.Cascading in properties (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Color with support for rgba/hsla and others with calc/min and max (davesnx/styled-ppx#495) (@davesnx)
- [FIX] Warning of kebab-case on emotion client side (davesnx/styled-ppx#493) (@davesnx)

## 0.58.1
- [BREAKING] FontFamilyName.t is now a string (@davesnx)
- [FIX] Make unsafe calls from "Cascading" be camelCase to avoid emotion's warning davesnx/styled-ppx#488 (@davesnx)
- [FIX] Keep classname when ampersand is at the end of the selector (@davesnx)
- [FIX] Fix fontFace in both melange and native (@davesnx)

## 0.58.0
- [FEATURE] Initial @container support davesnx/styled-ppx#476 (@zakybilfagih)
- [FIX] Make selector nested maintain other selectors davesnx/styled-ppx#486 (@davesnx)
- [BREAKING] Remove `Css` module, `styled_label` and friends davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css and styled-ppx.emotion into styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Merge styled-ppx.css-native and styled-ppx.emotion-native into styled-ppx.native davesnx/styled-ppx#487 (@davesnx)
- [BREAKING] Remove PseudoClass and PseudoClassParam davesnx/styled-ppx#487 (@davesnx)
- Remove functor from Css_Js_Core davesnx/styled-ppx#487 (@davesnx)
- Remove melange.js and melange.belt from styled-ppx.melange davesnx/styled-ppx#487 (@davesnx)
- Remove server-reason-react.js and server-reason-react.belt from styled-ppx.native davesnx/styled-ppx#487 (@davesnx)

## 0.57.1
- Remove public_name from alcotest_extra davesnx/styled-ppx#484 (@davesnx)
- Fix nesting for selectors (and pseudo) in native davesnx/styled-ppx#483 (@davesnx)

## 0.57.0

- Improvement for locations in both code-gen and error reporting by @davesnx in davesnx/styled-ppx#456
- Support css min and max functions by @lubegasimon in davesnx/styled-ppx#411
- Update docs by @zakybilfagih in davesnx/styled-ppx#457
- update server-reason-react pin to main branch by @zakybilfagih in davesnx/styled-ppx#460
- Native support for styled.{{tag}} by @zakybilfagih in davesnx/styled-ppx#461
- Fix linear-gradient and radial-gradient  by @davesnx in davesnx/styled-ppx#464
- Add getting started docs by @zakybilfagih in davesnx/styled-ppx#459
- escape curly on remote markdown content by @zakybilfagih in davesnx/styled-ppx#466
- Add Melange and native instructions by @davesnx in davesnx/styled-ppx#465
- Global styles for native server on emotion by @pedrobslisboa in davesnx/styled-ppx#468
- Style HTML tag by @pedrobslisboa in davesnx/styled-ppx#467
- [emotion native] Fix nested pseudoelements by @davesnx in davesnx/styled-ppx#470
- Transform with variable handle unsafe interpolation by @zakybilfagih in davesnx/styled-ppx#471
- Add depext for @emotion/css >= 11.0.0 by @feihong in davesnx/styled-ppx#473
- Add support for transition by @zakybilfagih in davesnx/styled-ppx#472
- Fix animation codegen by @zakybilfagih in davesnx/styled-ppx#475
- Fix error line number coming from parser by @zakybilfagih in davesnx/styled-ppx#478
- Polish emotion-native by @davesnx in davesnx/styled-ppx#481
- Rename `render_style_tag` to `get_stylesheet` (@davesnx)
- Docs: Explain show server rendered stylesheets work natively by @ManasJayanth in davesnx/styled-ppx#480

## 0.56.0

- Improvement for locations in both code-gen and error reporting (davesnx/styled-ppx#456) by @davesnx
- Support css min and max functions (davesnx/styled-ppx#411) by @lubegasimon
- Update docs (davesnx/styled-ppx#457) by @zakybilfagih
- Native support for styled.{{tag}} (davesnx/styled-ppx#461) by @zakybilfagih
- background-clip: text support by @davesnx
- Fix linear-gradient and radial-gradient (davesnx/styled-ppx#464) by @davesnx
- Rename emotion-hash into murmur2 and remove public testing cli by @davesnx
- Use server-reason-react from opam by @davesnx
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