Skip to content

fix(rum): publish all packages as transpiled modules#432

Merged
hmdhk merged 7 commits intoelastic:masterfrom
vigneshshanmugam:publish-es5
Sep 30, 2019
Merged

fix(rum): publish all packages as transpiled modules#432
hmdhk merged 7 commits intoelastic:masterfrom
vigneshshanmugam:publish-es5

Conversation

@vigneshshanmugam
Copy link
Copy Markdown
Member

@vigneshshanmugam vigneshshanmugam commented Sep 19, 2019

  • Publish all the packages/* transpiled by babel-preset-env with the least supported environment which is Internal Explorer 11
  • We have three entry points defined in the package.json
'main': 'dist/lib/index.js' // output path for CommonJS/Node
'module':  'dist/es/index.js'  // output path for JS Modules with `import` & `export` statements
'source': 'src/index.js'  // custom entry module which might be used by supported bundlers. 
  • Most of the bundlers prefer module over main since it can do better tree-shaking on ES6 modules which would reduce the code size.

  • This would allow users to not configure babel for @elastic/* modules which might be painful since users might need to be aware of the features/proposals that are used by the RUM library.

TODO

  • Add tests to check if we are publishing es5 code.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Sep 19, 2019

Codecov Report

Merging #432 into master will increase coverage by 0.06%.
The diff coverage is 95.91%.

@@            Coverage Diff             @@
##           master     #432      +/-   ##
==========================================
+ Coverage   93.84%   93.91%   +0.06%     
==========================================
  Files          39       40       +1     
  Lines        1820     1889      +69     
  Branches      363      372       +9     
==========================================
+ Hits         1708     1774      +66     
- Misses        109      112       +3     
  Partials        3        3
Impacted Files Coverage Δ
packages/rum-core/src/common/config-service.js 96.84% <ø> (ø) ⬆️
packages/rum-core/src/common/utils.js 95.29% <100%> (+0.17%) ⬆️
packages/rum-core/src/common/apm-server.js 88.11% <100%> (+0.16%) ⬆️
...s/rum-core/src/performance-monitoring/span-base.js 93.18% <100%> (+1.69%) ⬆️
...c/performance-monitoring/performance-monitoring.js 95.02% <100%> (ø) ⬆️
.../src/performance-monitoring/transaction-service.js 92.18% <66.66%> (-0.62%) ⬇️
...rum-core/src/performance-monitoring/transaction.js 96.51% <88.23%> (-2.1%) ⬇️
...s/rum-core/src/performance-monitoring/breakdown.js 97.87% <97.87%> (ø)

@vigneshshanmugam
Copy link
Copy Markdown
Member Author

Integration test failure is related to elastic/apm-integration-testing#600

Copy link
Copy Markdown
Contributor

@hmdhk hmdhk left a comment

Choose a reason for hiding this comment

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

Thanks @vigneshshanmugam , Generally looks good! I think it's good that we're testing against the actual dist folder but maybe we can change the output of the temporary files!

@hmdhk hmdhk merged commit 1f4ee87 into elastic:master Sep 30, 2019
David-Development pushed a commit to David-Development/apm-agent-rum-js that referenced this pull request Oct 20, 2021
* fix(rum): publish all packages as transpiled modules

* add bundle tests for main and module

* ignore bundle tests from karma

* fix bundlesize script

* optimize the build runs for test

* fix rum src path

* use tmp folder for bundle test and separate test
devcorpio pushed a commit to bmorelli25/apm-agent-rum-js that referenced this pull request Jan 25, 2022
* fix(rum): publish all packages as transpiled modules

* add bundle tests for main and module

* ignore bundle tests from karma

* fix bundlesize script

* optimize the build runs for test

* fix rum src path

* use tmp folder for bundle test and separate test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants