forked from lightscript/lightscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
As a start to ushering in a cleaner language for static analysis/merging with TypeScript, my objective is to clean up areas where there is implicit or hidden pollution of globals. This involves the following steps:
Deprecate Lightscript stdlib/Lodash implicit imports
- Non-breaking stdlib deprecation path
{ stdlib: false }is now a default option- Those wanting old behavior can set
{ stdlib: true }in compiler config
Deprecate implicit global operators
looseEq,looseNotEq,bitwise*implicit globals will be removed- Those desiring old behavior can set
{ implicitGlobalOperators: true }in compiler opts - Option removed altogether in 5.x
- Instead,
import { looseEq, ... } from '@lightscript/lang'at top level - Compiler will detect this and treat it as a virtual import, replacing with compiled code
- A nonce module will be published to npm as
@lightscript/langto aid with static analysis
Deprecate implicit lightscript runtime imports
@lightscript/runtimewill no longer be implicitly imported- Those desiring old behavior can set
{ implicitRuntime: true }in compiler opts - Option removed altogether in 5.x
- When the compiler encounters a construct requiring the runtime, it will check for
import runtime from '@lightscript/runtime'at top level - If the runtime is not imported, an error is thrown
- A lint rule will be added to check for constructs that require the runtime