trunk | Build , bundle & ship your Rust WASM application to the web

 by   thedodd Rust Version: v0.16.0 License: Apache-2.0

kandi X-RAY | trunk Summary

kandi X-RAY | trunk Summary

trunk is a Rust library typically used in Binary Executable Format, React, Webpack applications. trunk has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Build, bundle & ship your Rust WASM application to the web. Trunk is a WASM web application bundler for Rust. Trunk uses a simple, optional-config pattern for building & bundling WASM, JS snippets & other assets (images, css, scss) via a source HTML file. Dev server - Trunk ships with a built-in server for rapid development workflows, as well as support for HTTP & WebSocket proxies. Change detection - Trunk watches your application for changes and triggers builds for you. Browser reloading, HMR, and other related features are in-progress.

            kandi-support Support

              trunk has a medium active ecosystem.
              It has 2606 star(s) with 188 fork(s). There are 24 watchers for this library.
              It had no major release in the last 12 months.
              There are 162 open issues and 178 have been closed. On average issues are closed in 74 days. There are 36 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of trunk is v0.16.0

            kandi-Quality Quality

              trunk has 0 bugs and 0 code smells.

            kandi-Security Security

              trunk has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              trunk code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              trunk is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              trunk releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              It has 550 lines of code, 0 functions and 21 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of trunk
            Get all kandi verified functions for this library.

            trunk Key Features

            No Key Features are available at this moment for trunk.

            trunk Examples and Code Snippets

            No Code Snippets are available at this moment for trunk.

            Community Discussions


            Ternary operator applied to different lambdas produces inconsistent results
            Asked 2022-Apr-11 at 17:37

            Consider the following which uses the ternary operator to get the common function pointer type of the two lambdas



            Answered 2022-Apr-11 at 10:40

            Both, say the same thing, you can't use ternary operator on different types. Lambda functions must have identical format



            C++20 Concepts: Explicit instantiation of partially ordered constraints for member functions
            Asked 2022-Mar-29 at 18:45

            This works and outputs "1", because the function's constraints are partially ordered and the most constrained overload wins:



            Answered 2022-Mar-29 at 18:45

            C++20 recognizes that there can be different spellings of the same effective requirements. So the standard defines two concepts: "equivalent" and "functionally equivalent".

            True "equivalence" is based on satisfying the ODR (one-definition rule):

            Two expressions involving template parameters are considered equivalent if two function definitions containing the expressions would satisfy the one-definition rule, except that the tokens used to name the template parameters may differ as long as a token used to name a template parameter in one expression is replaced by another token that names the same template parameter in the other expression.

            There's more to it, but that's not an issue here.

            Equivalence for template heads includes that all constraint expressions are equivalent (template headers include constraints).

            Functional equivalence is (usually) about the results of expressions being equal. For template heads, two template heads that are not ODR equivalent can be functionally equivalent:

            Two template-heads are functionally equivalent if they accept and are satisfied by ([temp.constr.constr]) the same set of template argument lists.

            That's based in part on the validity of the constraint expressions.

            Your two template heads in versions 1 and 3 are not ODR equivalent, but they are functionally equivalent, as they both accept the same template parameters. And the behavior of that code will be different from its behavior if they were ODR equivalent. Therefore, this passage kicks in:

            If the validity or meaning of the program depends on whether two constructs are equivalent, and they are functionally equivalent but not equivalent, the program is ill-formed, no diagnostic required.

            As such, all of the compilers are equally right because your code is wrong. Obviously a compiler shouldn't straight-up crash (and that should be submitted as a bug), but "ill-formed, no diagnostic required" often carries with it unforeseen consequences.



            Why would fetching specific git commits use more disk space than fetching all?
            Asked 2022-Mar-25 at 19:12

            If I run git fetch origin and then git checkout on a series of consecutive commits, I get a relatively small repo directory.

            But if I run git fetch origin and then git checkout FETCH_HEAD on the same series of commits, the directory is relatively bloated. Specifically, there seem to be a bunch of large packfiles.

            The behavior appears the same whether the commits are all in place at the time of the first fetch or if they are committed immediately before each fetch.

            The following examples use a public repo, so you can reproduce the behavior.

            Why is the directory size of example 2 so much larger?

            Example 1 (small):



            Answered 2022-Mar-25 at 19:08

            Because each fetch produces its own packfile and one packfile is more efficient than multiple packfiles. A lot more efficient. How?

            First, the checkouts are a red herring. They don't affect the size of the .git/ directory.

            Second, in the first example only the first git fetch origin does anything. The rest will fetch nothing (unless something changed on origin).

            Why are multiple packfiles less efficient?

            Compression works by finding common long sequences within the data and reducing them to very short sequences. If

            long block of legal mumbo jumbo appears dozens of times it could be replaced with a few bytes. But the original long string must still be stored. If there's a single packfile it must only be stored once. If there's multiple packfiles it must be stored multiple times. You are, effectively, storing the whole history of changes up to that point in each packfile.

            We can see in the example below that the first packfile is 113M, the second is 161M, the third is 177M, and the final fetch is 209M. The size of the final packfile is roughly equal to the size of the single garbage compacted packfile.

            Why do multiple fetches result in multiple packfiles?

            git fetch is very efficient. It will only fetch objects you not already have. Sending individual object files is inefficient. A smart Git server will send them as a single packfile.

            When you do a single git fetch on a fresh repository, Git asks the server for every object. The remote sends it a packfile of every object.

            When you do git fetch ABC and then git fetch DEFs, Git tells the server "I already have everything up to ABC, give me all the objects up to DEF", so the server makes a new packfile of everything from ABC to DEF and sends it.

            Eventually your repository will do an automatic garbage collection and repack these into a single packfile.

            We can reduce the examples. I'm going to use Rails to illustrate because it has clearly defined tags to fetch.



            Unqualified lookup of operators in standard library templates
            Asked 2022-Mar-05 at 16:30
            namespace N {
                struct A {};
                constexpr bool operator<(const T&, const T&) { return true; }
            constexpr bool operator<(const N::A&, const N::A&) { return false; }
            int main() {
                static_assert(std::less{}({}, {}), "assertion failed");


            Answered 2022-Mar-05 at 16:30

            What matters here is whether the unqualified lookup from inside std finds any other operator< (regardless of its signature!) before reaching the global namespace. That depends on what headers have been included (any standard library header may include any other), and it also depends on the language version since C++20 replaced many such operators with operator<=>. Also, occasionally such things are respecified as hidden friends that are not found by unqualified lookup. It’s obviously unwise to rely on it in any case.



            -Wconversion diagnostic from gcc-trunk when -fsanitize=undefined is passed
            Asked 2022-Feb-21 at 19:34

            This is about the correct diagnostics when short ints get promoted during "usual arithmetic conversions". During operation / a diagnostic could be reasonably emitted, but during /= none should be emitted.

            Behaviour for gcc-trunk and clang-trunk seems OK (neither emits diagnostic for first or second case below)... until...

            we add the entirely unrelated -fsanitize=undefined ... after which, completely bizarrely:

            gcc-trunk emits a diagnostic for both cases. It really shouldn't for the 2nd case, at least.

            Is this a bug in gcc?

            Godbolt link

            Godbolt link with -O3 - same result



            Answered 2022-Feb-19 at 16:30

            For a built-in compound assignment operator $= the expression A $= B behaves identical to an expression A = A $ B, except that A is evaluated only once. All promotions and other usual arithmetic conversions and converting back to the original type still happen.

            Therefore it shouldn't be expected that the warnings differ between short avg1 = sum / count; and tmp /= count;.

            A conversion from int to short happens in each case. So a conversion warning would be appropriate in either case.

            However, the documentation of GCC warning flags says specifically that conversions back from arithmetic on small types which are promoted is excluded from the -Wconversion flag. GCC offers the -Warith-conversion flag to include such cases nonetheless. With it all arithmetic in your examples generates a warning.

            Also note that this exception to -Wconversion has been introduced only with GCC 10. For some more context on it, the bug report from which it was introduced is here.

            It seems that Clang has always been more lenient on these cases than GCC. See for example this issue and this issue.

            For / in GCC -fsanitize=undefined seems to break the exception that -Wconversion is supposed to have. It seems to me that this is related to the undefined behavior sanitizer adding a null-value check specifically for division. Maybe, after this transformation, the warning flag logic doesn't recognize it as direct arithmetic on the smaller type anymore.

            If my understanding of the intended behavior of the warning flags is correct, I would say that this looks unintended and thus is a bug.



            Flutter error: "CocoaPods not installed or not in valid state."
            Asked 2022-Feb-09 at 23:36

            Could the problem be that Android Studio can't find the path to CocoaPods?

            I'm trying to test my app on my iPhone from Android Studio. The error I get is



            Answered 2022-Jan-31 at 17:27

            A response on IssueTracker says

            This problem is present with Android Studio Bumblebee on Mac. Launching flutter from the IDE causes this issue where it can't find the Cocoapods path.

            Forced to run flutter from terminal for it to work.

            Here's how run your project from the CLI on the iOS simulator. cd into your project directory and run:



            GCC: why cannot compile clean printf("%f\n", f16) under -std=c11 -Wall?
            Asked 2022-Feb-03 at 22:16

            Sample code:



            Answered 2022-Jan-11 at 20:28

            From the clang manual:

            Because default argument promotion only applies to the standard floating-point types, _Float16 values are not promoted to double when passed as variadic or untyped arguments. As a consequence, some caution must be taken when using certain library facilities with _Float16; for example, there is no printf format specifier for _Float16, and (unlike float) it will not be implicitly promoted to double when passed to printf, so the programmer must explicitly cast it to double before using it with an %f or similar specifier.



            Why can't we use compile-time 'variables' in consteval functions as template parameters?
            Asked 2022-Jan-29 at 14:32

            I was testing this code (



            Answered 2022-Jan-29 at 13:14

            It doesn't matter that i is guaranteed to be evaluated only at compile-time when its value is known in an abstract sense.

            It also doesn't matter whether the function is consteval or constexpr or none of these.

            The language is still statically typed and nth_type_t; must in any given instantiation of the function refer to exactly one type. If i can change in the for loop, that is not possible to guarantee.

            The language requires that the expression i when used as template argument is by itself a constant expression, independently of whether the whole function body can only be evaluated as part of a larger constant expression. But i is neither declared constexpr, nor declared const with constant initializer.



            Why is SFINAE for one of the std::basic_string constructors so restrictive?
            Asked 2022-Jan-28 at 12:53

            Discussion about this was started under this answer for quite simple question.


            This simple code has unexpected overload resolution of constructor for std::basic_string:



            Answered 2022-Jan-05 at 12:05

            Maybe I'm wrong, but it seems that last part:



            set git configuration in gitlab CI for default branch to prevent hint message
            Asked 2022-Jan-18 at 11:03

            In my gitlab CI I always get this hint messages. Yes, I see I have to set git config --global init.defaultBranch main, but everything I'm adding in my stages / jobs of the CI gitlab config is executed after fetching.



            Answered 2022-Jan-13 at 16:37

            As far as i experienced, the only way to disable this message is to set the config globally in the .gitconfig of the user running the gitlab-runner.

            This can either be done on the underlying VM if you use the shell-runner or inside the used docker-image when using the docker-runner


            Altough it says global, the git-setting is user based. You'll have to set it as the same user that executes the gitlab-runner. Depending on the configuration, this might be gitlab-runner or a custom user on shell-runners or root when using the docker-executor.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install trunk

            Head on over to the Trunk website, everything you need is there. A few quick links:.
            App Setup
            CLI Commands


            Anyone and everyone is welcome to contribute! Please review the document for more details. The best way to get started is to find an open issue, and then start hacking on implementing it. Letting other folks know that you are working on it, and sharing progress is a great approach. Open pull requests early and often, and please use Github's draft pull request feature.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries