While waiting for some of the features in the main branch to finish baking for
the v0.4 release why not enjoy some bugfixes, doc cleanups, and refactors right
now?
Fixed
- Fixed a panic that occured when the viewed file gets removed or renamed (#145)
- Made live code reloading more robust (#106 & #147)
- Live code reloading should work with more editors (e.g. neovim)
- Live code reloading should more reliable watch the desired file
- Improved syntax highlighting (#150)
- We now support highlighting many more formats (e.g. TOML, Dockerfiles, etc.)
- We now support highlighting code blocks that use a language marker followed
by a comma like ```rust,ignore
- Nested numbered lists now display ordering correctly (#154)
- Fixed a panic that occured on some specific system configurations (#169)
Docs
- Use a repology badge for package manager installation (#109)
- Make correct location of config file more clear (#122)
Along with a whole slew of internal refactors and testing improvements
I'd also like to give a big thanks to all of the contributors that helped make
this release possible!
Parsing
- Added support for SCSS.
- Updated the Kotlin parser and improved handling of Kotlin nullable types.
- .snap files (Jest snapshots) are now detected as JavaScript files.
Diffing
- Fixed an issue where adding or removing blank lines would be ignored by the
textual diffing logic.
- Directory diffing now respects .gitignore files.
- Directory diffing can now be sorted by path with the --sort-paths option.
Command Line Interface
- Added the option --strip-cr. This removes all carriage return characters
before diffing, which is helpful when dealing with a mix of Windows and
non-Windows flies.
- The option --skip-unchanged now has a corresponding environment option
DFT_SKIP_UNCHANGED.
Build
- Difftastic now requires Rust 1.60 to build.
Release v2.10.4 (2023-11-24)
----------------------------
Bug Fixes
- Do not detect as requirements.txt if the file is a python script.
- Provide information of the original line when parsing requirement fails.
- Resolve `-r` requirements paths relative to the requirement file they are specified.
- Updating package now overwrites the old files instead of removing before installing.
frozendict 2.3.9
Various improvements to type hints
Fix union of frozendict for python implementation
Avoid storing empty singleton on class itself in python implementation
Now pure py implementation can be built also passing the FROZENDICT_PURE_PY env var with value 1
Changelog:
October 26, 2023
# Version 27.1.3
Changes:
* Fix: Escape group names for LDAP (server#37201) 2
* Fix(updatenotification): Skip update check (server#39826)
* Fix: Avoid failing with duplicate checks (server#40383) 1
* Add wrapper for external storage to ensure we don??t get an mtime that is
lower than we know it is (server#40569)
* Clear progress bar text when hiding it (server#40572) 1
* Use multipart copy for s3 (server#40577)
* Enh(a11y): Add label to share note textbox (server#40681)
* Fix(unifiedsearch): Allow searching for ??0?? (server#40683)
* Fix Dashboard IManager getWidgets return annotation (server#40695)
* Multiple bug fix in users list (server#40718)
* Fix: Escape group names for LDAP (server#40739) 1
* Updates to new sharing flow (server#40747) 1
* Fix: encode uri for trashbin delete (server#40757)
* Feat: Add occ user:user:sync-account-data for updating oc_accounts
information from user backends (server#40759)
* Fix(files): Show correct quota size (file size base 2) (server#40787) 1
* Fix(user): Log affected user of app token login name mismatch (server#
40797) 1
* Added CORS skip if session was created by AppAPI (server#40830)
* Generate all preview sizes for Imaginary (server#40834) 1
* Fixed mixed translations in sharing details (server#40837)
* Fix: Log critical session renewal and logout paths (server#40849)
* Remove leading slash (server#40856)
* Add in:users as a search filter to limit searches to users (server#40882)
* Update version.php to owncloud 10.13 (server#40987) 2
* Fix(external): Get storage before update it (server#41124)
* Fixes and additions to editor API (text#4838)
* Enh(editorApi): Introduce editor API version number (text#4841)
* Fix(editorApi): Use attachment resolver in MarkdownContentEditor (text#
4845)
* Fix(paste): paste plaintext with separate paragraphs (text#4879)
October 5, 2023
# Version 27.1.2
Changes:
* Chore: Update `@nextcloud/dialogs` to 4.2.1 (server#40557)
* Let `occ trashbin:restore` restore also from groupfolders and add filters
(server#40581)
* Ocm services (server#40586)
* Revert change that made `OC.Util.humanFileSize` return decimal sizes
instead of binary (server#40605)
* Store size in int|float for 32bit support (server#40623)
* Fix(dav): expand recurrences when searching (server#40631)
* Fix jsunit tests (server#40638)
* Use proper app id in Version.vue (server#40640)
* Fix: encode uri for trashbin delete (server#40642)
* Fix ocm-provider rewrite rules (server#40778)
* Fix(db): also chunk MariaDB deletes (activity#1312)
* Re-enabled cypress tests (activity#1336)
* Run npm audit fix (activity#1339)
* Return if user is empty (firstrunwizard#953)
* Chore(deps): Bump howler from 2.2.3 to 2.2.4 (notifications#1672)
* Bump cypress to v13 (photos#2057)
* Fix(security): Bump semver (suspicious_login#815)
* Fix(deps): update nextcloud abandoned (text#4756)
* Bugfix/duplicated load of yjs (text#4807)
* Feat: hide workspace if no readme.md (text#4811)
September 21, 2023
# Version 27.1.1
Changes:
* Fix issues where unencrypted_size was being falsely used for non-encrypted
home folders (server#40379)
* Fix alignments for share different share entry types. (server#40429)
* Fix: use faster method to fetch user count (server#40433)
* Fix: don??t use davtags for tag search (server#40444)
* Backport consider link shares in removeShare method in SharingTab #40440
(server#40448)
* Fix(mimetype): Fix aborted transaction on PostgreSQL when storing mimetype
(server#40461)
* Don??t preload metadata for the sub-childen (server#40473)
* SFTP improvements (server#40487)
* Fix(comments): Use provided offset in best effort when loading comments
(server#40506)
* Fix: content info footer on guest pages (server#40520)
* Consider share type for enforced share expiry dates (server#40530)
* Auto set password for new email shares (server#40535)
* Allow printing log messages during occ (logreader#997)
* Update nextcloud/ocp dependency (nextcloud_announcements#233)
* Update nextcloud/ocp dependency (notifications#1656)
* Fix (visually) removing first notification when executing an action
(notifications#1662)
* Update nextcloud/ocp dependency (text#4789)
September 16, 2023
# Version 27.1.0
Changes:
* Improved display of app links (server#38526)
* Show supported apps on app settings if subscribed (server#39637)
* Fix(notifications): Remove share notification when the node is deleted
(server#39710)
* Catch more invalid cache source storage paths (server#39722)
* Fix npm audit (server#39728)
* Feat(HTTPClient): Provide wrapped access to Guzzle??s asyncRequest()
(server#39740)
* Avoid adding (attribute=) part to filter which will confuse LDAP servers
(server#39746)
* Expose gps data via webdav (server#39755)
* Fix(3rdparty): Revert accidental 3rdparty bump (server#39761)
* Support opening and comparing versions in viewer (server#39763)
* Feat: File reminders backend (server#39764)
* The almighty text processing PR (server#39776)
* Feat: Set file reminders (server#39783)
* Feat(caldav): linkify location in scheduling mails (server#39784)
* Optimize calendar search query (server#39785)
* Vue based FilePicker (server#39793)
* Fix: Pass proper viewer filename (server#39794)
* Log imaginary errors as info to not spam the server logs (server#39795)
* AppEcosystem Authentification (server#39799)
* Enh(files_reminders): Adjust reminder options (server#39800)
* Update `@nextcloud/dialogs` for FilePicker design fixes (server#39803)
* Chore: update `@nextcloud-vue` to `v7.12.2` (server#39813)
* Fix: close cursor after reading the invitation (server#39817)
* Wrap long productName on login form (server#39853)
* Add l10n for files_reminders (server#39855)
* Calendar optimizations (server#39858)
* Select the fileid first when looking for incomplete files (server#39871)
* Fix: Also cleanup version metadata if expiring (server#39873)
* Bump Hub 5 -> Hub 6 (server#39886)
* Fix various file reminders bugs (server#39887)
* Reduce the number of container queries (server#39890)
* Fix smart picker integration of new Vue based file picker (server#39893)
* Fix(CardDAV): set owner-principal, displayname properties for SAB (server#
39900)
* Enh(contacts): show/hide addressbooks for all (server#39904)
* Update `@nextcloud/dialogs` to 4.2.0-beta.3 to fix FilePicker issues
(server#39913)
* Adjust add button (server#39915)
* Fix(files): Fix legacy files list sorting (server#39919)
* Try to fix regression with public file upload button (server#39921)
* Prevent PHP warning when CacheEntry extension keys are not set (server#
39930)
* Fix: don??t emit Hooks when hookpaths are empty (server#39934)
* Chore: update tarstreamer to 2.1.0 (server#39939)
* Fix(memcache): Fix comparison of Memcache configs to classes (server#39947)
* Fix: always use display name from correct backend (server#39949)
* Allow to upgrade from 26.0.x to 27.1.x directly (server#39952)
* Don??t bother checking dav acl??s in files (server#39953)
* Fix(CS): Use the naming pattern for the URL scheme (server#39962)
* Feat(dashboard): implement widget item api v2 (server#39993)
* Feat(security): Add a bruteforce protection backend base on memcache
(server#39997)
* Fix(security): Update CA certificate bundle (server#40007)
* Chore: Update `@nextcloud/dialogs` to 4.2.0-beta.4 for FilePicker
improvments (server#40030)
* Do not log passwords in debug mode (server#40032)
* Fix user log.condition feature (server#40034)
* Fix(utility): De- deprecate getDateTime and getTime as now() only returns
DateTimeImmutable (server#40039)
* Encode filename trashbin restore (server#40045)
* Improve upload progress visualization (server#40060)
* Fix(theming): Add `__webpack_nounce__` to support async chunks (server#
40062)
* Fix(CardDAV): only run upgrade sync if 1000 users or less (server#40066)
* Pass the share to the cache instead of having to ask the storage (server#
40074)
* Hide shares by disabled users (server#40078)
* Fix(cache): Remove displayname cache entry on delete (server#40080)
* Fix(CalDAV): check voject exists before attempting any operation (server#
40081)
* Fix(CI): Add empty eslint and node when unrelated (PHP only) (server#40101)
* Feat: add switch to disable dns pinning (server#40162)
* Revert accidental direct push of 8b42fb033fdcd3775b4850de6faf6091c8dcc716
(server#40175)
* Improve sharing flow (server#40179)
* Fix(s3): fix handling verify_bucket_exists parameter (server#40186)
* Chore(3rdparty): update sabre/http to 5.1.10 (server#40197)
* Fix(CardDAV): allow disabling of the system address book (server#40200)
* Fix npm audit (server#40220)
* Fix: prevent sharing permissions on user root folder (server#40227)
* Move share permission logic to storage wrapper (server#40231)
* Enh: skip processing for empty response (server#40258)
* Change proftpd ci image (server#40269)
* Admin have no special rights on users?? entries (server#40271)
* Chore: Bump @nextcloud/dialogs to v4.2.0 beta 5 (server#40281)
* Detect aborted connection in OC\Files\View and stop writing data to t??
(server#40286)
* Feat: Add events for version restore (server#40297)
* Enable download configuration on circles shares (server#40298)
* Fix(ratelimit): Only use memory cache backend for redis (server#40300)
* Fix(CalDAV): check birthday calendar owner (server#40309)
* Rename AppEcosystemV2 to AppAPI (server#40315)
* Backport Polish new sharing flow : accesibility, expand bahavior, click
outside behaviour (server#40327)
* Theming: Revert broken SVG optimization in default-source.svg (server#
40333)
* Enable new versions feature for groupfolders (server#40339)
* Fix: Hide set reminder action on public shares (server#40342)
* 40289 fix appearance (server#40343)
* Fix(autoloader): no apcu no side effects (server#40350)
* Fix(ldap): avatar is not being fetched (server#40369)
* Backport polish sharing flow bugs (server#40390)
* Fix(caldav): add webroot to objectid for activities (server#40402)
* Display user status by the side in sharing flow (server#40405)
* Ellipsize user status in sharing entry (server#40412)
* Hide additional content when share details is open (server#40414)
* Fix invite guest for new sharing flow (server#40415)
* Bump @nc/dialogs to 4.2.0 (server#40417)
* Correctly switch/revert from custom to bundled perms (server#40437)
* Chore(deps): Bump cweagans/composer-patches from 1.7.1 to 1.7.3 (3rdparty#
1525)
* Chore(deps): Bump deepdiver1975/tarstreamer from 2.0.0 to 2.1.0 (3rdparty#
1531)
* Chore(deps): update sabre/http to 5.1.10 in stable27 (3rdparty#1560)
* Perf(dashboard): implement widget item api v2 (activity#1299)
* Chore(deps): Downgrade nextcloud/ocp to stable27 (activity#1301)
* Resolve dependency hell (activity#1304)
* Chore(CI): Adjust testing matrix for Nextcloud 27 on stable27
(bruteforcesettings#459)
* Filter system circles (circles#1381)
* Download permissions on share for internal/external members (circles#1384)
* Support files_external (circles#1386)
* Feat: Fix styling for version comparison (files_pdfviewer#795)
* Chore(deps-dev): Bump @nextcloud/stylelint-config from 2.3.0 to 2.3.1
(files_pdfviewer#801)
* Fix extraction of PDF.js package (files_pdfviewer#807)
* Fix(CI): Fix OCP package on stable27 (nextcloud_announcements#226)
* Update nextcloud/ocp dependency (nextcloud_announcements#229)
* Fix(CI): Fix nextcloud/ocp package version (notifications#1638)
* Fix(fairuse): Adjust website URL (notifications#1639)
* Update nextcloud/ocp dependency (notifications#1650)
* Chore(deps): Bump webdav from 4.11.0 to 4.11.2 (photos#1814)
* Fix npm audit (photos#1958)
* Chore(deps-dev): Bump postcss from 8.4.19 to 8.4.27 (photos#1967)
* Chore(deps-dev): Bump jest from 29.6.1 to 29.6.2 (photos#1968)
* Chore(deps): Bump jest-environment-jsdom from 29.4.1 to 29.4.3 (photos#
1969)
* Chore(deps-dev): Bump autoprefixer from 10.4.13 to 10.4.14 (photos#1970)
* Chore(deps): Bump immutable from 4.3.0 to 4.3.2 (photos#1990)
* Chore(deps-dev): Bump @vue/vue2-jest from 29.2.4 to 29.2.5 (photos#1997)
* Chore(deps-dev): Bump @nextcloud/stylelint-config from 2.3.0 to 2.3.1
(photos#1998)
* Chore(deps-dev): Bump tslib from 2.5.0 to 2.5.3 (photos#2004)
* Chore(deps-dev): Bump autoprefixer from 10.4.14 to 10.4.15 (photos#2011)
* Fix npm audit (photos#2016)
* Fix npm audit (recommendations#643)
* Perf(dashboard): implement widget item api v2 (recommendations#649)
* Update nextcloud/ocp dependency (related_resources#271)
* Fix: handle non markdown files in conflicts (text#4272)
* Chore(deps): update dependency cypress to ^12.17.3 (text#4631)
* Chore(deps): update dependency vite to ^4.4.9 (text#4633)
* Update nextcloud/ocp dependency (text#4640)
* Fix: Use default font size (text#4647)
* Fix: Use resize observer to calculate menubar icon limit (text#4649)
* Fix(css): Move code highlighting CSS to `prosemirror.scss` (text#4651)
* Feat: add component SkeletonLoading (text#4655)
* Feat: Add support for mermaid.js rendering (text#4656)
* Allow opening files outside of the file system in viewer (text#4658)
* Feat: Expose formatting menu bar actions through slash command (text#4661)
* Text processing integration (text#4662)
* Chore(deps): update dependency @vue/vue2-jest to ^29.2.5 (text#4675)
* Fix missing text on assistant task list (text#4679)
* Ci(cypress): Fix selectors for new file picker (text#4680)
* Chore(deps): update dependency cypress to ^12.17.4 (text#4694)
* Fix: Sort regular smart picker options first (text#4697)
* Fix(deps): update dependency @nextcloud/files to ^3.0.0-beta.16 (text#4704)
* Fix(deps): update dependency @nextcloud/vue to ^7.12.2 (text#4705)
* Fix(deps): update dependency lib0 to ^0.2.82 (text#4706)
* Fix(deps): update dependency mermaid to ^10.3.1 (text#4708)
* Chore(deps): update dependency eslint-plugin-cypress to ^2.14.0 (text#4709)
* Fix(deps): update tiptap to ^2.1.6 (text#4710)
* Update nextcloud/ocp dependency (text#4731)
* Chore(deps): update dependency vue-demi to ^0.14.6 (text#4737)
* Chore(deps): update jest to ^29.6.4 (text#4738)
* Chore(deps): update dependency vite-plugin-commonjs to ^0.9.0 (text#4739)
* Fix: select all in code block (text#4748)
* Fix(deps): update tiptap to ^2.1.7 (text#4757)
* Chore(deps): update vueuse to ^10.4.1 (text#4758)
* Fix(deps): update dependency mermaid to ^10.4.0 (text#4759)
* Update nextcloud/ocp dependency (text#4765)
* List fixes (text#4774)
* Bump @nextcloud/dialogs to 4.2.0 (text#4794)
* Ci(xmllint): bump action to v1.1 (twofactor_totp#1429)
* Chore(deps-dev): Bump @nextcloud/stylelint-config from 2.3.0 to 2.3.1
(viewer#1808)
* Update cypress snapshots (viewer#1816)
* Fix npm audit (viewer#1828)
* Default to source if fileid is undefined (viewer#1848)
* Add option to disable sidebar (viewer#1849)
* Feat: Compare files side by side (viewer#1850)
* Fix: Avoid issues when switching between versions (viewer#1852)
* Chore(deps-dev): Bump eslint-plugin-cypress from 2.13.3 to 2.13.4 (viewer#
1856)
* Update cypress snapshots (viewer#1869)
* Fix(cypress): header sharing download button selector (viewer#1871)
* Fix panning of zoomed images (viewer#1874)
* Fix(deps): update dependency @nextcloud/l10n to ^2.2.0 (viewer#1907)
* Fix(deps): update dependency filerobot-image-editor to ^4.5.1 (viewer#1908)
* Chore(deps): update dependency jest to ^29.6.4 (viewer#1933)
* Fix(deps): update dependency @nextcloud/auth to ^2.1.0 (viewer#1937)
- Add support for DBaaS FerretDB subscriptions
- Add support for public/private host, cleanup summarize view
- Add support for the VKE HA control plane option
- Adjust DBaaS VPC pointer to detect changes
- Allow some commands to be run without authenticating against the API
... and dozens of other versions.
- Bugfixes.
- Better API for s6-tlsc-io: now "s6-tlsc-io 6 7" is the equivalent
of s6-ioconnect with TLS, and can be used interactively as a client
program to talk to TLS-tunneled services.
- The -K option for TLS programs now set a timeout for the whole handshake.
- The -h option for s6-tcpclient and s6-tcpserver-access now indicates
/etc/hosts should be consulted before DNS.
- New s6dns_init_options() function, to choose whether
to support /etc/hosts or not.
- Properly ignore link-local addresses in hosts files
instead of erroring out on them.
- New s6dns_hosts_name46() macro.
Changelog:
# v2.0.0 - 2023-08-01
Version 2.0 is a big milestone with too many changes to list them all here.
For a full list see [details](changelog_2_0_0_details.html).
## New features
### Better tuple unpacking
Tuple unpacking for variables is now treated as syntax sugar that directly
expands into multiple assignments. Along with this, tuple unpacking for
variables can now be nested.
```nim
proc returnsNestedTuple(): (int, (int, int), int, int) = (4, (5, 7), 2, 3)
# Now nesting is supported!
let (x, (_, y), _, z) = returnsNestedTuple()
```
### Improved type inference
A new form of type inference called [top-down inference](https://nim-lang.github.io/Nim/manual_experimental.html#topminusdown-type-inference) has been implemented for a variety of basic cases.
For example, code like the following now compiles:
```nim
let foo: seq[(float, byte, cstring)] = @[(1, 2, "abc")]
```
### Forbidden Tags
[Tag tracking](https://nim-lang.github.io/Nim/manual.html#effect-system-tag-tracking) now supports the definition
of forbidden tags by the `.forbids` pragma which can be used to disable certain effects in proc types.
For example:
```nim
type IO = object ## input/output effect
proc readLine(): string {.tags: [IO].} = discard
proc echoLine(): void = discard
proc no_IO_please() {.forbids: [IO].} =
# this is OK because it didn't define any tag:
echoLine()
# the compiler prevents this:
let y = readLine()
```
### New standard library modules
The famous `os` module got an overhaul. Several of its features are available
under a new interface that introduces a `Path` abstraction. A `Path` is
a `distinct string`, which improves the type safety when dealing with paths, files
and directories.
Use:
- `std/oserrors` for OS error reporting.
- `std/envvars` for environment variables handling.
- `std/paths` for path handling.
- `std/dirs` for directory creation/deletion/traversal.
- `std/files` for file existence checking, file deletions and moves.
- `std/symlinks` for symlink handling.
- `std/appdirs` for accessing configuration/home/temp directories.
- `std/cmdline` for reading command line parameters.
### Consistent underscore handling
The underscore identifier (`_`) is now generally not added to scope when
used as the name of a definition. While this was already the case for
variables, it is now also the case for routine parameters, generic
parameters, routine declarations, type declarations, etc. This means that the following code now does not compile:
```nim
proc foo(_: int): int = _ + 1
echo foo(1)
proc foo[_](t: typedesc[_]): seq[_] = @[default(_)]
echo foo[int]()
proc _() = echo "_"
_()
type _ = int
let x: _ = 3
```
Whereas the following code now compiles:
```nim
proc foo(_, _: int): int = 123
echo foo(1, 2)
proc foo[_, _](): int = 123
echo foo[int, bool]()
proc foo[T, U](_: typedesc[T], _: typedesc[U]): (T, U) = (default(T), default(U))
echo foo(int, bool)
proc _() = echo "one"
proc _() = echo "two"
type _ = int
type _ = float
```
### JavaScript codegen improvement
The JavaScript backend now uses [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
for 64-bit integer types (`int64` and `uint64`) by default. As this affects
JS code generation, code using these types to interface with the JS backend
may need to be updated. Note that `int` and `uint` are not affected.
For compatibility with [platforms that do not support BigInt](https://caniuse.com/bigint)
and in the case of potential bugs with the new implementation, the
old behavior is currently still supported with the command line option
`--jsbigint64:off`.
## Docgen improvements
`Markdown` is now the default markup language of doc comments (instead
of the legacy `RstMarkdown` mode). In this release we begin to separate
RST and Markdown features to better follow specification of each
language, with the focus on Markdown development.
See also [the docs](https://nim-lang.github.io/Nim/markdown_rst.html).
* Added a `{.doctype: Markdown | RST | RstMarkdown.}` pragma allowing to
select the markup language mode in the doc comments of the current `.nim`
file for processing by `nim doc`:
1. `Markdown` (default) is basically CommonMark (standard Markdown) +
some Pandoc Markdown features + some RST features that are missing
in our current implementation of CommonMark and Pandoc Markdown.
2. `RST` closely follows the RST spec with few additional Nim features.
3. `RstMarkdown` is a maximum mix of RST and Markdown features, which
is kept for the sake of compatibility and ease of migration.
* Added separate `md2html` and `rst2html` commands for processing
standalone `.md` and `.rst` files respectively (and also `md2tex`/`rst2tex`).
* Added Pandoc Markdown bracket syntax `[...]` for making anchor-less links.
* Docgen now supports concise syntax for referencing Nim symbols:
instead of specifying HTML anchors directly one can use original
Nim symbol declarations (adding the aforementioned link brackets
`[...]` around them).
* To use this feature across modules, a new `importdoc` directive was added.
Using this feature for referencing also helps to ensure that links
(inside one module or the whole project) are not broken.
* Added support for RST & Markdown quote blocks (blocks starting with `>`).
* Added a popular Markdown definition lists extension.
* Added Markdown indented code blocks (blocks indented by >= 4 spaces).
* Added syntax for additional parameters to Markdown code blocks:
```nim test="nim c $1"
...
```
## C++ interop enhancements
Nim 2.0 takes C++ interop to the next level. With the new [virtual](https://nim-lang.github.io/Nim/manual_experimental.html#virtual-pragma) pragma and the extended [constructor](https://nim-lang.github.io/Nim/manual_experimental.html#constructor-pragma) pragma.
Now one can define constructors and virtual procs that maps to C++ constructors and virtual methods, allowing one to further customize
the interoperability. There is also extended support for the [codeGenDecl](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma) pragma, so that it works on types.
It's a common pattern in C++ to use inheritance to extend a library. Some even use multiple inheritance as a mechanism to make interfaces.
Consider the following example:
```cpp
struct Base {
int someValue;
Base(int inValue) {
someValue = inValue;
};
};
class IPrinter {
public:
virtual void print() = 0;
};
```
```nim
type
Base* {.importcpp, inheritable.} = object
someValue*: int32
IPrinter* {.importcpp.} = object
const objTemplate = """
struct $1 : public $3, public IPrinter {
$2
};
""";
type NimChild {.codegenDecl: objTemplate .} = object of Base
proc makeNimChild(val: int32): NimChild {.constructor: "NimClass('1 #1) : Base(#1)".} =
echo "It calls the base constructor passing " & $this.someValue
this.someValue = val * 2 # Notice how we can access `this` inside the constructor. It's of the type `ptr NimChild`.
proc print*(self: NimChild) {.virtual.} =
echo "Some value is " & $self.someValue
let child = makeNimChild(10)
child.print()
```
It outputs:
```
It calls the base constructor passing 10
Some value is 20
```
## ARC/ORC refinements
With the 2.0 release, the ARC/ORC model got refined once again and is now finally complete:
1. Programmers now have control over the "item was moved from" state as `=wasMoved` is overridable.
2. There is a new `=dup` hook which is more efficient than the old combination of `=wasMoved(tmp); =copy(tmp, x)` operations.
3. Destructors now take a parameter of the attached object type `T` directly and don't have to take a `var T` parameter.
With these important optimizations we improved the runtime of the compiler and important benchmarks by 0%! Wait ... what?
Yes, unfortunately it turns out that for a modern optimizer like in GCC or LLVM there is no difference.
But! This refined model is more efficient once separate compilation enters the picture. In other words, as we think of
providing a stable ABI it is important not to lose any efficiency in the calling conventions.
## Tool changes
- Nim now ships Nimble version 0.14 which added support for lock-files. Libraries are stored in `$nimbleDir/pkgs2` (it was `$nimbleDir/pkgs` before). Use `nimble develop --global` to create an old style link file in the special links directory documented at https://github.com/nim-lang/nimble#nimble-develop.
- nimgrep now offers the option `--inContext` (and `--notInContext`), which
allows to filter only matches with the context block containing a given pattern.
- nimgrep: names of options containing "include/exclude" are deprecated,
e.g. instead of `--includeFile` and `--excludeFile` we have
`--filename` and `--notFilename` respectively.
Also, the semantics are now consistent for such positive/negative filters.
- Nim now ships with an alternative package manager called Atlas. More on this in upcoming versions.
## Porting guide
### Block and Break
Using an unnamed break in a block is deprecated. This warning will become an error in future versions! Use a named block with a named break instead. In other words, turn:
```nim
block:
a()
if cond:
break
b()
```
Into:
```nim
block maybePerformB:
a()
if cond:
break maybePerformB
b()
```
### Strict funcs
The definition of `"strictFuncs"` was changed.
The old definition was roughly: "A store to a ref/ptr deref is forbidden unless it's coming from a `var T` parameter".
The new definition is: "A store to a ref/ptr deref is forbidden."
This new definition is much easier to understand, the price is some expressitivity. The following code used to be
accepted:
```nim
{.experimental: "strictFuncs".}
type Node = ref object
s: string
func create(s: string): Node =
result = Node()
result.s = s # store to result[]
```
Now it has to be rewritten to:
```nim
{.experimental: "strictFuncs".}
type Node = ref object
s: string
func create(s: string): Node =
result = Node(s: s)
```
### Standard library
Several standard library modules have been moved to nimble packages, use `nimble` or `atlas` to install them:
- `std/punycode` => `punycode`
- `std/asyncftpclient` => `asyncftpclient`
- `std/smtp` => `smtp`
- `std/db_common` => `db_connector/db_common`
- `std/db_sqlite` => `db_connector/db_sqlite`
- `std/db_mysql` => `db_connector/db_mysql`
- `std/db_postgres` => `db_connector/db_postgres`
- `std/db_odbc` => `db_connector/db_odbc`
- `std/md5` => `checksums/md5`
- `std/sha1` => `checksums/sha1`
- `std/sums` => `sums`