Skip to content

Localization-prevention in advanced compilation #10

@TimovanderKamp

Description

@TimovanderKamp

Localization-prevention does not work under the following conditions:

  1. Optimization level is set to 'Advanced';
  2. A keyword is used with a $ prefix in the local-rules of a component.
  3. The same keyword is used in a global-rule in any component that is included in the css.

Example where is works fine with advanced compilation

(defui B
static css/CSS
(local-rules [this] [:.c {..}])
(include-children [this] [])
static css/Global
(global-rules [this] [[:.d {..}]])

(defui A
static css/CSS
(local-rules [this] [:.a {..}
[:$b {..}]])
(include-children [this] [B]))

This works because the keyword 'b' is not used in the global rules of the parents, children or siblings

Example where it is broken

(defui B
static css/CSS
(local-rules [this] [:.c {..}])
(include-children [this] [])
static css/Global
(global-rules [this] [[:.b {..}]])

(defui A
static css/CSS
(local-rules [this] [:.a {..}
[:$b {..}]])
(include-children [this] [B]))

This doesn't work because the keyword 'b' is used in the global rules of Component-B and in the local rules of Component-A

Note: This only happens when optimisation level is set to :advanced

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions