Facebook Platform Testing More Standard JavaScript Spec for Developers

Facebook is testing a major update to its FBJS JavaScript spec called FBJS2 that should make FBJS both easier to learn and maintain. Essentially, FBJS2 uses more standard JavaScript syntax than the original version.

As Facebook’s Marcel Georges Laverdet writes,

Today we are announcing a preview of a major update to FBJS. We’re calling this FBJS2. We’ve completely rewritten FBJS from the ground-up to make it much more natural for Javascript developers – now you will be able to use more standard Javascript syntax and no longer be required to use proprietary function-based getters and setters. With FBJS2, old FBJS-specific code such as this.setStyle('display', 'block') can now be written with portable JavaScript as this.style.display = 'block', for example.

We expect all of your original FBJS code to continue to work with the new FBJS2 libraries. We’ve created a new layer that implements all the original interfaces of FBJS under the context of FBJS2. If you are currently using FBJS, you should not need to make any changes to your applications to support this release. However, we still encourage you to port your applications to FBJS2 once it goes live to simplify your development using more standard Javascript syntax and for future benefits.

Laverdet says Facebook is planning on releasing FBJS to the live site within 4-6 weeks pending developer feedback. The original FBJS should still be fully supported, but as Laverdet says, Facebook will be encouraging developers to use FBJS2 once it goes live. To view your apps in the FBJS2 sandbox, click here.