This update improves the developer experience by standardizing tooling, fixing a critical import path bug for new projects, and initiating research into `anyref` API support.
> impact
This release focuses on enhancing the developer experience and unblocking new users. We've integrated standard development tools, including Prettier for consistent code formatting and a stricter ESLint configuration to catch potential issues early. This establishes a higher code quality standard and streamlines the contribution process. Additionally, we've initiated a formal investigation into creating a stable API for `anyref` imports, a crucial step towards seamless interoperability with JavaScript.
The most critical fix addresses a build error that new users encountered when following the wiki instructions. The AssemblyScript compiler couldn't resolve the library's import paths (`~lib/as2d/*`) outside of the example repository, effectively blocking adoption. This was caused by a missing path mapping in the `tsconfig.json` configuration. Without this fix, developers were unable to integrate `as2d` into their own projects, creating a significant barrier to entry.
With these changes, developers can now expect a smoother and more predictable development workflow. The standardized tooling ensures code consistency across the project, making it easier to read, maintain, and contribute to. Most importantly, the fix to the import path resolution error, along with updated wiki documentation, unblocks the community and makes it trivial for anyone to start a new project with `as2d`. The ongoing `anyref` research signals our commitment to improving WebAssembly and JavaScript integration in the future.
> Try this now
try this
// Previously, setting up a new project with as2d failed because the compiler couldn't find the library files.
// We've fixed this by updating the required project configuration.
// To get started with a new project, ensure your `tsconfig.json` includes the `paths` property.
// This tells the AssemblyScript compiler how to resolve the `~lib/as2d/*` imports.
/* File: tsconfig.json */
/*
{
"extends": "assemblyscript/std/assembly.json",
"include": ["assembly/**/*.ts"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
"~lib/as2d/*": ["node_modules/as2d/assembly/*"]
}
}
}
*/
// With the tsconfig correctly configured, you can now import and use as2d modules in your project without any build errors.
// File: assembly/index.ts
import { DisplayObject } from "~lib/as2d/as2d";
// This code will now compile successfully in any new project.
export class MyGameComponent extends DisplayObject {
constructor() {
super();
// Your game logic here
}
}
// Try it out! Follow the updated setup guide in the wiki to build your own project with as2d.