Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including the JavaScript source map in the prototype kit config #3255

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

nataliecarey
Copy link
Contributor

A fix for #3254

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3255 February 6, 2023 10:54 Inactive
@@ -1,6 +1,7 @@
{
"assets": [
"/govuk/assets"
"/govuk/assets",
"/govuk/all.js.map"
Copy link
Contributor

@colinrotherham colinrotherham Feb 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nataliecarey

Would you mind updating the *.mjs file instead of the *.js
./src/govuk-prototype-kit/govuk-prototype-kit.config.mjs#L30

We've generated it since this PR

@36degrees Will we want to add tests for "expected source maps" like we do in this one?
./tasks/gulp/tests/after-build-package.test.mjs

For example we also have:

/govuk/common.js.map
/govuk/i18n.js.map

We can either choose to exclude these, or otherwise ensure we include them?

I'm not too familiar with the Prototype Kit but lots of other tooling has "load maps" options where source maps from other files can be included to supplement stack traces etc

Gulp source maps (example)
https://github.com/gulp-sourcemaps/gulp-sourcemaps#load-existing-source-maps

gulp.src('src/**/*.js')
  .pipe(sourcemaps.init({ loadMaps: true }))

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3255 February 7, 2023 09:42 Inactive
Copy link
Contributor

@colinrotherham colinrotherham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant, thanks @nataliecarey

Before we approve would you mind dropping the ./package/** changes? My fault for not explaining, we'll hold off any dist or package builds for a release commit:

(Here's the one from v4.5.0 5bc602a)

@colinrotherham colinrotherham linked an issue Feb 7, 2023 that may be closed by this pull request
1 task
@nataliecarey nataliecarey force-pushed the source-maps-in-prototype-kit branch from 6965bf1 to 5d66add Compare February 10, 2023 12:23
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3255 February 10, 2023 12:23 Inactive
@nataliecarey
Copy link
Contributor Author

Thanks Colin, re-reading your comment it was clear but I missed it. I've reverted the package changes and force pushed to keep the package history in tact.

@colinrotherham
Copy link
Contributor

Thanks @nataliecarey

I'm thinking those paths need to be /govuk-prototype-kit /govuk and not forgetting all.js.map?

'/govuk/assets',
'/govuk/all.js.map',
'/govuk/common.js.map',
'/govuk/i18n.js.map'

Sorry for causing all this hassle

@colinrotherham colinrotherham added the 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) label Feb 14, 2023
@colinrotherham
Copy link
Contributor

@nataliecarey Do you want us to pick this up?

We've added #3254 to our next release milestone

@romaricpascal romaricpascal force-pushed the source-maps-in-prototype-kit branch from 5d66add to 3f3b740 Compare March 2, 2023 17:10
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3255 March 2, 2023 17:10 Inactive
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3255 March 2, 2023 17:19 Inactive
@romaricpascal romaricpascal changed the title Including the javascript source map in the prototype kit config. Including the JavaScript source map in the prototype kit config. Mar 2, 2023
@romaricpascal romaricpascal force-pushed the source-maps-in-prototype-kit branch 2 times, most recently from d5f0d0c to ed21817 Compare March 2, 2023 17:24
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3255 March 2, 2023 17:24 Inactive
@colinrotherham colinrotherham changed the title Including the JavaScript source map in the prototype kit config. Including the JavaScript source map in the prototype kit config Mar 2, 2023
@romaricpascal
Copy link
Member

@nataliecarey Colin and I picked it up to get it through the line and add a CHANGELOG entry. Hope you don't mind 😄

@romaricpascal romaricpascal merged commit 62c5472 into main Mar 2, 2023
@romaricpascal romaricpascal deleted the source-maps-in-prototype-kit branch March 2, 2023 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Including the JavaScript source map in the prototype kit config
4 participants