UNPKG

39.5 kBMarkdownView Raw
1# Changelog
2
3## 2.0.0-alpha.209
4
5* Fixed bug with observables not unsubscribing correctly in certain cases
6
7* Expose `imba.reportObserved`, `imba.reportChanged` and `imba.createAtom` (still experimental)
8
9* Add `imba.hotkeys.addKeycodes(...)` (#677)
10
11* Made `@touch.hold(dur)=handler` trigger handler after duration without waiting for additioanl events (#664)
12
13## 2.0.0-alpha.207
14
15* Don't try to implicitly return debugger statement
16
17* Improve compilation of `extend` statements for tooling
18
19## 2.0.0-alpha.206
20
21* Disallow iterating over falsy values using `for in`
22
23* Compile literal bigints correctly
24
25* Minor improvements to type definitions
26
27## 2.0.0-alpha.205
28
29* Support `for await ... of` syntax
30
31* Support tagged templates
32
33 Works like in plain js, but `{}` is still used for interpolation instead of `${}`.
34
35 ```imba
36 import md from 'tag-markdown'
37 const html = md`## Welcome to {name}`
38 ```
39
40* Add internal `#__patch__(props)` method for class instances to update fields
41
42* Stop shimming top-level await (delegates responsibility to esbuild)
43
44
45## 2.0.0-alpha.204
46
47* Fixed operator precedence for ternary expressions
48
49* Revert automatic `calc` wrapping for css values introduced in alpha 200
50
51 Introduced a lot of bugs and challenges related to `/` being a valid part of css values. `calc` will still be automatically be added around top-level parenthesis in css values, so `width:(100vw - 20px)` will still compile as `calc(100vw - 20px)`, but properties like `grid-column: 1 / 3` will now compile without calc again.
52
53## 2.0.0-alpha.203
54
55* Fixed regression with negated breakpoint modifiers like `display@!600:none`
56
57## 2.0.0-alpha.202
58
59* Fixed performance regression for tag trees introduced in alpha 191
60
61* Fixed compilation of css properties wrapped in parenthesis
62
63* Make unresolved decorators resolve to `imba.@decorator`
64
65 ```imba
66 class Order
67 @lazy get lines
68 ...
69 ```
70
71 If `@lazy` is not found in the file above, the compiler will essentially include
72 `import {@lazy} from 'imba` when compiling.
73
74* Introduced experimental state management decorators
75
76 A minimal set of decorators heavily inspired by MobX that allows you to mark classes
77 and objects as observable, and run code upon changes. This feature will be kept under
78 wraps until it has been battle-tested.
79
80## 2.0.0-alpha.201
81
82* Fixed regression where css colors `rgb(0 0 0 / alpha)` would compile incorrectly
83
84## 2.0.0-alpha.200
85
86* Allow `@hotkey('*')` to listen to all hotkey events
87
88 This is perfect for disabling all other hotkeys in certain contexts.
89
90 ```imba
91 tag ConfirmDialog
92 # when this dialog is mounted - all hotkey handlers preceding
93 # it in the dom tree will be blocked by the `*` listener
94 <self @hotkey('*').global>
95 <button @hotkey('esc')> "Cancel"
96 <button @hotkey('enter')> "Ok"
97 ```
98
99* Automatically wrap style expressions in `calc()`
100
101 ```imba
102 css div width: calc(100vw - 40px)
103 # can now be written as
104 css div width: 100vw - 40px
105 ```
106
107* Make bind=data.property work for textarea when value is `undefined`
108
109* Allow nested parentheticals in css calc
110
111* Fixed issue where removing class names using `el.flags.remove` would not work
112
113* Made `@touch.flag` support selector in second argument to match `@event.flag`
114
115* Allow second argument to `el.flags.incr(flag, dur = 0)`
116
117 With this argument you can automatically decrement the flag after a certain duration.
118
119* Allow negated style modifiers
120
121 ```imba
122 css div
123 @!hover o:0.5 # div:not(:hover) { opacity: 0.5 }
124 @!md d:none # @media (max-width: 767px) { div { display:none } }
125 # also works for classes
126 css div
127 @.!disabled o:0.5 # div:not(.disabled){ opacity:0.5 }
128 ```
129
130## 2.0.0-alpha.199
131
132* Fix regression where content of `<teleport>` and `<global>` was not rendered (#643)
133
134## 2.0.0-alpha.198
135
136* Change how css specificity is forced in generated selectors
137
138 Older browsers do not support complex selectors within `:not()`, so the style `:not(#_#_#_)` which is used for "inline" styles would not work in these browsers. We have now reverted to using multiple not selectors like `:not(#_):not(#_):not(#_)`. This is more verbose but the size is negligible, especially with compression. Debugging styles in the browser is a bit more clumsy.
139
140* Change css specificity for component rules
141
142 Selectors inside tag declarations are now compiled with a higher specificity than global selectors.
143
144 ```imba
145 tag App
146 # scoped selectors have higher precedence than global styles
147 css .selector d:block
148 ```
149
150* Fixed case where a generated class-name is added multiple times on elements
151
152## 2.0.0-alpha.197
153
154* Fixed issue with bracketless multiline object and certain operators
155
156 ```imba
157 let x = null
158 x ||=
159 one: 1
160 two: 2
161 # would previously compile incorrectly to x ||= {one: 1}
162 ```
163
164## 2.0.0-alpha.196
165
166* Introduced `@event.closest(sel)` modifier
167
168 Works like `@event.sel(selector)`, but checks for `target.closest(...)` instead of `target.matches(...)`.
169 In the cases where you want to just handle clicks that do _not_ match a selector you can negate the modifier using `.!closest(...)`.
170
171 ```imba
172 tag App
173 <self>
174 # all clicks outside of button tags
175 <div @click.!closest('button')>
176 <button> <span> "Click"
177 <p> "blabla"
178 ```
179
180## 2.0.0-alpha.195
181
182* Fixed compilation issue for functional tags without arguments
183
184* Throw error when trying to use bind on functional tags
185
186## 2.0.0-alpha.194
187
188* Improved syntax for functional tags
189
190 If you supply `()` after a tag name, Imba will now treat it as a functional tag. Ie, `<some-name(1,2)>` is equal to `<( some-name(1,2) )>`. The old syntax may be phased out before final release.
191
192 ```imba
193 def List items
194 return if items.length == 0
195
196 <section>
197 <slot>
198 <ul> for item in items
199 <li> item.title
200
201 tag App
202 def head
203 <header> <slot> <h2> "Welcome"
204
205 <self>
206 <head()>
207 <List(data.newest)> <h2> "Newest posts"
208 <List(data.all).large> <h2> "All posts"
209 ```
210
211## 2.0.0-alpha.193
212
213* Fix issue where parts of runtime was incorrectly tree-shaked
214
215* Always resolve `node:*` imports as external
216
217* Include changelog.md in npm package
218
219## 2.0.0-alpha.191
220
221There will likely be a few more alpha releases fixing regressions and issues related to the new features in alpha 191, but after these potential issues have been resolved we're moving to beta 🥳! This release does contain a few breaking changes, both in relation to styles and memoization. We'll update the docs at imba.io and publish a screencast going over the changes to make it easier to transition to this new version. Changes;
222
223* Rename $key to key
224
225 To give elements a stable identity (usually inside lists) you should now use `<el key=value>` instead of `<el $key=value>`. `$key` is deprecated and will be removed in `beta.1`.
226
227* Allow using any object as `<element key=...>` value
228
229 Keyed elements now use a `Map` instead of a plain object to keep track of unique elements. This means that any value (both objects and primitive values) may be used as keys.
230
231 ```imba
232 const items = [{title: "One"},{title: "Two"}]
233
234 tag App
235 <self> for item in items
236 # objects themselves can be used as keys now
237 <AppItem key=item data=item>
238 ```
239
240* New (improved) syntax for rendering functional components / tag trees
241
242 This was the main change holding us back from reaching beta, as it is a breaking change for most users. When you want to include external live dom elements from getters or methods outside of the render-tree, wrap the expression in `<(expression)>`.
243
244 Besides simplifying the way memoization works it also allows you to add classes and styles to these external fragments, making it vastly more flexible than before.
245
246 ```imba
247 tag App
248 get body
249 <div> "This is body"
250
251 def list title, items
252 <section>
253 <h2> title
254 <ul> for item in items
255 <li> item.title
256
257 <self>
258 <( body )>
259 <( list 'Top', data.popular ).large [mt:2]>
260 <( list 'New', data.posts.slice(0,10) )>
261 ```
262
263* Log warnings to console when building/running without minification
264
265 Added runtime checks that notify about erroneous behaviour when building/running w/o minification. Initially it will only warn about non-memoized elements being created during rendering. Eventually we'll use these conventions to add much more elobrate checks and readable error messages for the most common issues users can run into.
266
267* Allow instantiating elements w/o memoization using `new`
268
269 Imba will automagically allow any element (literal tag) in any method to be memoized.
270
271 ```imba
272 def wrap text
273 let div = <div.item> text
274 return div
275
276 imba.mount do <section>
277 <( wrap "One" )>
278 <( wrap "Two" )>
279 ```
280
281 If you call a method or access a getter that returns an element (like `def wrap`) it will look up a memoization context and just reuse/update the div for that particular context. If you call it directly without being in a context, Imba will warn you. There are however some situations where you actually just want to create new elements. In this case, use `new` in front of the element. If the root is not memoized, the children won't either, so you only need to add `new` in front of the top element.
282
283 ```imba
284 def wrap text
285 let div = new <div.item> text
286 return div
287 ```
288
289* Allow non-global tag types in dynamic tag names
290
291 Local tag types are now allowed in `<{tag-type} ...>` syntax. Previously it would only work when `tag-type` evaluated to a string, and there was a globally defined web component or native tag with that name. Now it works with classes as well.
292
293 ```imba
294 import {PostView,ArticleView} from './views'
295
296 const items = [
297 { type: Post, title: "My post"}
298 { type: Article, title: "My article"}
299 ]
300
301 tag App
302 <self>
303 for item in items
304 <{item.type} data=item>
305 ```
306
307* Only allow named elements inside `<self>`
308
309 Using named elements (`<div$myname>`) outside of self would previously introduce subtle bugs and conflicts. They are now only allowed inside of `<self>`.
310
311* Changed css specificity
312
313 Styles declared in tag declaration body now has lower specificity than class selectors.
314
315 ```imba
316 css .warn hue:red
317 css .large p:4 fs:lg
318
319 tag Button
320 css p:2 fs:sm hue:blue
321
322 # styles from classes take precedence
323 <Button.warn.large>
324 ```
325
326* Scoped selectors no longer applies to self
327
328 Now, selectors like `.warn` declared in tag declaration body only applies to elements _inside_ `Button`, not the button itself. To target the button itself, use `&` in the selector.
329
330 ```imba
331 tag Button
332 css bg:blue2
333 css .warn bg:red2
334 css &.large fs:lg
335
336 <self.warn.large> "Still blue bg - but large"
337 ```
338
339* Add `declare` keyword for declaring fields (with type annotations) without generating any code for that field
340
341 ```imba
342 class Foo
343 declare a\number
344 ```
345
346* Allow multiline conditionals when lines start with `and`,`or`,`||`, or `&&`
347
348 This is a temporary solution for a larger challenge. It simply ignores new-lines whenever your line starts with these operators.
349
350 ```imba
351 if condition
352 and test
353 or force
354 return ...
355 ```
356
357* Allow third argument in `for in` loops referencing length
358
359 If you need to know the length of a collection you are iterating over, you can now access the total length of the collection by supplying a third argument. This is not available in `for of`, only `for in`.
360
361 ```imba
362 for member,index,len in list
363 # len refers to the length of the iterable list
364 if index == len - 1
365 yes # this is the last element
366 ```
367
368* Exposed `imba.hotkeys.humanize` for converting hotkey combos to readable shortcuts
369
370* Exposed `imba.hotkeys.htmlify` for converting hotkey combos to readable shortcuts as html
371
372
373## 2.0.0-alpha.190
374
375* Fixed regression related to implicit parenthesis in tag trees
376
377* Renamed `@hotkey.capture` to `@hotkey.force`
378
379## 2.0.0-alpha.189
380
381* Introduced `@hotkey.repeat` modifier
382
383 When a user presses a key and then keeps holding it, keydown/keypress
384 events will be generated every n milliseconds. For hotkeys you usually
385 only want to trigger once when the user press the combination.
386
387 If you want the handler to keep firing while user holds down the keys
388 you can now use the `.repeat` modifier:
389
390 ```imba
391 # will only toggle when pressing space, no matter how long you
392 # keep it pressed.
393 <div @hotkey('space')=togglePlayback>
394 # holding the right arrow will call fastForward repeatedly
395 <div @hotkey('right').repeat=fastForward>
396 ```
397
398* Changed rules for implicit parenthes / calling in tag trees
399
400 Indented code under a tag-tree will no longer be compiled as an invocation.
401
402 ```imba
403 <div> data.name
404 "something"
405 if data.name
406 "something"
407 ```
408
409 The code above would previously compile to div `data.name("something")`. Now
410 indentation in tag trees will behave like they do in statements like if/for/while etc.
411 This fixes #630, so you can now add css blocks like this:
412
413 ```imba
414 <div> data.name
415 css d:block # style for the div
416 ```
417
418* Added `@first-child` and `@last-child` css modifiers
419
420 We already have `@first` and `@last` as shorter aliases, but since all other standard pseudo-selectors exist it makes sense to include the longer versions of these as well.
421
422* Fixed issue with nested loops in tag trees
423
424 It is now possible to use nested loops without wrapping the inner loops in a fragment.
425
426 ```imba
427 <div>
428 for item in data.items
429 for label in item.labels
430 <div> label
431 ```
432
433* Allow declaring variables and global tags with the same name
434
435 Global web components should not be registered as regular variables.
436 Previously the compiler would throw an error if `tag app` and `let app = ...`
437 were declared in the same file.
438
439* Allow optional chaining with dynamic keys - #638
440
441 ```imba
442 user..[key]
443 ```
444
445* Mark imported SVGs as @__PURE__
446
447 This allows efficient tree-shaking so that one can include all icons from a collection
448 and only bundle the ones that are used.
449
450 ```imba
451 import * as icons from 'imba-codicons'
452
453 <svg src=icons.volume-up>
454 # you get completions and previews for all icons, but only volume-up
455 # will be bundled in your code now
456 ```
457
458* Don't round x,y in `@touch.reframe` and `@touch.fit` by default (#639)
459
460## 2.0.0-alpha.187
461
462* Call `dehydrate` on compononents when rendering components from the server.
463
464* Updated type declarations.
465
466## 2.0.0-alpha.186
467
468* Don't add html class name for named elements
469
470 Previously when naming an element like `<div$title> ...`, imba would automatically
471 add a `title` class name to the element. This can lead to confusing issues. If you
472 have used this undocumented behaviour previously you just need to add the class
473 yourself, like `<div$title.title>`.
474
475* Introduced `@mouse.mod` modifier
476
477 Since Mac and Windows/Linux use different keyboard modifiers for most standard actions
478 (ctrl+c,ctrl+s,ctrl+click) vs (⌘c,⌘s,⌘+click) etc, it makes sense to have an event
479 modifier that takes care of checking the platform. `@mouse.mod` will return true of
480 ⌘ is pressed on mac, and Ctrl is pressed on all other platforms.
481
482 ```imba
483 <div @click.mod.stop=openInNewWindow @click=openHere>
484 ```
485
486* Fixed bug in `@event.throttle` modifier
487
488## 2.0.0-alpha.183
489
490- Remove unneeded class names on tags when building
491
492## 2.0.0-alpha.182
493
494- Fixed issues with using event modifiers with external imba library
495
496## 2.0.0-alpha.177
497
498- Added type declarations into typings/
499
500## 2.0.0-alpha.176
501
502- Deprecated `@touch.moved-dir`
503
504 The direction of the `@touch.moved` modifier can now be specified in the second argument of `@touch.moved` instead of as 6 separate modifiers. These are not used that often and it seems natural to keep inside a single modifier instead.
505
506 ```imba
507 <div @touch.moved-left(4px)> # before
508 <div @touch.moved(4px,'left')> # after
509 ```
510
511- Renamed style property `tint` to `hue`
512
513 Hue is a better name for the newly introduced `tint` style property.
514
515 ```imba
516 # hue can be set to any named color from the imba color palette
517 <div[hue:orange]>
518 <h1[color:hue7]> # refer to a shade/tint of the aliased color
519 ```
520
521- Refactored event modifiers
522
523 Foundations to allow defining custom event modifiers down the road. Complex modifiers have access to the context in which it was called, including a state-object that is persisted across events etc. Documentation fo this will be in place before 2.0 final. As an example, a tiny `@keydown.f1` modifier for only passing through F1 can be defined like this:
524
525 ```imba
526 extend class KeyboardEvent
527
528 def @f1
529 return keyCode == 112
530 ```
531
532- Changed behavior of `@event.throttle` modifier
533
534 `throttle` would previously fire once and suppress subsequent events for a certain duration (default 250ms). Now it will re-fire at the end of the throttling if there were any suppressed events during the initial throttle. For events like `@resize` and `@scroll` where you just want to limit how often they fire, the new behavior is much more useful.
535
536 ```imba
537 # handler will be called immediately upon scrolling and keep emitting
538 # every 100ms until there are no more scroll events.
539 <div @scroll.throttle(100ms)=handler>
540
541 # So, clicking this button twice will trigger once immediately,
542 # and then again after 1 second. Previously the second click would
543 # never trigger.
544 <div @click.throttle(1s)=handler>
545 ```
546
547- Introduced `@event.cooldown` modifier
548
549 The old `throttle` was renamed to `cooldown`. Ie, if you want subsequent button clicks to be suppressed for `n` time (250ms default) you should now use `cooldown` instead of `throttle`.
550
551 ```imba
552 # So, clicking this button twice will trigger once immediately, and
553 # the next click will be ignored as long as it happens less than a second later
554 <div @click.cooldown(1s)=handler>
555 ```
556
557- Allow negated event modifiers
558
559 Certain event modifiers are called guards, like `@keydown.enter`, `@click.self` etc. These are modifiers that essentially evaluate to true/false and decides whether to continue handling an event or not. `@click.self` would only trigger if the target of the event is the same as the element to which the `@click` is bound. Now you can include a `!` in front of any such event handler to only continue if the guard is false.
560
561 Ie. `<div @click.!shift=...>` would only trigger if shiftKey is _not_ pressed.
562
563 ```imba
564 # Only call handler if shiftKey is NOT pressed
565 <div @click.!shift=handler>
566
567 # Only call handler if target does NOT match the selector
568 <div @click.!sel('.active')=handler>
569 ```
570
571- Introduced `@mouse.left`, `@mouse.middle`, and `@mouse.right` modifiers
572
573 Only trigger if the left,middle, or right mouse button is pressed. Works for all mouse and pointer events, as well as the custom `@touch` event.
574
575 ```imba
576 # Only call handler if the middle mouse button was pressed
577 <div @click.middle=handler>
578
579 # Only start touch handling if the right mouse button was pressed
580 <div @touch.right=handler>
581 ```
582
583- Introduced `@intersect.flag` modifier
584
585 The `flag` modifier now works differently for `@intersect` event. It will add a css class to the element when it is intersecting and remove it whenever it is not intersecting.
586
587 ```imba
588 # the html class showing will be present on div
589 # whenever it is intersecting with the viewport
590 <div @intersect.flag('showing')>
591 ```
592
593- Introduced `@touch.end` modifier
594
595 The `end` guard breaks unless the touch is in its ending state.
596
597 ```imba
598 # handler is only called at the end of the touch
599 <div @touch.end=handler>
600 # handler is only called at the end of the touch if pointer moved
601 <div @touch.moved.end=handler>
602 ```
603
604- Introduced `@touch.hold(dur=1000ms)` modifier
605
606 The `hold` modifier allows you to require an element to be pressed for some time (default 1000ms) until it starts allow events to come through.
607
608 ```imba
609 # handler is only called once the touch has been held for 1000ms
610 <div @touch.hold=handler>
611 # handler only called if ctrl was pressed and touch held for 250ms
612 <div @touch.ctrl.hold(250ms)=handler>
613 ```
614
615
616- Introduced `@touch.apply(target,xprop='x',yprop='y')` modifier
617
618 Like `@touch.sync` but just setting the x,y values on an object directly instead of adding to the previous values.
619
620 ```imba
621 const obj = {}
622 # apply is essentially shorthand for setting properties:
623 <div @touch.apply(obj)>
624 <div @touch=(obj.x = e.x, obj.y = e.y)>
625 ```
626
627
628- Added `@event.key(keyOrCode)` modifier for keyboard events
629
630 KeyboardEvent.keyCode is deprecated but still useful in many cases. If you supply a number to the modifier it will stop handling if `keyCode` does not match this number.
631
632 ```imba
633 # Only trigger if F1 is pressed (event.keyCode==112)
634 <div @keydown.key(112)=handler>
635 ```
636
637 If you supply a string it will compare it against KeyboardEvent.key.
638
639 ```imba
640 # Only trigger if PrintScreen is pressed (event.key=='PrintScreen')
641 <div @keydown.key('PrintScreen')=handler>
642 ```
643
644- Changed behavior of `@touch.moved` modifier
645
646 Now, if you add a `moved-left(threshold = 4px)` modifier, the event handling will be cancelled if the touch has moved more in any other direction (in this case up,down, or right) _before_ moving 4px left.
647
648 ```imba
649 # If user moves more than 10px up/down before left/right
650 # the touch will not be handled
651 <div @touch.moved-x(10px)=draghandle>
652 ```
653
654- Improved behaviour of `@touch` and `@click` events
655
656 `@click` events on nested children of an element with a `@touch` handler would previously be prevented. This made `@touch` pretty challenging to use for things like dragging elements with buttons etc.
657
658 Now `@click` events will be triggered unless the `@touch` handler has a `prevent` modifier, a `moved(-x|y|up|down)` modifier that has activated, or a `hold` modifier that has activated.
659
660 ```imba
661 # button click is triggered onless touch is held more than 500ms
662 <li @touch.hold(500ms)=draghandle> <button @click=handle>
663 ```
664
665- Improved behaviour of `@touch` and scrolling on touch devices
666 Previously, scrolling (and clicking) would be disabled for any element with a `@touch` handler on iOS. Ie. if you added `@touch` to a custom slider, scrolling would not work if the user happened to touch down on the slider while flicking down the page.
667
668 Scrolling is disabled by the `prevent` modifier, an activated `moved` modifier or activated `hold` modifier.
669
670 ```imba
671 # Scrolling will now work fine when touching the div and flicking up/down.
672 # Only if the user holds still on the element for 500ms will scrolling and
673 # default behavior be prevented.
674 <div @touch.hold(500ms)=draghandler>
675 ```
676
677- Add support for additional file extensions in bundler (webm, weba, avi, mp3, mp4, m4a, mpeg, wav, ogg, ogv, oga, opus, bmp)
678
679## 2.0.0-alpha.175
680- Fix: `@in` transitions for nested elements works
681- Experimental support for tweening from/to implicit width/height in transitions
682- Experimental `@resize.css` modifier to automatically enable size units
683- Allow variables in color opacity like `color:blue4/$alpha`
684- Experimental support for `tint:colorname` and using `tint0-9` colors in styles
685
686## 2.0.0-alpha.174
687- Named elements (`<div$myname>`) exist immediately in components
688- Fix: Spread operator works for any expression in objects
689- Fix: Make sure ::before/after comes last in selectors with other pseudo-classes>
690- Fix: Allow symbol keys in `prop/attr #my-sym-key`
691
692## 2.0.0-alpha.173
693
694- Fix: Allow binding tag properties to symbol identifiers
695- Report correct location for "Cannot redeclare variable" error (#114)
696- Experimental support for `@hotkey` events
697- Fix: Don't run `imba.commit` on unhandled events>
698- Added `@trusted` event guard
699- Added `@trap` event modifier
700
701## 2.0.0-alpha.172
702
703- Fix: Rendering list inside conditional
704- Support css blocks inside conditionals in tag trees
705- Warn about interpolated style values outside of tag trees
706- Improved specificity for nested css rules
707
708## 2.0.0-alpha.171
709
710- Fix: Make `<global @resize>` work correctly
711- Fix: Variable resolution for `let item = do ... item()`
712- Fix: Allow ternary in tag trees
713- Fix: Allow `condition && <tag>` in tag trees
714- Fix: Ternary parsing `cond ? <div> "a" : "b"`
715
716## 2.0.0-alpha.170
717
718- Added `@in` style modifier for specifying in-only transitions
719- Renamed transition hooks to `transition-(in|out)-(end|cancel)`
720- Using `<button bind=prop>` without a value acts like `<button bind=prop value=yes>`
721
722## 2.0.0-alpha.169
723
724- Fix: Various dom regressions in SSR
725- Updated default ease duration to 300ms
726
727## 2.0.0-alpha.168
728
729- Use setAttribute('class') under the hood for svg elements
730- Added `#afterVisit`, `#beforeReconcile`, `#afterReconcile` hooks
731- Added experimental easing via `<my-element ease>`, with element hooks
732 `#ease-enter`, `#ease-entered`, `#ease-enter-cancel`, and
733 `#ease-exit`, `#ease-exited`, `#ease-exit-cancel`
734- Added `ease/e`,`ease-opacity/eo`,`ease-transform/et` and `ease-colors/ec`
735 style properties for experimental easing feature
736- Fix: Passing slots into child components (#607)
737- Allow using setters on `#context`
738
739## 2.0.0-alpha.167
740
741- Add support for generic media selectors via `@media(some-media) ...`
742- Fix: Interpolated numeric value for `rotate:{val}` works i FF
743- Add @all and @speech style modifiers (for @media all/speech)
744- Fix: Allow empty css selectors
745- Fix: Rebuilt prebuilt imba.mjs for web
746
747## 2.0.0-alpha.166
748
749- Add experimental support for class decorators
750- Fix: Apply display:block to global tags without dashed name
751- Change: `inset:*` style shorthand sets `position:absolute`
752- Added `<teleport to=(sel/element)>` component (#606) by @haikyuu
753
754## 2.0.0-alpha.165
755
756- Reorganize prebuilt files for jspm support
757
758## 2.0.0-alpha.157
759
760- Add jspm configuration in package.json
761
762## 2.0.0-alpha.156
763
764- Add #**inited** hook for class instance initialization
765- All custom components defaults to display:block
766- Fix: Don't inject hmr.js script into html assets when building
767- Fix: Generate html files in public directory
768
769## 2.0.0-alpha.155
770
771- Allow `$envvar$` as first argument of implicit calls (#571)
772- Allow `super` in `extend class/tag`
773- Add experimental support for `extend someObject`
774- Variable / parameter named `self` used for implicit self in scope
775- Throw error for non-self tags in tag declaration body
776- Allow accessing array elements from end with literal numbers like `array[-1]`
777
778## 2.0.0-alpha.154
779
780- Include precompiled browser-version of library to make it work with jspm
781- Fix issue with html parser
782- Fix issue with `<input value=...>` not working in certain cases
783- Add optional static file serving for `imba serve`
784
785## 2.0.0-alpha.153
786
787- Fix issue with prop watchers not compiling correctly
788
789## 2.0.0-alpha.152
790
791- Correctly parse comments inside multi-line tag literals
792- Readable names for generated (internal) variables
793- Tag literals act as block scopes for variable declarations
794
795## 2.0.0-alpha.151
796
797- Fix interpolated style values in tag-tree selectors
798
799## 2.0.0-alpha.150
800
801- Remove charset:utf8 option from esbuild
802
803## 2.0.0-alpha.149
804
805- Fix regression with font-size presets (#569)
806
807## 2.0.0-alpha.148
808
809- Allow declaring return type via `def method\returntype arg1, ...`
810- Fix crash when inlining sourcemaps on node 16+ (#567)
811- Overhaul `extend class` code generation for better tooling support
812- BREAKING: Compile predicate identifiers `name?` to unicode `nameΦ` and
813 dashed identifiers `one-two-three` to `oneΞtwoΞthree` to avoid potential
814 naming collisions and improve tooling support. If you previously relied on
815 dashed identifiers converting to camelCase while interacting with an
816 external library - this will no longer work. Ie `window.add-event-listener`
817 will not work since `window` does not have an `addΞeventΞlistener` property.
818 See [#568](https://github.com/imba/imba/pull/568) for more info.
819
820## 2.0.0-alpha.147
821
822- Fix regression resulting in nested assets being rebuilt in incorrect folder
823
824## 2.0.0-alpha.146
825
826- Added `--asset-names` and `--html-names` build options for controlling the generated paths
827- Tweaked format of generated manifest
828- Fixed issue with generated stylesheets being blank
829- Automatically include Link preload headers when serving through imba
830- Allow all valid RegExp flags in literal regexes
831- Generate class augmentations (`extend class/tag`) in tsc mode
832- Use setAttribute for non-idl element attributes
833
834## 2.0.0-alpha.145
835
836- Fix bundler crash when parsing html entrypoints with doctype
837- Fix regression where imba `-w` would not detect changes in unhashed outputs
838
839## 2.0.0-alpha.144
840
841- Experimental `<global>` slot to add global listeners from inside tags
842- `@event.outside` modifier that works in conjunction with `<global>` slot
843
844## 2.0.0-alpha.143
845
846- Remove use of String#replaceAll (unsupported before node 15.0.0)
847
848## 2.0.0-alpha.142
849
850- Don't crash when loading tags with `@intersect` listener on server
851- Fix svg parsing issue for large svg files (#543)
852- Fix incorrect dehydration when creating custom element on client directly via document.createElement
853- Inject asset imports in correct order relative to regular imports
854- Add support for `.eot` font file reference in stylesheets
855- Auto-generate combined stylesheet for server and client accessible via `<style src='*'>`
856- Stop auto-injecting styles for referenced assets when rendering `<html>` on server
857
858## 2.0.0-alpha.141
859
860- Support webp,avif,apng,gif images in bundler
861- Fixed missing first character in non-minified css output
862- Expose imba.commit++ on globalThis
863- Fix compilation issue with `if false` inside tag tree
864- Respect custom palettes in imbaconfig.json when building
865- Allow aliasing palettes in imbaconfig.json
866- Support inlined svg elements on server
867
868## 2.0.0-alpha.140
869
870- Improve output from `imba create`
871
872## 2.0.0-alpha.139
873
874- Stop bundler from crashing when generating worker
875
876## 2.0.0-alpha.138
877
878- Fix incorrect sourcemap paths with esbuild 0.9.7
879- Let server fail gracefully when accessing invalid asset urls
880
881## 2.0.0-alpha.137
882
883- Fix relative path for mac/linux
884
885## 2.0.0-alpha.136
886
887- Raise default browser-target from `edge16` to `edge18` due to esbuild warning
888- Make `imba create` executable on mac (#550)
889- Set default esbuild target to es2019 to transpile optional chaining++
890- Avoid using `-ad` in generated class-names due to adblockers (#531)
891
892## 2.0.0-alpha.135
893
894- Minor improvements to sourcemapping
895- Fixed `import type default` compilation
896
897## 2.0.0-alpha.133
898
899- Improved sourcemapping
900- Improved support for type annotations
901- Fixed crash in bundler
902
903## 2.0.0-alpha.132
904
905- Improve windows compatibility for bundler and `imba create`
906
907## 2.0.0-alpha.131
908
909- Serve hashed (cacheable) assets with `Cache-Control: max-age=31536000`
910- Remove `?v=xxxxxx` suffix from asset references generated with `--no-hashing`
911- Allow `"external":["builtins",...]` to externalize builtin node modules for other platforms than `node`
912- Add `-H` alias for the `--no-hashing` option
913
914## 2.0.0-alpha.130
915
916- Upgraded esbuild to v0.9.2
917- Automatically polyfill built-in node modules like buffer,stream,crypto etc when compiling for browser. Still experimental.
918
919## 2.0.0-alpha.129
920
921- Prevent `touchstart` event on iPad Pro in `@touch.prevent`
922- Fixed text in svg `<text>` elements (#482)
923
924## 2.0.0-alpha.128
925
926- Fixed image asset urls in SSR
927- Make bundler work with client entrypoint without any styles
928- Dispatch bubbling `resized` event from ResizeObserver
929
930## 2.0.0-alpha.127
931
932- Overhauled `@touch` to work be more consistent on touch devices
933- Add `@touch.round` event modifier
934
935## 2.0.0-alpha.126
936
937- Prevent `touchstart` event on iOS in `@touch.prevent`
938
939## 2.0.0-alpha.125
940
941- Make custom events cancelable by default
942- Make `@-webkit-scrollbar-*` style selectors work
943- Make core event modifiers work for `@touch` event
944- Fix issue where text selection did not work after `@touch`
945- Make `@touch.prevent` prevent scrolling via `touch-action:none`
946- Add `@important` style modifier
947
948## 2.0.0-alpha.124
949
950- Update built-in colors to follow Tailwind 2.0
951- Allow interpolating colors in runtime `<div[c:{mycolor}]>`
952- Fix deep selector `>>>` with multiple nested children
953
954## 2.0.0-alpha.123
955
956- Fix router crashing when event-related runtime code is tree-shaken
957
958## 2.0.0-alpha.122
959
960- Fix issue with type inferencing tags in certain cases
961- Add `suspend`, `unsuspend` component lifecycle methods
962- Improved router interface & internals
963
964## 2.0.0-alpha.121
965
966- Added `imba.serve` to `index.d.ts`
967- Fix serious regression in router causing crash
968
969## 2.0.0-alpha.120
970
971- Parse `fn await something` correctly
972- Improved router internals
973- Add internal `Node#attachToParent` and `Node#detachFromParent` methods
974- Preserve signed zero in output (Fixes #497)
975- Make hmr reloading work with raw html assets
976- Make `--no-hashing` cli option actually work
977- Build html entrypoints in correct dist folder
978- Add `imba create` command for creating project from template
979
980## 2.0.0-alpha.119
981
982- Add support for object spread syntax `{a:1, ...obj}`
983- Fix regression causing crash when generating css
984
985## 2.0.0-alpha.118
986
987- Only call imba.commit when events are actually handled
988
989## 2.0.0-alpha.117
990
991- Alias `tabindex` to `tabIndex` in tag attributes.
992- Fix scoping issue with css in tag trees
993- Add experimental router aliases/redirects support
994- Include preflight.css at root level of package
995
996## 2.0.0-alpha.116
997
998- Convert durations (`1s`, `150ms`, `60fps` etc) to ms-based numbers on compile-time
999
1000## 2.0.0-alpha.115
1001
1002- Add `debounce` event modifier
1003
1004## 2.0.0-alpha.114
1005
1006- Add `no-minify` option to cli
1007- Always compile `html` namespaced attributes to raw `setAttribute`
1008
1009## 2.0.0-alpha.113
1010
1011- Add `__realname` as an unaltered alias for `__filename`
1012- Add support for selectors in tag tree - see [#490](https://github.com/imba/imba/issues/490)
1013
1014## 2.0.0-alpha.112
1015
1016- Show full version (including alpha number) in cli `imba --version`
1017
1018## 2.0.0-alpha.110
1019
1020- Add experimental `<tag autorender=interval>` inteface
1021- Add `?v=hash` to asset urls when filename hashing is turned off
1022- Add experimental support for `.html` entrypoints to `imba serve` and `imba build`
1023- Add `abs` and `rel` shorthands for `position` style property
1024- Fix memory leak when using `imba --watch`
1025
1026## 2.0.0-alpha.109
1027
1028- Support extending native tags `tag Purchase < form`
1029- Allow defining global tags without dash in name
1030
1031## 2.0.0-alpha.108
1032
1033- Fix issue with `@nth-of-type`, `@nth-child` selectors
1034- Improve internals of intersect event handling
1035
1036## 2.0.0-alpha.107
1037
1038- Add `asset.body` property for accessing raw content of assets
1039
1040## 2.0.0-alpha.106
1041
1042- Allow passing `rootMargin` options to intersect event
1043- Fix issue in router related to hash links
1044
1045## 2.0.0-alpha.105
1046
1047- Fix issue with css property order
1048
1049## 2.0.0-alpha.102
1050
1051- changelog and docs coming soon. see imba.io
1052
1053## 2.0.0-alpha.60
1054
1055- Add `route-to.exact` modifier to router
1056
1057## 2.0.0-alpha.59
1058
1059- Add support for numeric separator `100_000`
1060- Fix multiline regex parsing issues
1061
1062## 2.0.0-alpha.58
1063
1064- Allow setting innerHTML in SSR
1065
1066## 2.0.0-alpha.57
1067
1068- Update instantiation syntax in tests++
1069
1070## 2.0.0-alpha.56
1071
1072- Add `new Foo` instantiation syntax
1073- Deprecate `Foo.new` instantiation syntax
1074
1075## 2.0.0-alpha.55
1076
1077- Allow local/exportable tags (uppercased tag declarations)
1078- Allow interpolated tags inside strings in tag trees
1079
1080## 2.0.0-alpha.54
1081
1082- Allow getters and setters in object literals
1083
1084## 2.0.0-alpha.53
1085
1086- Allow media breakpoints in style selectors
1087- Added max-width breakpoints
1088
1089## 2.0.0-alpha.52
1090
1091- Fix issue with nested `$reference` selectors
1092- Allow router to work for regular links
1093- Add route-to.replace modifier
1094- Add route-to.sticky modifier
1095
1096## 2.0.0-alpha.51
1097
1098- No longer inheriting from CustomEvent as it is not supported in Safari
1099- Fix input data binding issue
1100- Added `before` and `after` style property modifiers
1101- Added `prefix` as alias for `before.content`
1102- Added `suffix` as alias for `after.content`
1103
1104## 2.0.0-alpha.50
1105
1106- Fix nested selector bug
1107- Fix focus-within modifier
1108- Add `:local` pseudo-class for only styling local children of component
1109- Support `$reference` in selectors for targeting local referenced elements
1110- Change `display` style property to accept multiple layout aliases
1111- Add 1-digit color aliases (blue900 -> blue9 etc)
1112
1113## 2.0.0-alpha.49
1114
1115- Allow border and border-(top|right|bottom|left) to accept a single color value
1116- Accept rgb/hsl/hex colors in text and border properties
1117
1118## 2.0.0-alpha.48
1119
1120- Added multi-purpose `text` style property for describing font-family, font-size, font-style, font-weight, text-decoration, text-transform, line-height, letter-spacing and color in a single property
1121- Added shorthand style aliases for border-_ and flex-_
1122
1123## 2.0.0-alpha.47
1124
1125- Added x, y, z, rotate, scale, scale-x, scale-y, skew-x, skew-y custom style properties
1126- Extended transition property to accept colors, styles, sizes as properties and custom easings
1127
1128## 2.0.0-alpha.46
1129
1130- Added experimental syntax for css/styling. See [#334](https://github.com/imba/imba/pull/362)
1131- Broke scoped css comment blocks until further notice
1132
1133## 2.0.0-alpha.45
1134
1135- Fix conditional rendering bug (#334)
1136- Changed event syntax from `<div :click.stop.{method()}>` to `<div @click.stop=method()>`
1137- Allow comments inside multiline tags
1138- Include left/right event key modifiers
1139- Improve resize and intersect events
1140- Always bind data when using `<tag[my-data]>` syntax
1141
1142## 2.0.0-alpha.44
1143
1144- Improved lifecycle methods for components
1145- Fix sourcemapping for env-flags
1146
1147## 2.0.0-alpha.43
1148
1149- Add syntax for element references `<div$reference>`
1150- Fix problem with missing ResizeObserver in safari
1151
1152## 2.0.0-alpha.42
1153
1154- Fixed webpack imba/loader issues with scoped css
1155- Add event wrapper for ResizeObserver
1156- Add experimental router code
1157- Add basic support for setting dom classes outside of templates
1158- Allow calling imba.mount with a function
1159- Rename #context api to $context
1160- Rename parentContext to $parent
1161
1162## 2.0.0-alpha.40
1163
1164- Introduce decorators with `@decorator` syntax. See [#334](https://github.com/imba/imba/pull/334)
1165- Allow declaring tag attributes. See [#335](https://github.com/imba/imba/pull/335)
1166- Shorthand `!` for invoking parenless methods (`object.mymethod!`)
1167- Implicit self is back (for good)
1168
1169## 2.0.0-alpha.0
1170
1171See [#263](https://github.com/imba/imba/issues/263) for an overview of changes