Skip to content

Commit 01c4d69

Browse files
committed
Merge branch 'main' into benjin/multipleConnectionBug
2 parents 449da28 + 520ca4f commit 01c4d69

File tree

191 files changed

+48349
-52738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+48349
-52738
lines changed

.github/workflows/file-size-check.yml

-26
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,6 @@ jobs:
7777
echo "webview_bundle_percentage_change=$percentage_change" >> $GITHUB_ENV
7878
webview_text_color=$(if [ $percentage_change -gt 0 ]; then echo "red"; else echo "green"; fi)
7979
echo "webview_text_color=$webview_text_color" >> $GITHUB_ENV
80-
main_js_file=$(find ./main/out/src/reactviews/assets -name "*.js")
81-
pr_js_file=$(find ./pr/out/src/reactviews/assets -name "*.js")
82-
main_js_size=$(stat -c%s "$main_js_file")
83-
pr_js_size=$(stat -c%s "$pr_js_file")
84-
main_js_size=$((main_js_size / 1024))
85-
pr_js_size=$((pr_js_size / 1024))
86-
js_size_diff=$((pr_js_size - main_js_size))
87-
js_percentage_change=$((100 * js_size_diff / main_js_size))
88-
echo "Main branch JS bundle size: $main_js_size KB"
89-
echo "PR branch JS bundle size: $pr_js_size KB"
90-
echo "JS Size difference: $js_size_diff bytes"
91-
echo "JS Percentage change: $js_percentage_change%"
92-
echo "main_js_size=$main_js_size" >> $GITHUB_ENV
93-
echo "pr_js_size=$pr_js_size" >> $GITHUB_ENV
94-
echo "js_size_diff=$js_size_diff" >> $GITHUB_ENV
95-
echo "js_percentage_change=$js_percentage_change" >> $GITHUB_ENV
96-
js_text_color=$(if [ $js_percentage_change -gt 0 ]; then echo "red"; else echo "green"; fi)
97-
echo "js_text_color=$js_text_color" >> $GITHUB_ENV
9880
9981
- name: Calculate vsix file sizes
10082
run: |
@@ -127,10 +109,6 @@ jobs:
127109
echo "- **Main branch bundle size**: ${{ env.main_webview_bundle_size }} KB" >> results.md
128110
echo "- **PR branch bundle size**: ${{ env.pr_webview_bundle_size }} KB" >> results.md
129111
echo "- **Size difference**: ${{ '\$\${\color{' }}${{env.webview_text_color}}} ${{ env.webview_size_diff }} KB \space (${{ env.webview_bundle_percentage_change }}\\\\%) ${{ '}\$\$' }} " >> results.md
130-
echo "### React Webview JS Size Comparison" >> results.md
131-
echo "- **Main branch JS size**: ${{ env.main_js_size }} KB" >> results.md
132-
echo "- **PR branch JS size**: ${{ env.pr_js_size }} KB" >> results.md
133-
echo "- **Size difference**: ${{ '\$\${\color{' }}${{env.js_text_color}}} ${{ env.js_size_diff }} KB \space (${{ env.js_percentage_change }}\\\\%) ${{ '}\$\$' }} " >> results.md
134112
135113
- name: Find comment
136114
uses: peter-evans/find-comment@v3
@@ -166,10 +144,6 @@ jobs:
166144
if: ${{ env.webview_bundle_percentage_change > 5 }}
167145
run: exit 1
168146

169-
- name: Fail if JS bundle size is increased by 5%
170-
if: ${{ env.js_percentage_change > 5 }}
171-
run: exit 1
172-
173147

174148

175149

.vscodeignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ coverage
55
coverage-remapped
66
lib
77
localization
8+
! localization/l10n
89
out/test
910
packages
1011
samples

gulpfile.js

+19-42
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const config = require('./tasks/config');
88
const concat = require('gulp-concat');
99
const minifier = require('gulp-uglify/minifier');
1010
const uglifyjs = require('uglify-js');
11-
const nls = require('vscode-nls-dev');
1211
const argv = require('yargs').argv;
1312
const min = (argv.min === undefined) ? false : true;
1413
const prod = (argv.prod === undefined) ? false : true;
@@ -162,23 +161,7 @@ async function generateExtensionBundle() {
162161
await ctx.dispose();
163162
}
164163

165-
function transformExtensionLocalization(patterns) {
166-
return gulp.src(patterns)
167-
.pipe(nls.rewriteLocalizeCalls())
168-
.pipe(nls.createAdditionalLanguageFiles(nls.coreLanguages, config.paths.project.root + '/localization/i18n', undefined, false))
169-
.pipe(srcmap.write('.', { includeContent: false, sourceRoot: '../src' }))
170-
.pipe(gulp.dest('out/src/'));
171-
}
172-
173-
gulp.task('ext:bundle-src', gulp.series(generateExtensionBundle, () => transformExtensionLocalization(
174-
[
175-
'out/src/extension.js',
176-
'out/src/languageService/serviceInstallerUtil.js',
177-
'out/src/telemetry/telemetryInterfaces.js',
178-
'out/src/protocol.js',
179-
'out/src/models/interfaces.js'
180-
]
181-
)));
164+
gulp.task('ext:bundle-src', gulp.series(generateExtensionBundle));
182165

