@danielx/civet 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -94,6 +94,7 @@ Things Kept from CoffeeScript
94
94
  - Postfix `if/unless`
95
95
  - Block Strings `"""` / `'''`
96
96
  - `#{exp}` interpolation in `"""` strings
97
+ - Multiple `case`/`when` expressions
97
98
  - JSX 😿
98
99
  - TODO
99
100
  - [ ] Chained comparisons
@@ -104,7 +105,7 @@ Things Removed from CoffeeScript
104
105
  - `on/yes/off/no` (use `true/false`)
105
106
  - `isnt` (use `!==`)
106
107
  - `not` (use `!`)
107
- - `do` keyword (replaced with JS `do`)
108
+ - `do` keyword (replaced with JS `do`, invoke using existing `(-> ...)()` syntax)
108
109
  - `for from` (use JS `for of`)
109
110
  - `and=`, `or=` (don't mix and match words and symbols)
110
111
  - Array slices `list[0...2]` (use `list.slice(0, 2)`)
@@ -131,6 +132,7 @@ Things Changed from CoffeeScript
131
132
  - Embedded JS `\`\`` has been replaced with JS template literals.
132
133
  - No longer allowing multiple postfix `if/unless` on the same line.
133
134
  - No `else` block on `unless` (negate condition and use `if`)
135
+ - `#{}` interpolation in `""` strings only when `"use coffee-compat"`
134
136
  - Civet tries to keep the transpiled output verbatim as much as possible.
135
137
  In Coffee `(x)` -> `x;` but in Civet `(x)` -> `(x);`.
136
138
  Also in Coffee `x + 3` -> `x + 3` but in Civet `x + 3` remains as is.
@@ -158,6 +160,7 @@ Things Added that CoffeeScript didn't
158
160
  - JS Compatability
159
161
  - `var`, `let`, `const`
160
162
  - JS Comment Syntax `//` and `/* */`
163
+ - `function` keyword
161
164
  - Braced Blocks
162
165
  - OptionalChain longhand
163
166
  - ConditionalExpression
@@ -168,7 +171,7 @@ Things Added that CoffeeScript didn't
168
171
  - `<` as `extends` shorthand
169
172
  - `@#id` -> `this.#id` shorthand for private identifiers
170
173
  - `import` shorthand `x from ./x` -> `import x from "./x"`
171
- - `\`\`\`` Block Template Strings
174
+ - `\`\`\`` Block Template Strings remove leading indentation for clarity
172
175
  - Class constructor shorthand `@( ... )`
173
176
  - ClassStaticBlock
174
177
  - `get`/`set` method definitions
@@ -186,6 +189,8 @@ Things Changed from ES6
186
189
  The reasoning is `x -> ...` => `x(function() ...)` in CoffeeScript and having `->` and `=>`
187
190
  behave more differently than they already do is bad. Passing an anonymous function to an
188
191
  application without parens is also convenient.
192
+ - Disallow comma operator in conditionals.
193
+ - Comma operator in case/when becomes multiple conditions.
189
194
 
190
195
  Using Civet in your Node.js Environment
191
196
  ---