- Add WebContainers support. This allows Mango to run on WebContainers, a new technology that enables running Node.js applications in the browser.
- Remove console message on route change in dev mode.
- Don't send to the websocket before opening it in HMR runtime.
- Again, use await when calling import.meta.resolve. This is a temporary decision to support older versions of Node v18.x.
- Mango components are now automatically optimized. Unused code is removed by tracking which props are used and which are not.
- Build fails when there are pages with the same hash.
- Print error stack (if any) when server encounters an error.
- Assignment to constant variable in HMR runtime.
- HMR runtime file was unintentionally minified.
- Assignment to constant variable in HMR runtime.
- HMR server was not aware of functions assets dependents.
- Introducing HMR support for lazy components and dynamic content.
- Change target in esbuild config to node18. This affects functions and mango packages.
- Improve module resolution in functions.
- Remove await used when calling import.meta.resolve. It was there because import.meta.resolve is asynchronous in Node legacy versions.
- Wrong relative import paths in functions.
- Nondeterminism when using many functions returning different status codes. Now, status codes higher than 299 have higher priority and the first of them encountered is used as the status code of the response.
- Deadlocks and race conditions in dev mode.
- Debounce the file watcher in dev mode.
- Fix the licensee's name in the license. The correct licensee's name is GeeekyBoy.
- Remote functions were crashing in development mode.
- Fix a bug where URL objects can't be transferred directly to workers because they are no longer serializable since NodeJS v21.0. This is fixed by converting URL objects to strings before transferring them to workers and then converting them back to URL objects inside workers.
- Introducing customizable error pages.
- Use acorn to extract dynamics.
- Remove some redundant AST generations.
- Dev server crashed on editing translations.
- Web Components were not working.
postcss
was not added as a dependency to thepackage.json
file of@mango-js/parcel-packager-css
package.
- Parcel production configuration files were not published to NPM. This is fixed by adding them to the
files
field inpackage.json
file of@mango-js/scripts
package.
- Catch APIs and SSR functions errors and log them to the console. In the past, errors thrown by APIs and SSR functions were not being caught and were causing the server to crash.
- Allow defining components using any type of function. In the past, arrow functions weren't working when defining components that have props.
- Polish bundler console logs. All colored logs are now bold and error logs are logged through
console.error
instead ofconsole.log
.
- Keep variables declarations that are exported from a function.
- Resolve some race conditions in dev server.
- Some built pages not written to disk. Only some situations were causing this bug to appear.
- Building process was failing on Netlify.
- Published
dev-prelude.js
in@mango-js/packager-js
package was empty. - SVG viewBox attribute was stripped by SVGO.
- Introducing localization support. It's now possible to create multilingual websites with Mango without having to use any third-party library.
- Component props names minification. This allows the use of long names for component props without worrying about the size of the bundle.
- Defining a page is now more elegant. Instead of appending the page manually to the DOM, page's root component is exported as
default
. Mango will take care of the rest by appending the page to the element whose id isroot
or to the body if there is no element with that id. - Bound values support for file input field.
- Bound values support for select & textarea elements.
- Ability to import raw files in functions.
- Ability to pass nonreactive vars as bound props.
- Add typings for raw and JSON files imports.
- Improve transformation of JSX fragments. After this change, a JSX fragment is transformed to an array of elements.
- Ditch the use of all patches used to patch Parcel.
- Remove redundant Parcel plugins that are unsupported by Mango.
- Set type of mango's template to module.
- State not read when being used as a value in a JSON object.
- Async SSR functions were crashing in development mode.
- Functions can't use vars whose names are already exported.
- Checkbox value not bound correctly.
- States weren't usable as objects accessors.
- Dynamic texts couldn't be separated by a space.
- Async functions were not working as effects.
- Incorrect matching of pages to functions.
- Building fails when public directory is deep.
- Allow functions circular imports in development mode.
- Boilerplate
package-lock.json
file was not being built on publishing a new version to NPM. This is fixed by separating publishing@mango-js/create
package from publishing other packages.
- Mango app boilerplate is now distributed with a prebuilt
package-lock.json
file. This reduces the initialization time of a new project.
- Increase the accuracy of the generated source maps. They still need some work to be perfect.
import.meta.url
used in theURL
constructor was kept as it is in the production code. This resulted in an error thrown by the browser becauseimport.meta
is available inside modules only. This is fixed by replacing theURL
constructor with a path represented as a string literal.
firstChild
andnextSibling
properties are used together instead ofchildNodes
to get the children of an element while cleaning up removed elements. This change improves the performance of removing elements by 40% according tojs-framework-benchmark
.
- Add
ignore:
URL scheme which allows you to prevent bundler from processing the specified path. This is useful when you want to serve a file from a URL relative to that of the website but not a part of the source code.
-
Some paths to the website resources were not POSIX-compliant.
-
parcel
was not being patched when it is installed in anode_modules
directory that is not in the root directory of the repository. This is fixed by applying patches while the current working directory is set to the root directory of the repository.
- Published packages were empty as a result of some breaking changes introduced by Lerna v7.0.0.
- Variable
i
was reserved for elements mutators. This caused problems when usingi
as a variable name in a component.
@parcel/reporter-dev-server
sometimes can't be resolved. This is fixed by adding@parcel/reporter-dev-server
as a dependency to thepackage.json
file of@mango-js/scripts
package.
- Server-side code was exposed to public. This means that anyone could see the code of your SSR functions and API endpoints. This is fixed by moving the server-side code to a separate file that is not served to the client.
.parcelrc.compression
was missing from the published@mango-js/scripts
package.- Routes were prioritized over static files. This means that if a static file exists at the same path as a route, the route was being served instead of the static file. This only affected self-hosted applications.
-
Hot Module Replacement (HMR) for Mango components. This enables you to see the changes you make to your components without having to reload the page.
-
Introduce remote functions. They are JavaScript functions imported like any other function but they are executed on the server under the hood.
synckit
isn't used anymore for SSG stuff. The main reason for this change is that executing asynchronous functions as synchronous functions inside a Babel transformer is not a good idea and is thought to affect the performance of the compiler. Instead, Mango now usesworker_threads
to execute SSG functions in a separate thread created by the JSX parcel transformer.
- Some altered files were not being detected by Parcel's watcher. They are basically the dependencies added throughout the build process.
- Assigned or declared reactive variables were detected as dependencies.
- Setting a state had a synchronization problem. This happens because subscribers may be added or removed while the subscribers array is being iterated over. To fix this, the subscribers array is copied before iterating over it.
- Built-in Node modules were being detected as dependencies when they are imported in files executed on the server.
- Disable build time compression of static files. This is because the compression is already done by Netlify on the fly.
- Fix path from where service worker is loaded when the application is built for production.
- When an API endpoint has multiple methods, only one method was functional.
- Body of the API request was being parsed incorrectly when the application is deployed to Netlify.
- Static files were not being served if their paths are covered by a route in _redirects file. This only affects applications deployed to Netlify.
- Make reporters resolved from the running script directory instead of the project root directory in
@mango-js/scripts
package.
- Add
@parcel/compressor-raw
as a dependency to thepackage.json
file of@mango-js/scripts
package. This should fix the issue where Parcel complains about missing@parcel/compressor-raw
package when building an application.
- Only one dependency was being added to
package.json
file when building an application even if there were multiple dependencies.
- Prop fallback values were being passed to the dependency arrays.
- SSR function could not access environment variables defined in the
.env
file. - If the name of the HTML element is the same as the name of a prop, the whole element was being considered as an instance of a component.
- Element specific events were not being extracted from MDN data.
- Falsy values like
undefined
andnull
were being set as class names instead of being ignored by replacing them with an empty string. - Public files were being served by the dev server from the wrong directory.
- In SSR functions, when the import source has more than the dependency name, the whole path was being used as the dependency name.
- In SSR functions in dev mode, when the import source has non-alphanumeric characters, it was being skipped when substituting it with the absolute module path.
- Files in the
public
folder were not being served by the dev server. - Components properties were not being treated as reactive variables.
- Some input types did not support bound values.
- To see any updates you make to the SSG functions, it was necessary to restart the dev server.
- Use execFileSync to apply patches instead of execSync.
- Make production server default port configurable.
- External dependencies used by SSR functions and API endpoints are now added to the
package.json
file of the exported application. - Add @mango-js/types as a dev dependency to the
package.json
file of the template.
- Runtime is now served as a separate file instead of being bundled with every page and lazy component. It can be self-hosted or served from either jsDelivr or unpkg.
- Change the default port of the development server to
4000
.
- Prevent non-mango scripts from being processed by Mango compiler. All jsx/tsx/mdx files are processed by Mango compiler by default. To mark a js/ts file as a Mango script, add
// @mango
or/* @mango */
comment anywhere before the first line of code.
- Packages are minified before publishing to reduce the size of the package.
- Add a polyfill for
document.createComment
to make Mango work in IE5. - Fix a bug where some versions of IE ignore some CSS classes because their names start with an underscore.
- Remove
exports
field from allpackage.json
files becausemain
field is sufficient.
@parcel/reporter-dev-server
was crashing randomly on starting the dev server or building an application.- Hide error messages coming from
git patch
when applying Parcel patches. - Fix a potential race condition where the process of building may start before the process of patching is finished.
- Versions of sibling dependencies are now specified explicitly instead of using
*
.
- The
netlify.toml
file was being created in thedist
folder instead of the root folder.