183166
gulp.task('ext:compile-src', (done) => {
184167
return gulp.src([
@@ -194,21 +177,17 @@ gulp.task('ext:compile-src', (done) => {
194177
process.exit(1);
195178
}
196179
})
197-
.pipe(nls.rewriteLocalizeCalls())
198-
.pipe(nls.createAdditionalLanguageFiles(nls.coreLanguages, config.paths.project.root + '/localization/i18n', undefined, false))
199180
.pipe(srcmap.write('.', { includeContent: false, sourceRoot: '../src' }))
200181
.pipe(gulp.dest('out/src/'));
201182
});
202183

203184
// Compile angular view
204185
gulp.task('ext:compile-view', (done) => {
205-
return gulp.src([
186+
return gulp.src([
206187
config.paths.project.root + '/src/views/htmlcontent/**/*.ts',
207188
config.paths.project.root + '/typings/**/*.d.ts'])
208189
.pipe(srcmap.init())
209190
.pipe(tsProject())
210-
.pipe(nls.rewriteLocalizeCalls())
211-
.pipe(nls.createAdditionalLanguageFiles(nls.coreLanguages, config.paths.project.root + '/localization/i18n', undefined, false))
212191
.pipe(srcmap.write('.', { includeContent: false, sourceRoot: '../src' }))
213192
.pipe(gulp.dest('out/src/views/htmlcontent'));
214193
});
@@ -220,7 +199,10 @@ async function generateReactWebviewsBundle() {
220199
* for each entry point, to be used by the webview's HTML content.
221200
*/
222201
entryPoints: {
223-
mssqlwebview: 'src/reactviews/index.tsx'
202+
'connectionDialog': 'src/reactviews/pages/ConnectionDialog/index.tsx',
203+
'executionPlan': 'src/reactviews/pages/ExecutionPlan/index.tsx',
204+
'tableDesigner': 'src/reactviews/pages/TableDesigner/index.tsx',
205+
'objectExplorerFilter': 'src/reactviews/pages/ObjectExplorerFilter/index.tsx',
224206
},
225207
bundle: true,
226208
outdir: 'out/src/reactviews/assets',
@@ -240,35 +222,32 @@ async function generateReactWebviewsBundle() {
240222
typecheckPlugin()
241223
],
242224
sourcemap: prod ? false : 'inline',
243-
metafile: !prod,
225+
metafile: true,
244226
minify: prod,
245227
minifyWhitespace: prod,
246228
minifyIdentifiers: prod,
229+
format: 'esm',
230+
splitting: true,
247231
});
248232

249233
const result = await ctx.rebuild();
250234

251-
if (!prod) {
252-
/**
253-
* Generating esbuild metafile for webviews. You can analyze the metafile https://esbuild.github.io/analyze/
254-
* to see the bundle size and other details.
255-
*/
256-
const fs = require('fs').promises;
257-
if (result.metafile) {
258-
await fs.writeFile('./webviews-metafile.json', JSON.stringify(result.metafile));
259-
}
235+
/**
236+
* Generating esbuild metafile for webviews. You can analyze the metafile https://esbuild.github.io/analyze/
237+
* to see the bundle size and other details.
238+
*/
239+
const fs = require('fs').promises;
240+
if (result.metafile) {
241+
await fs.writeFile('./webviews-metafile.json', JSON.stringify(result.metafile));
260242
}
261243

244+
262245
await ctx.dispose();
263246
}
264247

265248
// Compile react views
266249
gulp.task('ext:compile-reactviews',
267-
gulp.series(generateReactWebviewsBundle, function transformReactWebviewsLocalization() {
268-
return transformExtensionLocalization([
269-
'out/react-webviews/assets/*.js',
270-
])
271-
})
250+
gulp.series(generateReactWebviewsBundle)
272251
);
273252

274253

@@ -419,9 +398,7 @@ gulp.task('ext:copy-js', () => {
419398
// Copy the files which aren't used in compilation
420399
gulp.task('ext:copy', gulp.series('ext:copy-tests', 'ext:copy-js', 'ext:copy-config', 'ext:copy-systemjs-config', 'ext:copy-dependencies', 'ext:copy-html', 'ext:copy-css', 'ext:copy-images'));
421400

422-
gulp.task('ext:localization', gulp.series('ext:localization:generate-eng-package.nls', 'ext:localization:xliff-to-ts', 'ext:localization:xliff-to-json', 'ext:localization:xliff-to-package.nls'));
423-
424-
gulp.task('ext:build', gulp.series('ext:localization', 'ext:copy', 'ext:clean-library-ts-files', 'ext:compile', 'ext:compile-view', 'ext:compile-reactviews')); // removed lint before copy
401+
gulp.task('ext:build', gulp.series('ext:generate-runtime-localization-files', 'ext:copy', 'ext:clean-library-ts-files', 'ext:compile', 'ext:compile-view', 'ext:compile-reactviews')); // removed lint before copy
425402

426403
gulp.task('ext:test', async () => {
427404
let workspace = process.env['WORKSPACE'];

0 commit comments

Comments
 (0)