PlayBuild - A compiler and Package Manager for PlayCanvas

PlayBuild

:warning: Deprecation notice

This package is now deprecated and will no longer be supported. Much of the functionality it provides is now being implemented natively in the editor

An in-editor compiler, bundler and package manager for the PlayCanvas editor that adds support for ES Modules, JSX plus all the usual features of modern web tooling .

Install
Getting Started
Docs

What this means?

With PlayBuild installed you can import and use modules in your code…

import config from './config'
import { utils } from '../utils/math'
import React from 'react'

External libraries

It also adds a dedicated package manager so you can install any 3rd party library from npm from the code editor…

What else?

PlayBuild is built around a compiler/bundler which concatenates and optionally minifies your projects code. This can result in faster start up times due to smaller files and less network overhead. It’ll also remove any dead code you don’t use to keep your builds as light as possible

Configurable

You can also configure the bundler depending on your needs. It features a many of the options found in WebPack and Esbuild such as minification and tree-shaking.

What about TypeScript?

Although you can use TypeScript in your PlayBuild projects and it will compile correctly, the code editor used in PlayCanvas is not (yet) configured to handle typescript files. See the docs for more information.

18 Likes

The extension has now been approved on the Chrome Webstore and we’ll be sending out emails to our beta testers shortly

6 Likes

This is great stuff. Will it be officially supported in the future?

New releases

v0.0.3

PCPM has now been rebranded as PlayBuild, which is a little easier to use. Most references have been updated, but there still exist a few legacy instances that refer to older pcpm package.

  • UI updates

    The UI for installed external packages has been updated. You can now set the package version via the UI now rather than having to manually edit the package.json

  • Removed PCUI + Observer from the build

    PlayBuild now uses the in-editor version of PCUI. The dependancy on pcui has now been removed from the build as it’s already provided by the editor. This may have caused hard to debug issues with having two version of the library especially if versions became out of sync.

  • Compiler options

    You can now specific compiler options using a playbuild field in the package.json. This allows you to control the behaviour of the compiler by enabling minification or other features. These are a subset of the options available in esbuild

    {
    	dependencies: {},
    	playbuild: {
    		define: { DEBUG : 'true' }
    		drop : ['console', 'debugger']
    		keepNames: true,
    		mangleProps: true,
    		minify: true,
    		treeShaking: true
    	}
    }
    

v0.0.2

  • UI Improvements

    Overhaul of the UI to provide better feedback when the compiler is running for the project and when it’s not. This also includes a CTA in the ui to enable the compiler by creating a package.json file.

  • Upgraded the esbuild wasm compiler

  • Improved stability for file watching

    There were a number of issues watching the package.json in the root of the registry which led to situations where the compiler was not correctly initialised when it should have been or vice-versa. This has now been improved and should be more stable across projects with multiple users working concurrently.

  • Compiler/Bundler now works with typescript and jsx

    Typecript and JSX has now been enabled by default in the compiler, so it will correctly bundle these files. However there the PC Monaco editor is not linting some of these files correctly which defeats much of the need for typescript. If/when the editor can be updated though, this should automatically translate without any code changes needed to pcpm

4 Likes

Quick update, this package is now deprecated as much of the functionality is now being implemented natively in the PlayCanvas Editor

7 Likes

Hey @Mark_Lundin. What exactly do you mean by implemented natively? Can I use modules or typescript directly in the editor? I can’t find any information about it in release notes.

Not yet, but this is getting close to the initial release.

2 Likes

@mvaligursky Thank you for information. Sounds great :rocket:! Is there any way to test it?

Not yet, but stay tuned, we’ll need some people to beta test it. @Mark_Lundin (he’s on holidays at the moment)

1 Like

Yep that’s right @lukaszo0711, as @mvaligursky mentioned we are inching towards a public release, documentation and testing is top priority at the moment. We’ll make a public announcement soon :muscle:

2 Likes

Great news. Thank you for update @Mark_Lundin. I can’t wait to try out the new features.

Can’t wait to try it out guys, this is going to be the biggest leap for the scripting since v1 → v2 overhaul! :smiley:

1 Like

watch this space :fire: