Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labkey/api",
"version": "1.52.0",
"version": "1.52.1",
"description": "JavaScript client API for LabKey Server",
"scripts": {
"build": "npm run build:dist && npm run build:docs",
Expand Down
13 changes: 5 additions & 8 deletions src/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,27 @@ declare let LABKEY: any;
LABKEY.ActionURL = API.ActionURL;
LABKEY.Ajax = API.Ajax;
LABKEY.App = API.App;
LABKEY.Assay = API.Assay;
LABKEY.Domain = API.Domain;
LABKEY.Exp = API.Exp;
LABKEY.Experiment = API.Experiment;
LABKEY.FieldKey = API.FieldKey;
LABKEY.Filter = API.Filter;
LABKEY.List = API.List;
LABKEY.Message = API.Message;
LABKEY.MultiRequest = API.MultiRequest;
LABKEY.ParticipantGroup = API.ParticipantGroup;
LABKEY.Pipeline = API.Pipeline;
LABKEY.Query = API.Query;
LABKEY.QueryKey = API.QueryKey;
LABKEY.Report = API.Report;
LABKEY.SchemaKey = API.SchemaKey;
LABKEY.Security = API.Security;
LABKEY.Specimen = API.Specimen;
LABKEY.Storage = API.Storage;
LABKEY.Utils = API.Utils;
LABKEY.Visualization = API.Visualization;

// The following namespaces are extended at runtime by legacy DOM overrides.
// Since we are now targeting ES2023+, we need to create writable plain objects so the overrides can mutate.
LABKEY.Assay = Object.assign({}, API.Assay);
LABKEY.Experiment = Object.assign({}, API.Experiment);
LABKEY.Query = Object.assign({}, API.Query);
LABKEY.Security = Object.assign({}, API.Security);
LABKEY.Utils = Object.assign({}, API.Utils);

LABKEY.__package__ = __package__;

// The app registry needs to be initialized after the namespace has been established.
Expand Down
12 changes: 11 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@ const apiGlobalConfig = {
loader: 'ts-loader',
options: {
onlyCompileBundledFiles: true,
// Emit CommonJS ("nodenext", since package.json intentionally has no "type":"module") so LABKEY
// namespaces stay shared, writable exports that legacy runtime overrides can patch.
compilerOptions: {
module: 'nodenext',
moduleResolution: 'nodenext',
},
},
},
],
},

optimization: {
// Disable scope hoisting so cross-module references resolve through the shared, patchable exports objects.
concatenateModules: false,
},

output: {
filename: 'labkey-api-js-[name].min.js',
},
Expand Down Expand Up @@ -57,7 +68,6 @@ const umdPackageConfig = {
outDir: path.resolve(__dirname, 'dist'),
declaration: true,
removeComments: true,
target: 'ES6',
},
onlyCompileBundledFiles: true,
},
Expand Down