Skip to content

Commit

Permalink
allow to disbale aexpr in workspaces again and fix stack tests
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-client-lively.js,AUTO-COMMIT-src-client-preferences.js,AUTO-COMMIT-src-plugin-babel.js,AUTO-COMMIT-test-stack-test.js,
  • Loading branch information
JensLincke committed Feb 7, 2024
1 parent 9a3ee76 commit 6efe490
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
4 changes: 4 additions & 0 deletions src/client/lively.js
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,10 @@ export default class Lively {
static async onBodyPositionPreference(pos) {
lively.setPosition(document.body, pos);
}

static async onDisableAExpWorkspacePreference(workspaceDisabled) {
localStorage.setItem("DisableAExpWorkspace", workspaceDisabled)
}

static async onEnableAEDebuggingPreference(debuggingEnabled) {
if (self.lively4isLoading) return // no recompile needed
Expand Down
2 changes: 1 addition & 1 deletion src/client/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class Preferences {
InteractiveLayer: {default: false, short: "dev methods"},
ShowDocumentGrid: {default: true, short: "show grid"},
UseRP19JSX: {default: false, short: "use rp19 implementation for jsx"},
/* DisableAExpWorkspace: {default: false, short: "disable AExp in workspace"}, */
DisableAExpWorkspace: {default: false, short: "disable AExp in workspace"},
UseProxiesForAExprs: {default: false, short: "proxy-based Active Expressions"},
EnableAEDebugging: {default: true, short: "enable Active Expression debugging"},
SmartAELogging: {default: true, short: "Only log events for interesting Active Expressions"},
Expand Down
36 changes: 19 additions & 17 deletions src/plugin-babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,24 +486,26 @@ async function workspacePlugins(options = {}) {


result.push(...await doitPlugins())
result.push(...[
await importDefaultOf('babel-plugin-var-recorder'),
[await importDefaultOf('babel-plugin-ILA'), {
executedIn: 'file'
}],
[await importDefaultOf('babel-plugin-databindings'), {
executedIn: 'file'
}],
[await importDefaultOf('babel-plugin-active-expression-rewriting'), {
executedIn: 'workspace'
}],
[await importDefaultOf('babel-plugin-databindings-post-process'), {
executedIn: 'file'
}],
[await importDefaultOf('babel-plugin-active-expression-proxies'), {

result.push(await importDefaultOf('babel-plugin-var-recorder'))

if (!localStorage.getItem("DisableAExpWorkspace")) {
result.push(await importDefaultOf('babel-plugin-ILA'), {
executedIn: 'file'
})
result.push(await importDefaultOf('babel-plugin-databindings'), {
executedIn: 'file'
})
result.push(await importDefaultOf('babel-plugin-active-expression-rewriting'), {
executedIn: 'workspace'
})
result.push(await importDefaultOf('babel-plugin-databindings-post-process'), {
executedIn: 'file'
})
result.push(await importDefaultOf('babel-plugin-active-expression-proxies'), {
executedIn: 'workspace'
}]
])
})
}
if (!options.fortesting) {
result.push(babel7.babelPluginProposalDynamicImport)
result.push([babel7.babelPluginTransformModulesSystemJS, {
Expand Down
4 changes: 2 additions & 2 deletions test/stack-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ stack;
};
const stack = o.myGetter;

expect(stack.getFrame(0).func).to.equal('get myGetter [as myGetter]');
expect(stack.getFrame(0).func).to.equal('get myGetter');
});

it('static getter', () => {
Expand All @@ -183,7 +183,7 @@ stack;
}
const stack = AClass.myStaticGetter;

expect(stack.getFrame(0).func).to.equal('get myStaticGetter [as myStaticGetter]');
expect(stack.getFrame(0).func).to.equal('get myStaticGetter');
});

it('new as property name', () => {
Expand Down

0 comments on commit 6efe490

Please sign in to comment.