Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Use OrderedMap to maintain YML input file props order.#201

Open
tomger wants to merge 1 commit intosalesforce-ux:masterfrom
tomger:master
Open

Use OrderedMap to maintain YML input file props order.#201
tomger wants to merge 1 commit intosalesforce-ux:masterfrom
tomger:master

Conversation

@tomger
Copy link
Copy Markdown
Contributor

@tomger tomger commented Feb 10, 2020

In our token setup the order of the YML props has a meaning. e.g. colors are grouped by hue.

As far as I can tell without this patch the order of the output is nondeterministic/scrambled. This is because Immutable.fromJS, at least in our case, converts the input JS array into a non-ordered Map instead of an OrderedMap.

Example.yml

  • colorYellow
  • colorDarkYellow
  • colorGreen

Example.output (without patch)

  • $yellow
  • $green
  • $darkYellow

Example.output (with patch)

  • $yellow
  • $darkYellow
  • $green

@KITSStuCoe
Copy link
Copy Markdown

KITSStuCoe commented Aug 26, 2021

@tomger, the failing test just needs a done() in the r func:

lib/tests/effects.js, line 103.

r => { done(); }

worked for me, anyway.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants