UNPKG

55.3 kBMarkdownView Raw
1# Changelog
2
3## 2.0.0-alpha.234
4
5* Improve memory efficiency for tooling
6
7## 2.0.0-alpha.233
8
9* Fixed sourcemapping for import/export declarations to improve tooling hints
10
11* Fixed issue with super() being injected too late in classes using mixins
12
13* Fixed issue with `instanceof` operator for mixins
14
15* Fixed `export default global class` typescript output
16
17* Allow `def` / `get` / `set` declarations without body
18
19* Prepare support for `mixin` and `interface` keywords
20
21## 2.0.0-alpha.232
22
23* Lots of internal changes preparing for beta launch.
24
25* Small utility functions are now defined in a single file and imported from 'imba/runtime' in compiled output. This allows the bundlers to much more efficiently deduplicate the output.
26
27### Typescript output for tooling
28
29Now outputting typescript instead of jsdoc-laden javascript to improve consistency, performance, and functionality of the tooling (languageservice). It will now be trivial to allow defining types and interfaces directly in imba files.
30
31As a temporary solution to not depend on typescript you can add raw complex types in multiline block comments starting with @ts:
32
33```imba
34### @ts
35type FirstType = { prop1: number; };
36type SecondType = { prop2: string;};
37type CombinedType = FirstType & SecondType;
38declare global { var SomeGlobalNumber: number; }
39###
40
41# Use the types in code
42let item\CombinedType
43```
44
45Generic arguments are also supported (experimental). Looking at a better syntax, currently it just accepts raw typescript generics.
46
47```
48# define generics for classes
49class Wrapper<T=any>
50# type arguments
51let items = new Array<Model>
52# Typed spawner method
53def spawn<Type>\InstanceType<Type> type\Type
54 return new type
55
56###
57This type of pattern is really common in typescript. In imba you can
58refer to $1,$2,$3... to refer to argument _type_ 1,2,3,... just like
59$1 in code refers to argument _value_. So that type of function can
60in Imba be written as:
61###
62def spawn\InstanceType<$1> type
63 return new type
64```
65
66### Experimental support for mixins / multiple inheritance
67
68Will be refined and improved closer to final 2.0 launch. The best thing about mixins is that in combination with the new tooling all typings and completions should just work, consistently.
69
70```imba
71# Any class can be used as a mixin
72class Logger
73 def log ...vals
74 console.log(self,...vals)
75
76class Model
77 isa Logger # injects Logger functionality
78
79let model = new Model
80model.log(123) # logs out
81
82# Reopening the logger to add functionality
83extend class Logger
84 def warn ...vals
85 console.warn(self,...vals)
86
87model.warn(123) # classes are kept in sync with mixins
88
89# You can even open existing classes and add mixins
90class Inspectable
91 isa Logger
92 def inspect
93 log "inspect",some-info
94
95# Extend all elements
96extend tag element
97 isa Inspectable
98
99```
100
101### Support for `static let/const`
102
103Add support for `static let/const` variables inside of methods. These variables will stay alive across multiple calls. When used on instances, they are scoped to their instance. Example:
104
105```
106# useful for memoization - w/o cluttering up the global namespace
107def slugify str
108 static let map = {}
109 map[str] ||= complexSlugifyOperation(str)
110
111class Item
112 def tap
113 static let count = 0
114 count++
115 console.log "You tapped 100 times!" if count == 100
116```
117
118
119
120## 2.0.0-alpha.231
121
122* Allow using `$vite$` in compiler for vite-only code.
123
124* Various fixes for vite integration.
125
126* Add `rescue` keyword
127
128 Acts like a combined try-catch wrapper for arbitrary expressions. It will return the result of the expression, _or_ the error if the expression throws. Very useful for catching rejected promises and other errors.
129
130 ```imba
131 # if this crashes you'd better have wrapped your code in a try/catch(!)
132 let res = await server.save(...)
133
134 let res = rescue await server.save(...)
135 if res isa Error
136 ...
137 # if an error was thrown inside server.save, the error is assigned to res
138 ```
139
140 You could previously do something like this with try-catch:
141
142 ```imba
143 let res = try
144 await server.save(...)
145 catch e
146 e
147 ```
148
149 But this only worked for assignments, and try/catch did not consistently
150 work inside of expressions. Syntactically rescue acts just as a regular
151 function call like `update(id, rescue(validate!))`
152
153* Accessors are no longer inited in constructor
154
155* Runtime helpers are imported instead of inlined - so bundling will not lead to many duplicated tiny functions.
156
157## 2.0.0-alpha.230
158
159* Improved integration with vite
160
161* `.env` traverse up file tree from file instead of cwd
162
163* Add `@standalone` and `@browser` style modifiers
164
165* Add custom `@mutate` event that wraps `MutationObserver` the same way `@resize` wraps `ResizeObserver` and `@intersect` wraps `IntersectionObserver`
166
167* Add built-in `@bound` decorator. This will bind methods to their class instance.
168
169 ```
170 class Item
171 # method is automatically bound to instance and can be passed around
172 # without changing self when called.
173 @bound def setup
174 yes
175 ```
176
177* Add built-in `@thenable` decorator. Very useful - wait for docs :)
178
179* Add `ease-styles` style property and make the alias `e` a shorthand for `ease-styles` instead of `ease-all`.
180
181 It's quite common to just want smooth generic easing of styles. Previously you could just do `e:200ms` or `e:300ms ease-in-out` etc, but that would add easing to _all_ properties. Many properties like `z-index`, `position`, `display` should usually not be eased, and can cause major performance issues. The default shorthand now only eases the visual properties you would usually want to ease.
182
183* Initial work on stdlib that adds functionality to builtins like String, Number, Array, Set and more. Use via `import 'imba/std'`.
184
185* Add `kb`, `mb` and `gb` units. Including these units after a literal number
186will compile to number of bytes. Ie:
187
188 ```
189 2mb # 2097152
190 1kb # 1024
191 file.size < 500kb # check a filesize
192 new Uint8Array(8mb) # Allocating an 8mb UintArray
193 ```
194
195* Various fixes and quality-of-life improvements.
196
197## 2.0.0-alpha.229
198
199* Fixed regression with style values inside parenthesis
200
201* Made `bdx` and `bdy` aliases work as intended
202
203## 2.0.0-alpha.228
204
205* Fixed issue with certain scoped selectors compiling incorrectly
206
207* Fixed `@odd`, `@even`, `@not-first` and `@not-last` selectors
208
209* Changed behaviour of `@hotkey` with multiple handlers
210
211 If multiple elements bind to the same `@hotkey` combo Imba would
212 previously always trigger them in reverse order (ie, last dom element first). If some but not all of the handlers are bound to visible elements (ie has offsetParent) it will only trigger on those.
213
214 This is useful if you have multiple pages / sections that bind to the same
215 hotkeys, and you show / hide the elements using css instead of adding and removing them from the dom.
216
217## 2.0.0-alpha.227
218
219* Fix regression which caused `.!classname` and `@!hover` negated modifiers to break.
220
221* Fix issue where css selector could not start with `^` parent reference.
222
223## 2.0.0-alpha.226
224
225We've reworked a core part of how style selectors are compiled in terms of specificity++. If your existing styles break in any way, please let us know on discord!
226
227* Fixed reference to missing index.css.map when building projects.
228
229* Fixed issue with reactivity when error was thrown inside reactive function.
230
231* Fixed issue with routed elements inside slots.
232
233* Fixed tooling to make it work with latest vscode.
234
235* Add numerous 3-letter display values for all common flex layouts.
236
237* Include `min-width` and `min-height` in list of easing properties.
238
239* Add field descriptor syntax for declaring advanced get/set wrappers for properties on classes and tags.
240
241* Add new css aliases:
242
243 ```
244 tof: text-overflow
245 tuf: text-underline-offset
246 mih: min-height
247 mah: max-height
248 miw: min-width
249 maw: max-width
250 ```
251
252* Add experimental support for `.env` files (docs coming)
253
254* Changed how `..@hover` and `..outer-class` selectors work.
255
256 They now rely on browser-support for `:matches` and `:is` which is still at ~95% support globally.
257
258* Use literaly `@` in html classes for modifiers.
259
260 If you previously relied on the fact that `d@custom-modifier:block` compiled to `.mod-custom-modifier { display: block }` you need to follow new conventions.
261
262* Add support for `^` in style modifiers for advanced targeting.
263
264 ```imba
265 # color of span is blue when button is hovered
266 <button> <span[c^@hover:blue]>
267 # opacity of nested i is 1 only when button is foxused
268 <button> <span> <i[o:0 o^^@focus:1]>
269 ```
270
271## 2.0.0-alpha.225
272
273* Automatically prefix certaib css properties for better browser compatibility.
274
275* When errors are thrown inside event handlers - a subsequent `@error` event will be triggered from the element of the throwing handler.
276
277* All new `imba create` command (by @familyfriendlymikey)
278
279* Remove support for old `prop name @set ...` syntax for watching when property is changed. Implement using descriptors instead.
280
281## 2.0.0-alpha.224
282
283* Fixed parsing of nested template literal strings.
284
285* Enable sourcemapping by default when running scripts.
286
287* Added `imba.awaits`
288
289* Make sure automatic `import {...} from 'imba'` is inserted at the very top.
290
291* Make empty catch block return the error
292
293 Useful to be able to handle things like error handling for asynchronous promises in a more compact manner:
294
295 ```imba
296 # will just swallow potential errors like before
297 let res = try await some-function
298 # ending with catch will return the error instead of the result
299 let res = try await some-function catch
300 if res isa Error
301 ...
302 ```
303
304* Various fixes
305
306## 2.0.0-alpha.223
307
308* Include safari15 as a target when compiling for web.
309
310 We recently started using class static initialization blocks to simplify
311 some internals, and this is not yet supported in safari.
312
313* Allow two parameters in `ja`/`justify-align` property to set justify/align independently.
314
315## 2.0.0-alpha.222
316
317* Enable `x` and `y` shorthands for all border properties.
318
319* Add `s` shorthand for `size`.
320
321* Deprecate `j` and `a` shorthands.
322
323* Streamlined more css shorthands and added more tests for styling
324
325## 2.0.0-alpha.221
326
327* Add shorthands for `outline-*` css properties.
328
329* Unify `ease` and `transition` css properties.
330
331 This is a breaking change. Going forward it is recommended to use the `ease` properties for all transitioning. See [documentation](https://imba.io/docs/css/easing).
332
333* Add support for custom colors in predefined box-shadows.
334
335 See [documentation](https://imba.io/docs/css/properties/box-shadow) for details.
336
337* Improvements to the router.
338
339* Rely more on esbuild to generate simpler code (ie using static blocks in classes).
340
341* Add `inherited` hook for classes.
342
343 Whenever a class is extended, the `inherited` method on the parent class will be called, with the subclass as the only argument, if one is defined.
344
345 ```imba
346 class Model
347 static def inherited subclass
348 console.log subclass,'inherited from',self
349
350 class Item < Model
351 ```
352
353## 2.0.0-alpha.219
354
355* Add import handler for `?serviceworker` suffix.
356
357 These assets are built without hashes in filename and to the root of the public folder, as is required for serviceworkers.
358
359* Deprecate `shadow` shorthand for `box-shadow` - use `bxs` instead.
360
361* Deprecate `ts` shorthand for `text-shadow` - use `txs` instead.
362
363* Support two parameters in css property `gap`
364
365## 2.0.0-alpha.216
366
367Last version (with new features) before `beta.1`. This release contains breaking changes in the bundler that need to be tested thoroughly before beta.
368
369* Use the latest version of esbuild
370
371 We are finally using the latest version of esbuild. All of our custom logic
372 for hashing, resolving and chunking is now done by esbuild instead.
373
374* Support path aliases from `[js|ts]config.json`
375
376 Now that we are using the latest version of esbuild we finally support [path aliases](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping) declared in `[js|ts]config.json` files. This also works with assets, ie. declaring `"icons/*": ["assets/svg/*","assets/codicons/*]` in your tsconfig would allow `<svg src="icons/some-icon.svg">` to work anywhere in your project.
377
378* Remove support for path aliases in `imbaconfig.json`
379
380 If you had declared path aliases in an `imbaconfig.json` these should be moved into a `[js|ts]config.json` instead.
381
382* Remove backwards compatible transforms from compiler itself.
383
384 Previously we included a bunch of logic for transforming conditional assignments like `??=`,`&&=`, and `||=` to support older browsers and node versions. Now we compile these statements as is and rely on esbuild to transform when needed.
385
386* Remove support for `?=` operator - use `??=` instead.
387
388* Drop commonjs target from compiler
389
390 The imba compiler will now always compile import/export statements natively
391 to import/export in javascript, and instead rely on esbuild to convert the output to cjs when needed.
392
393* Simplify output from `imba build`
394
395 The output of imba build is now possible to run directly through node (and soon Bun). We
396
397* Allow running html file directly with `imba some-entry.html`
398
399 This will spawn a dev-server for this html file and its referenced scripts and stylesheets.
400
401* Allow testing client-side scripts with `imba --web some-entry.imba`
402
403 This will spawn a dev-server, a html entrypoint and all that is needed to run a script in the browser.
404
405* Copy static assets over from `public` when building
406
407 If you have a `public` directory in your project, files from this will be copied over to the public folder of your output dir (default `dist`) when building.
408
409* Allow prefixing asset paths via `--base` option
410
411 Ie, when building for github pages you would run `imba build --base /my-repo-name -o docs index.html` to build your files and assets with the correct prefix, into the `docs/` folder of your project to adhere to github pages convetions.
412
413* Support loading workers following vite conventions
414
415 ```
416 import MyWorker from './some/script?worker'
417 import MySharedWorker from './some/script?sharedworker'
418 import url from './some/script?worker&url'
419 ```
420
421* Set node14.13.0 as the default minimum target when building for node.
422
423 This can be overridden by supplying your version of node through the `--node.target` option. Ie `imba build --node.target node12 my/script.imba`
424
425* Fixed regression in router that caused routed elements inside the root component to fail.
426
427## 2.0.0-alpha.214
428
429* Treat routes ending with `/` as exact routes.
430
431 The `<div route='/'>` would previously match any path. You could define exact routes by including a `$` at the end of the route. This lead to a lot
432 of confusion. Now, any route that ends with a `/` will only match the exact path. Use `*` to bypass
433
434 ```imba
435 <div route='/'> # matches / _only_
436 <div route='/*'> # matches any path
437
438 <div route='/items'> # matches /items, /items/1 etc
439 <div route='/items/'> # matches /items only
440 ```
441
442* Only show first matching element if multiple siblings match a route.
443
444 ```imba
445 <div>
446 <div route='/items/new'>
447 <div route='/items/:id'> # if /items/new matched - this will not show
448 <div route='/'> # matches if url is exactly '/'
449 <div route='*'> # matches if none of the above matches
450 ```
451
452## 2.0.0-alpha.213
453
454* Make `@event.emit('...')` on `<global/teleport>` dispath event inside their literal parent (fixes #693)
455
456## 2.0.0-alpha.210
457
458* Add number units for `minutes`, `hours`, and `days`
459
460* Fixed issue where identical nested selectors were incorrectly optimized away
461
462* Support `silent: true` option for `imba.autorun` to not call imba.commit
463
464* Fixed issue where @autorun methods threw error when element was re-mounted (#684)
465
466## 2.0.0-alpha.209
467
468* Fixed bug with observables not unsubscribing correctly in certain cases
469
470* Expose `imba.reportObserved`, `imba.reportChanged` and `imba.createAtom` (still experimental)
471
472* Add `imba.hotkeys.addKeycodes(...)` (#677)
473
474* Made `@touch.hold(dur)=handler` trigger handler after duration without waiting for additioanl events (#664)
475
476## 2.0.0-alpha.207
477
478* Don't try to implicitly return debugger statement
479
480* Improve compilation of `extend` statements for tooling
481
482## 2.0.0-alpha.206
483
484* Disallow iterating over falsy values using `for in`
485
486* Compile literal bigints correctly
487
488* Minor improvements to type definitions
489
490## 2.0.0-alpha.205
491
492* Support `for await ... of` syntax
493
494* Support tagged templates
495
496 Works like in plain js, but `{}` is still used for interpolation instead of `${}`.
497
498 ```imba
499 import md from 'tag-markdown'
500 const html = md`## Welcome to {name}`
501 ```
502
503* Add internal `#__patch__(props)` method for class instances to update fields
504
505* Stop shimming top-level await (delegates responsibility to esbuild)
506
507## 2.0.0-alpha.204
508
509* Fixed operator precedence for ternary expressions
510
511* Revert automatic `calc` wrapping for css values introduced in alpha 200
512
513 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.
514
515## 2.0.0-alpha.203
516
517* Fixed regression with negated breakpoint modifiers like `display@!600:none`
518
519## 2.0.0-alpha.202
520
521* Fixed performance regression for tag trees introduced in alpha 191
522
523* Fixed compilation of css properties wrapped in parenthesis
524
525* Make unresolved decorators resolve to `imba.@decorator`
526
527 ```imba
528 class Order
529 @lazy get lines
530 ...
531 ```
532
533 If `@lazy` is not found in the file above, the compiler will essentially include
534 `import {@lazy} from 'imba` when compiling.
535
536* Introduced experimental state management decorators
537
538 A minimal set of decorators heavily inspired by MobX that allows you to mark classes
539 and objects as observable, and run code upon changes. This feature will be kept under
540 wraps until it has been battle-tested.
541
542## 2.0.0-alpha.201
543
544* Fixed regression where css colors `rgb(0 0 0 / alpha)` would compile incorrectly
545
546## 2.0.0-alpha.200
547
548* Allow `@hotkey('*')` to listen to all hotkey events
549
550 This is perfect for disabling all other hotkeys in certain contexts.
551
552 ```imba
553 tag ConfirmDialog
554 # when this dialog is mounted - all hotkey handlers preceding
555 # it in the dom tree will be blocked by the `*` listener
556 <self @hotkey('*').global>
557 <button @hotkey('esc')> "Cancel"
558 <button @hotkey('enter')> "Ok"
559 ```
560
561* Automatically wrap style expressions in `calc()`
562
563 ```imba
564 css div width: calc(100vw - 40px)
565 # can now be written as
566 css div width: 100vw - 40px
567 ```
568
569* Make bind=data.property work for textarea when value is `undefined`
570
571* Allow nested parentheticals in css calc
572
573* Fixed issue where removing class names using `el.flags.remove` would not work
574
575* Made `@touch.flag` support selector in second argument to match `@event.flag`
576
577* Allow second argument to `el.flags.incr(flag, dur = 0)`
578
579 With this argument you can automatically decrement the flag after a certain duration.
580
581* Allow negated style modifiers
582
583 ```imba
584 css div
585 @!hover o:0.5 # div:not(:hover) { opacity: 0.5 }
586 @!md d:none # @media (max-width: 767px) { div { display:none } }
587 # also works for classes
588 css div
589 @.!disabled o:0.5 # div:not(.disabled){ opacity:0.5 }
590 ```
591
592## 2.0.0-alpha.199
593
594* Fix regression where content of `<teleport>` and `<global>` was not rendered (#643)
595
596## 2.0.0-alpha.198
597
598* Change how css specificity is forced in generated selectors
599
600 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.
601
602* Change css specificity for component rules
603
604 Selectors inside tag declarations are now compiled with a higher specificity than global selectors.
605
606 ```imba
607 tag App
608 # scoped selectors have higher precedence than global styles
609 css .selector d:block
610 ```
611
612* Fixed case where a generated class-name is added multiple times on elements
613
614## 2.0.0-alpha.197
615
616* Fixed issue with bracketless multiline object and certain operators
617
618 ```imba
619 let x = null
620 x ||=
621 one: 1
622 two: 2
623 # would previously compile incorrectly to x ||= {one: 1}
624 ```
625
626## 2.0.0-alpha.196
627
628* Introduced `@event.closest(sel)` modifier
629
630 Works like `@event.sel(selector)`, but checks for `target.closest(...)` instead of `target.matches(...)`.
631 In the cases where you want to just handle clicks that do _not_ match a selector you can negate the modifier using `.!closest(...)`.
632
633 ```imba
634 tag App
635 <self>
636 # all clicks outside of button tags
637 <div @click.!closest('button')>
638 <button> <span> "Click"
639 <p> "blabla"
640 ```
641
642## 2.0.0-alpha.195
643
644* Fixed compilation issue for functional tags without arguments
645
646* Throw error when trying to use bind on functional tags
647
648## 2.0.0-alpha.194
649
650* Improved syntax for functional tags
651
652 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.
653
654 ```imba
655 def List items
656 return if items.length == 0
657
658 <section>
659 <slot>
660 <ul> for item in items
661 <li> item.title
662
663 tag App
664 def head
665 <header> <slot> <h2> "Welcome"
666
667 <self>
668 <head()>
669 <List(data.newest)> <h2> "Newest posts"
670 <List(data.all).large> <h2> "All posts"
671 ```
672
673## 2.0.0-alpha.193
674
675* Fix issue where parts of runtime was incorrectly tree-shaked
676
677* Always resolve `node:*` imports as external
678
679* Include changelog.md in npm package
680
681## 2.0.0-alpha.191
682
683There 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;
684
685* Rename $key to key
686
687 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`.
688
689* Allow using any object as `<element key=...>` value
690
691 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.
692
693 ```imba
694 const items = [{title: "One"},{title: "Two"}]
695
696 tag App
697 <self> for item in items
698 # objects themselves can be used as keys now
699 <AppItem key=item data=item>
700 ```
701
702* New (improved) syntax for rendering functional components / tag trees
703
704 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)>`.
705
706 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.
707
708 ```imba
709 tag App
710 get body
711 <div> "This is body"
712
713 def list title, items
714 <section>
715 <h2> title
716 <ul> for item in items
717 <li> item.title
718
719 <self>
720 <( body )>
721 <( list 'Top', data.popular ).large [mt:2]>
722 <( list 'New', data.posts.slice(0,10) )>
723 ```
724
725* Log warnings to console when building/running without minification
726
727 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.
728
729* Allow instantiating elements w/o memoization using `new`
730
731 Imba will automagically allow any element (literal tag) in any method to be memoized.
732
733 ```imba
734 def wrap text
735 let div = <div.item> text
736 return div
737
738 imba.mount do <section>
739 <( wrap "One" )>
740 <( wrap "Two" )>
741 ```
742
743 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.
744
745 ```imba
746 def wrap text
747 let div = new <div.item> text
748 return div
749 ```
750
751* Allow non-global tag types in dynamic tag names
752
753 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.
754
755 ```imba
756 import {PostView,ArticleView} from './views'
757
758 const items = [
759 { type: Post, title: "My post"}
760 { type: Article, title: "My article"}
761 ]
762
763 tag App
764 <self>
765 for item in items
766 <{item.type} data=item>
767 ```
768
769* Only allow named elements inside `<self>`
770
771 Using named elements (`<div$myname>`) outside of self would previously introduce subtle bugs and conflicts. They are now only allowed inside of `<self>`.
772
773* Changed css specificity
774
775 Styles declared in tag declaration body now has lower specificity than class selectors.
776
777 ```imba
778 css .warn hue:red
779 css .large p:4 fs:lg
780
781 tag Button
782 css p:2 fs:sm hue:blue
783
784 # styles from classes take precedence
785 <Button.warn.large>
786 ```
787
788* Scoped selectors no longer applies to self
789
790 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.
791
792 ```imba
793 tag Button
794 css bg:blue2
795 css .warn bg:red2
796 css &.large fs:lg
797
798 <self.warn.large> "Still blue bg - but large"
799 ```
800
801* Add `declare` keyword for declaring fields (with type annotations) without generating any code for that field
802
803 ```imba
804 class Foo
805 declare a\number
806 ```
807
808* Allow multiline conditionals when lines start with `and`,`or`,`||`, or `&&`
809
810 This is a temporary solution for a larger challenge. It simply ignores new-lines whenever your line starts with these operators.
811
812 ```imba
813 if condition
814 and test
815 or force
816 return ...
817 ```
818
819* Allow third argument in `for in` loops referencing length
820
821 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`.
822
823 ```imba
824 for member,index,len in list
825 # len refers to the length of the iterable list
826 if index == len - 1
827 yes # this is the last element
828 ```
829
830* Exposed `imba.hotkeys.humanize` for converting hotkey combos to readable shortcuts
831
832* Exposed `imba.hotkeys.htmlify` for converting hotkey combos to readable shortcuts as html
833
834## 2.0.0-alpha.190
835
836* Fixed regression related to implicit parenthesis in tag trees
837
838* Renamed `@hotkey.capture` to `@hotkey.force`
839
840## 2.0.0-alpha.189
841
842* Introduced `@hotkey.repeat` modifier
843
844 When a user presses a key and then keeps holding it, keydown/keypress
845 events will be generated every n milliseconds. For hotkeys you usually
846 only want to trigger once when the user press the combination.
847
848 If you want the handler to keep firing while user holds down the keys
849 you can now use the `.repeat` modifier:
850
851 ```imba
852 # will only toggle when pressing space, no matter how long you
853 # keep it pressed.
854 <div @hotkey('space')=togglePlayback>
855 # holding the right arrow will call fastForward repeatedly
856 <div @hotkey('right').repeat=fastForward>
857 ```
858
859* Changed rules for implicit parenthes / calling in tag trees
860
861 Indented code under a tag-tree will no longer be compiled as an invocation.
862
863 ```imba
864 <div> data.name
865 "something"
866 if data.name
867 "something"
868 ```
869
870 The code above would previously compile to div `data.name("something")`. Now
871 indentation in tag trees will behave like they do in statements like if/for/while etc.
872 This fixes #630, so you can now add css blocks like this:
873
874 ```imba
875 <div> data.name
876 css d:block # style for the div
877 ```
878
879* Added `@first-child` and `@last-child` css modifiers
880
881 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.
882
883* Fixed issue with nested loops in tag trees
884
885 It is now possible to use nested loops without wrapping the inner loops in a fragment.
886
887 ```imba
888 <div>
889 for item in data.items
890 for label in item.labels
891 <div> label
892 ```
893
894* Allow declaring variables and global tags with the same name
895
896 Global web components should not be registered as regular variables.
897 Previously the compiler would throw an error if `tag app` and `let app = ...`
898 were declared in the same file.
899
900* Allow optional chaining with dynamic keys - #638
901
902 ```imba
903 user..[key]
904 ```
905
906* Mark imported SVGs as @__PURE__
907
908 This allows efficient tree-shaking so that one can include all icons from a collection
909 and only bundle the ones that are used.
910
911 ```imba
912 import * as icons from 'imba-codicons'
913
914 <svg src=icons.volume-up>
915 # you get completions and previews for all icons, but only volume-up
916 # will be bundled in your code now
917 ```
918
919* Don't round x,y in `@touch.reframe` and `@touch.fit` by default (#639)
920
921## 2.0.0-alpha.187
922
923* Call `dehydrate` on compononents when rendering components from the server.
924
925* Updated type declarations.
926
927## 2.0.0-alpha.186
928
929* Don't add html class name for named elements
930
931 Previously when naming an element like `<div$title> ...`, imba would automatically
932 add a `title` class name to the element. This can lead to confusing issues. If you
933 have used this undocumented behaviour previously you just need to add the class
934 yourself, like `<div$title.title>`.
935
936* Introduced `@mouse.mod` modifier
937
938 Since Mac and Windows/Linux use different keyboard modifiers for most standard actions
939 (ctrl+c,ctrl+s,ctrl+click) vs (⌘c,⌘s,⌘+click) etc, it makes sense to have an event
940 modifier that takes care of checking the platform. `@mouse.mod` will return true of
941 ⌘ is pressed on mac, and Ctrl is pressed on all other platforms.
942
943 ```imba
944 <div @click.mod.stop=openInNewWindow @click=openHere>
945 ```
946
947* Fixed bug in `@event.throttle` modifier
948
949## 2.0.0-alpha.183
950
951- Remove unneeded class names on tags when building
952
953## 2.0.0-alpha.182
954
955- Fixed issues with using event modifiers with external imba library
956
957## 2.0.0-alpha.177
958
959- Added type declarations into typings/
960
961## 2.0.0-alpha.176
962
963- Deprecated `@touch.moved-dir`
964
965 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.
966
967 ```imba
968 <div @touch.moved-left(4px)> # before
969 <div @touch.moved(4px,'left')> # after
970 ```
971
972- Renamed style property `tint` to `hue`
973
974 Hue is a better name for the newly introduced `tint` style property.
975
976 ```imba
977 # hue can be set to any named color from the imba color palette
978 <div[hue:orange]>
979 <h1[color:hue7]> # refer to a shade/tint of the aliased color
980 ```
981
982- Refactored event modifiers
983
984 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:
985
986 ```imba
987 extend class KeyboardEvent
988
989 def @f1
990 return keyCode == 112
991 ```
992
993- Changed behavior of `@event.throttle` modifier
994
995 `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.
996
997 ```imba
998 # handler will be called immediately upon scrolling and keep emitting
999 # every 100ms until there are no more scroll events.
1000 <div @scroll.throttle(100ms)=handler>
1001
1002 # So, clicking this button twice will trigger once immediately,
1003 # and then again after 1 second. Previously the second click would
1004 # never trigger.
1005 <div @click.throttle(1s)=handler>
1006 ```
1007
1008- Introduced `@event.cooldown` modifier
1009
1010 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`.
1011
1012 ```imba
1013 # So, clicking this button twice will trigger once immediately, and
1014 # the next click will be ignored as long as it happens less than a second later
1015 <div @click.cooldown(1s)=handler>
1016 ```
1017
1018- Allow negated event modifiers
1019
1020 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.
1021
1022 Ie. `<div @click.!shift=...>` would only trigger if shiftKey is _not_ pressed.
1023
1024 ```imba
1025 # Only call handler if shiftKey is NOT pressed
1026 <div @click.!shift=handler>
1027
1028 # Only call handler if target does NOT match the selector
1029 <div @click.!sel('.active')=handler>
1030 ```
1031
1032- Introduced `@mouse.left`, `@mouse.middle`, and `@mouse.right` modifiers
1033
1034 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.
1035
1036 ```imba
1037 # Only call handler if the middle mouse button was pressed
1038 <div @click.middle=handler>
1039
1040 # Only start touch handling if the right mouse button was pressed
1041 <div @touch.right=handler>
1042 ```
1043
1044- Introduced `@intersect.flag` modifier
1045
1046 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.
1047
1048 ```imba
1049 # the html class showing will be present on div
1050 # whenever it is intersecting with the viewport
1051 <div @intersect.flag('showing')>
1052 ```
1053
1054- Introduced `@touch.end` modifier
1055
1056 The `end` guard breaks unless the touch is in its ending state.
1057
1058 ```imba
1059 # handler is only called at the end of the touch
1060 <div @touch.end=handler>
1061 # handler is only called at the end of the touch if pointer moved
1062 <div @touch.moved.end=handler>
1063 ```
1064
1065- Introduced `@touch.hold(dur=1000ms)` modifier
1066
1067 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.
1068
1069 ```imba
1070 # handler is only called once the touch has been held for 1000ms
1071 <div @touch.hold=handler>
1072 # handler only called if ctrl was pressed and touch held for 250ms
1073 <div @touch.ctrl.hold(250ms)=handler>
1074 ```
1075
1076- Introduced `@touch.apply(target,xprop='x',yprop='y')` modifier
1077
1078 Like `@touch.sync` but just setting the x,y values on an object directly instead of adding to the previous values.
1079
1080 ```imba
1081 const obj = {}
1082 # apply is essentially shorthand for setting properties:
1083 <div @touch.apply(obj)>
1084 <div @touch=(obj.x = e.x, obj.y = e.y)>
1085 ```
1086
1087- Added `@event.key(keyOrCode)` modifier for keyboard events
1088
1089 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.
1090
1091 ```imba
1092 # Only trigger if F1 is pressed (event.keyCode==112)
1093 <div @keydown.key(112)=handler>
1094 ```
1095
1096 If you supply a string it will compare it against KeyboardEvent.key.
1097
1098 ```imba
1099 # Only trigger if PrintScreen is pressed (event.key=='PrintScreen')
1100 <div @keydown.key('PrintScreen')=handler>
1101 ```
1102
1103- Changed behavior of `@touch.moved` modifier
1104
1105 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.
1106
1107 ```imba
1108 # If user moves more than 10px up/down before left/right
1109 # the touch will not be handled
1110 <div @touch.moved-x(10px)=draghandle>
1111 ```
1112
1113- Improved behaviour of `@touch` and `@click` events
1114
1115 `@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.
1116
1117 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.
1118
1119 ```imba
1120 # button click is triggered onless touch is held more than 500ms
1121 <li @touch.hold(500ms)=draghandle> <button @click=handle>
1122 ```
1123
1124- Improved behaviour of `@touch` and scrolling on touch devices
1125 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.
1126
1127 Scrolling is disabled by the `prevent` modifier, an activated `moved` modifier or activated `hold` modifier.
1128
1129 ```imba
1130 # Scrolling will now work fine when touching the div and flicking up/down.
1131 # Only if the user holds still on the element for 500ms will scrolling and
1132 # default behavior be prevented.
1133 <div @touch.hold(500ms)=draghandler>
1134 ```
1135
1136- Add support for additional file extensions in bundler (webm, weba, avi, mp3, mp4, m4a, mpeg, wav, ogg, ogv, oga, opus, bmp)
1137
1138## 2.0.0-alpha.175
1139- Fix: `@in` transitions for nested elements works
1140- Experimental support for tweening from/to implicit width/height in transitions
1141- Experimental `@resize.css` modifier to automatically enable size units
1142- Allow variables in color opacity like `color:blue4/$alpha`
1143- Experimental support for `tint:colorname` and using `tint0-9` colors in styles
1144
1145## 2.0.0-alpha.174
1146- Named elements (`<div$myname>`) exist immediately in components
1147- Fix: Spread operator works for any expression in objects
1148- Fix: Make sure ::before/after comes last in selectors with other pseudo-classes>
1149- Fix: Allow symbol keys in `prop/attr #my-sym-key`
1150
1151## 2.0.0-alpha.173
1152
1153- Fix: Allow binding tag properties to symbol identifiers
1154- Report correct location for "Cannot redeclare variable" error (#114)
1155- Experimental support for `@hotkey` events
1156- Fix: Don't run `imba.commit` on unhandled events>
1157- Added `@trusted` event guard
1158- Added `@trap` event modifier
1159
1160## 2.0.0-alpha.172
1161
1162- Fix: Rendering list inside conditional
1163- Support css blocks inside conditionals in tag trees
1164- Warn about interpolated style values outside of tag trees
1165- Improved specificity for nested css rules
1166
1167## 2.0.0-alpha.171
1168
1169- Fix: Make `<global @resize>` work correctly
1170- Fix: Variable resolution for `let item = do ... item()`
1171- Fix: Allow ternary in tag trees
1172- Fix: Allow `condition && <tag>` in tag trees
1173- Fix: Ternary parsing `cond ? <div> "a" : "b"`
1174
1175## 2.0.0-alpha.170
1176
1177- Added `@in` style modifier for specifying in-only transitions
1178- Renamed transition hooks to `transition-(in|out)-(end|cancel)`
1179- Using `<button bind=prop>` without a value acts like `<button bind=prop value=yes>`
1180
1181## 2.0.0-alpha.169
1182
1183- Fix: Various dom regressions in SSR
1184- Updated default ease duration to 300ms
1185
1186## 2.0.0-alpha.168
1187
1188- Use setAttribute('class') under the hood for svg elements
1189- Added `#afterVisit`, `#beforeReconcile`, `#afterReconcile` hooks
1190- Added experimental easing via `<my-element ease>`, with element hooks
1191 `#ease-enter`, `#ease-entered`, `#ease-enter-cancel`, and
1192 `#ease-exit`, `#ease-exited`, `#ease-exit-cancel`
1193- Added `ease/e`,`ease-opacity/eo`,`ease-transform/et` and `ease-colors/ec`
1194 style properties for experimental easing feature
1195- Fix: Passing slots into child components (#607)
1196- Allow using setters on `#context`
1197
1198## 2.0.0-alpha.167
1199
1200- Add support for generic media selectors via `@media(some-media) ...`
1201- Fix: Interpolated numeric value for `rotate:{val}` works i FF
1202- Add @all and @speech style modifiers (for @media all/speech)
1203- Fix: Allow empty css selectors
1204- Fix: Rebuilt prebuilt imba.mjs for web
1205
1206## 2.0.0-alpha.166
1207
1208- Add experimental support for class decorators
1209- Fix: Apply display:block to global tags without dashed name
1210- Change: `inset:*` style shorthand sets `position:absolute`
1211- Added `<teleport to=(sel/element)>` component (#606) by @haikyuu
1212
1213## 2.0.0-alpha.165
1214
1215- Reorganize prebuilt files for jspm support
1216
1217## 2.0.0-alpha.157
1218
1219- Add jspm configuration in package.json
1220
1221## 2.0.0-alpha.156
1222
1223- Add #**inited** hook for class instance initialization
1224- All custom components defaults to display:block
1225- Fix: Don't inject hmr.js script into html assets when building
1226- Fix: Generate html files in public directory
1227
1228## 2.0.0-alpha.155
1229
1230- Allow `$envvar$` as first argument of implicit calls (#571)
1231- Allow `super` in `extend class/tag`
1232- Add experimental support for `extend someObject`
1233- Variable / parameter named `self` used for implicit self in scope
1234- Throw error for non-self tags in tag declaration body
1235- Allow accessing array elements from end with literal numbers like `array[-1]`
1236
1237## 2.0.0-alpha.154
1238
1239- Include precompiled browser-version of library to make it work with jspm
1240- Fix issue with html parser
1241- Fix issue with `<input value=...>` not working in certain cases
1242- Add optional static file serving for `imba serve`
1243
1244## 2.0.0-alpha.153
1245
1246- Fix issue with prop watchers not compiling correctly
1247
1248## 2.0.0-alpha.152
1249
1250- Correctly parse comments inside multi-line tag literals
1251- Readable names for generated (internal) variables
1252- Tag literals act as block scopes for variable declarations
1253
1254## 2.0.0-alpha.151
1255
1256- Fix interpolated style values in tag-tree selectors
1257
1258## 2.0.0-alpha.150
1259
1260- Remove charset:utf8 option from esbuild
1261
1262## 2.0.0-alpha.149
1263
1264- Fix regression with font-size presets (#569)
1265
1266## 2.0.0-alpha.148
1267
1268- Allow declaring return type via `def method\returntype arg1, ...`
1269- Fix crash when inlining sourcemaps on node 16+ (#567)
1270- Overhaul `extend class` code generation for better tooling support
1271- BREAKING: Compile predicate identifiers `name?` to unicode `nameΦ` and
1272 dashed identifiers `one-two-three` to `oneΞtwoΞthree` to avoid potential
1273 naming collisions and improve tooling support. If you previously relied on
1274 dashed identifiers converting to camelCase while interacting with an
1275 external library - this will no longer work. Ie `window.add-event-listener`
1276 will not work since `window` does not have an `addΞeventΞlistener` property.
1277 See [#568](https://github.com/imba/imba/pull/568) for more info.
1278
1279## 2.0.0-alpha.147
1280
1281- Fix regression resulting in nested assets being rebuilt in incorrect folder
1282
1283## 2.0.0-alpha.146
1284
1285- Added `--asset-names` and `--html-names` build options for controlling the generated paths
1286- Tweaked format of generated manifest
1287- Fixed issue with generated stylesheets being blank
1288- Automatically include Link preload headers when serving through imba
1289- Allow all valid RegExp flags in literal regexes
1290- Generate class augmentations (`extend class/tag`) in tsc mode
1291- Use setAttribute for non-idl element attributes
1292
1293## 2.0.0-alpha.145
1294
1295- Fix bundler crash when parsing html entrypoints with doctype
1296- Fix regression where imba `-w` would not detect changes in unhashed outputs
1297
1298## 2.0.0-alpha.144
1299
1300- Experimental `<global>` slot to add global listeners from inside tags
1301- `@event.outside` modifier that works in conjunction with `<global>` slot
1302
1303## 2.0.0-alpha.143
1304
1305- Remove use of String#replaceAll (unsupported before node 15.0.0)
1306
1307## 2.0.0-alpha.142
1308
1309- Don't crash when loading tags with `@intersect` listener on server
1310- Fix svg parsing issue for large svg files (#543)
1311- Fix incorrect dehydration when creating custom element on client directly via document.createElement
1312- Inject asset imports in correct order relative to regular imports
1313- Add support for `.eot` font file reference in stylesheets
1314- Auto-generate combined stylesheet for server and client accessible via `<style src='*'>`
1315- Stop auto-injecting styles for referenced assets when rendering `<html>` on server
1316
1317## 2.0.0-alpha.141
1318
1319- Support webp,avif,apng,gif images in bundler
1320- Fixed missing first character in non-minified css output
1321- Expose imba.commit++ on globalThis
1322- Fix compilation issue with `if false` inside tag tree
1323- Respect custom palettes in imbaconfig.json when building
1324- Allow aliasing palettes in imbaconfig.json
1325- Support inlined svg elements on server
1326
1327## 2.0.0-alpha.140
1328
1329- Improve output from `imba create`
1330
1331## 2.0.0-alpha.139
1332
1333- Stop bundler from crashing when generating worker
1334
1335## 2.0.0-alpha.138
1336
1337- Fix incorrect sourcemap paths with esbuild 0.9.7
1338- Let server fail gracefully when accessing invalid asset urls
1339
1340## 2.0.0-alpha.137
1341
1342- Fix relative path for mac/linux
1343
1344## 2.0.0-alpha.136
1345
1346- Raise default browser-target from `edge16` to `edge18` due to esbuild warning
1347- Make `imba create` executable on mac (#550)
1348- Set default esbuild target to es2019 to transpile optional chaining++
1349- Avoid using `-ad` in generated class-names due to adblockers (#531)
1350
1351## 2.0.0-alpha.135
1352
1353- Minor improvements to sourcemapping
1354- Fixed `import type default` compilation
1355
1356## 2.0.0-alpha.133
1357
1358- Improved sourcemapping
1359- Improved support for type annotations
1360- Fixed crash in bundler
1361
1362## 2.0.0-alpha.132
1363
1364- Improve windows compatibility for bundler and `imba create`
1365
1366## 2.0.0-alpha.131
1367
1368- Serve hashed (cacheable) assets with `Cache-Control: max-age=31536000`
1369- Remove `?v=xxxxxx` suffix from asset references generated with `--no-hashing`
1370- Allow `"external":["builtins",...]` to externalize builtin node modules for other platforms than `node`
1371- Add `-H` alias for the `--no-hashing` option
1372
1373## 2.0.0-alpha.130
1374
1375- Upgraded esbuild to v0.9.2
1376- Automatically polyfill built-in node modules like buffer,stream,crypto etc when compiling for browser. Still experimental.
1377
1378## 2.0.0-alpha.129
1379
1380- Prevent `touchstart` event on iPad Pro in `@touch.prevent`
1381- Fixed text in svg `<text>` elements (#482)
1382
1383## 2.0.0-alpha.128
1384
1385- Fixed image asset urls in SSR
1386- Make bundler work with client entrypoint without any styles
1387- Dispatch bubbling `resized` event from ResizeObserver
1388
1389## 2.0.0-alpha.127
1390
1391- Overhauled `@touch` to work be more consistent on touch devices
1392- Add `@touch.round` event modifier
1393
1394## 2.0.0-alpha.126
1395
1396- Prevent `touchstart` event on iOS in `@touch.prevent`
1397
1398## 2.0.0-alpha.125
1399
1400- Make custom events cancelable by default
1401- Make `@-webkit-scrollbar-*` style selectors work
1402- Make core event modifiers work for `@touch` event
1403- Fix issue where text selection did not work after `@touch`
1404- Make `@touch.prevent` prevent scrolling via `touch-action:none`
1405- Add `@important` style modifier
1406
1407## 2.0.0-alpha.124
1408
1409- Update built-in colors to follow Tailwind 2.0
1410- Allow interpolating colors in runtime `<div[c:{mycolor}]>`
1411- Fix deep selector `>>>` with multiple nested children
1412
1413## 2.0.0-alpha.123
1414
1415- Fix router crashing when event-related runtime code is tree-shaken
1416
1417## 2.0.0-alpha.122
1418
1419- Fix issue with type inferencing tags in certain cases
1420- Add `suspend`, `unsuspend` component lifecycle methods
1421- Improved router interface & internals
1422
1423## 2.0.0-alpha.121
1424
1425- Added `imba.serve` to `index.d.ts`
1426- Fix serious regression in router causing crash
1427
1428## 2.0.0-alpha.120
1429
1430- Parse `fn await something` correctly
1431- Improved router internals
1432- Add internal `Node#attachToParent` and `Node#detachFromParent` methods
1433- Preserve signed zero in output (Fixes #497)
1434- Make hmr reloading work with raw html assets
1435- Make `--no-hashing` cli option actually work
1436- Build html entrypoints in correct dist folder
1437- Add `imba create` command for creating project from template
1438
1439## 2.0.0-alpha.119
1440
1441- Add support for object spread syntax `{a:1, ...obj}`
1442- Fix regression causing crash when generating css
1443
1444## 2.0.0-alpha.118
1445
1446- Only call imba.commit when events are actually handled
1447
1448## 2.0.0-alpha.117
1449
1450- Alias `tabindex` to `tabIndex` in tag attributes.
1451- Fix scoping issue with css in tag trees
1452- Add experimental router aliases/redirects support
1453- Include preflight.css at root level of package
1454
1455## 2.0.0-alpha.116
1456
1457- Convert durations (`1s`, `150ms`, `60fps` etc) to ms-based numbers on compile-time
1458
1459## 2.0.0-alpha.115
1460
1461- Add `debounce` event modifier
1462
1463## 2.0.0-alpha.114
1464
1465- Add `no-minify` option to cli
1466- Always compile `html` namespaced attributes to raw `setAttribute`
1467
1468## 2.0.0-alpha.113
1469
1470- Add `__realname` as an unaltered alias for `__filename`
1471- Add support for selectors in tag tree - see [#490](https://github.com/imba/imba/issues/490)
1472
1473## 2.0.0-alpha.112
1474
1475- Show full version (including alpha number) in cli `imba --version`
1476
1477## 2.0.0-alpha.110
1478
1479- Add experimental `<tag autorender=interval>` inteface
1480- Add `?v=hash` to asset urls when filename hashing is turned off
1481- Add experimental support for `.html` entrypoints to `imba serve` and `imba build`
1482- Add `abs` and `rel` shorthands for `position` style property
1483- Fix memory leak when using `imba --watch`
1484
1485## 2.0.0-alpha.109
1486
1487- Support extending native tags `tag Purchase < form`
1488- Allow defining global tags without dash in name
1489
1490## 2.0.0-alpha.108
1491
1492- Fix issue with `@nth-of-type`, `@nth-child` selectors
1493- Improve internals of intersect event handling
1494
1495## 2.0.0-alpha.107
1496
1497- Add `asset.body` property for accessing raw content of assets
1498
1499## 2.0.0-alpha.106
1500
1501- Allow passing `rootMargin` options to intersect event
1502- Fix issue in router related to hash links
1503
1504## 2.0.0-alpha.105
1505
1506- Fix issue with css property order
1507
1508## 2.0.0-alpha.102
1509
1510- changelog and docs coming soon. see imba.io
1511
1512## 2.0.0-alpha.60
1513
1514- Add `route-to.exact` modifier to router
1515
1516## 2.0.0-alpha.59
1517
1518- Add support for numeric separator `100_000`
1519- Fix multiline regex parsing issues
1520
1521## 2.0.0-alpha.58
1522
1523- Allow setting innerHTML in SSR
1524
1525## 2.0.0-alpha.57
1526
1527- Update instantiation syntax in tests++
1528
1529## 2.0.0-alpha.56
1530
1531- Add `new Foo` instantiation syntax
1532- Deprecate `Foo.new` instantiation syntax
1533
1534## 2.0.0-alpha.55
1535
1536- Allow local/exportable tags (uppercased tag declarations)
1537- Allow interpolated tags inside strings in tag trees
1538
1539## 2.0.0-alpha.54
1540
1541- Allow getters and setters in object literals
1542
1543## 2.0.0-alpha.53
1544
1545- Allow media breakpoints in style selectors
1546- Added max-width breakpoints
1547
1548## 2.0.0-alpha.52
1549
1550- Fix issue with nested `$reference` selectors
1551- Allow router to work for regular links
1552- Add route-to.replace modifier
1553- Add route-to.sticky modifier
1554
1555## 2.0.0-alpha.51
1556
1557- No longer inheriting from CustomEvent as it is not supported in Safari
1558- Fix input data binding issue
1559- Added `before` and `after` style property modifiers
1560- Added `prefix` as alias for `before.content`
1561- Added `suffix` as alias for `after.content`
1562
1563## 2.0.0-alpha.50
1564
1565- Fix nested selector bug
1566- Fix focus-within modifier
1567- Add `:local` pseudo-class for only styling local children of component
1568- Support `$reference` in selectors for targeting local referenced elements
1569- Change `display` style property to accept multiple layout aliases
1570- Add 1-digit color aliases (blue900 -> blue9 etc)
1571
1572## 2.0.0-alpha.49
1573
1574- Allow border and border-(top|right|bottom|left) to accept a single color value
1575- Accept rgb/hsl/hex colors in text and border properties
1576
1577## 2.0.0-alpha.48
1578
1579- 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
1580- Added shorthand style aliases for border-_ and flex-_
1581
1582## 2.0.0-alpha.47
1583
1584- Added x, y, z, rotate, scale, scale-x, scale-y, skew-x, skew-y custom style properties
1585- Extended transition property to accept colors, styles, sizes as properties and custom easings
1586
1587## 2.0.0-alpha.46
1588
1589- Added experimental syntax for css/styling. See [#334](https://github.com/imba/imba/pull/362)
1590- Broke scoped css comment blocks until further notice
1591
1592## 2.0.0-alpha.45
1593
1594- Fix conditional rendering bug (#334)
1595- Changed event syntax from `<div :click.stop.{method()}>` to `<div @click.stop=method()>`
1596- Allow comments inside multiline tags
1597- Include left/right event key modifiers
1598- Improve resize and intersect events
1599- Always bind data when using `<tag[my-data]>` syntax
1600
1601## 2.0.0-alpha.44
1602
1603- Improved lifecycle methods for components
1604- Fix sourcemapping for env-flags
1605
1606## 2.0.0-alpha.43
1607
1608- Add syntax for element references `<div$reference>`
1609- Fix problem with missing ResizeObserver in safari
1610
1611## 2.0.0-alpha.42
1612
1613- Fixed webpack imba/loader issues with scoped css
1614- Add event wrapper for ResizeObserver
1615- Add experimental router code
1616- Add basic support for setting dom classes outside of templates
1617- Allow calling imba.mount with a function
1618- Rename #context api to $context
1619- Rename parentContext to $parent
1620
1621## 2.0.0-alpha.40
1622
1623- Introduce decorators with `@decorator` syntax. See [#334](https://github.com/imba/imba/pull/334)
1624- Allow declaring tag attributes. See [#335](https://github.com/imba/imba/pull/335)
1625- Shorthand `!` for invoking parenless methods (`object.mymethod!`)
1626- Implicit self is back (for good)
1627
1628## 2.0.0-alpha.0
1629
1630See [#263](https://github.com/imba/imba/issues/263) for an overview of changes