chore(build): use inline sources in sourcemaps; don't package sources separately#6362
Merged
rachel-fenichel merged 2 commits intoAug 22, 2022
Merged
Conversation
Since the sources are now inline in the sourcemaps, they no longer need to be package separately.
maribethb
approved these changes
Aug 19, 2022
Contributor
maribethb
left a comment
There was a problem hiding this comment.
LGTM assuming we have sam's blessing. were you able to test the resulting sourcemaps work as expected in a plugin?
Collaborator
Author
I will assign to Rachel to submit when we have a reply (or she decides we don't need one).
That is one configuration I did not test, but I did test loading in compiled mode which uses the same |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basics
npm run formatandnpm run lintThe details
Resolves
tsccompile failures for developers whose build pipeline is misconfigured in a way that causes it to ingest.tssource files fromnode_modules/blockly/core/—somehow without also ingestingcore/any_aliases.ts—resulting in compile errors due toAnyDuringMigration. (See e.g. item #2 of #6358.)Proposed Changes
Don't package the source
.tsfiles; instead, include sources inline in the.js.mapsourcemaps.Behaviour Before Change
.tsfiles are copied fromcore/,blocks/andgenerators/todist/.Sourcemap (
.js.map) files contain a two-bytesourceRootproperty.Behaviour After Change
.tsfiles are not packaged.Sourcemap files contain a large
sourcesContentproperty (~2MB for `blockly_compressed.js.map), containing all of the original source.Reason for Changes
@btw17 points out that it is [generally not advised to package
.tssources along with compiled code in NPM packages]https://stackoverflow.com/a/57534667/4969945), and empirically it does appear to be causing problem for some of our developers.Test Coverage
Manually verified that sourcemaps with inline sources work correctly in compiled and uncompiled mode.
Additional Information
I sent email to @samelhusseini to get clarity about why sources were originally included in the Blockly NPM package. I think it worth waiting for a response before merging this PR.