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

Penumbra 5.0.0: Safari/Firefox Support #171

Merged
merged 9 commits into from
Nov 3, 2020

Conversation

michaelfarrell76
Copy link
Member

@michaelfarrell76 michaelfarrell76 commented Nov 3, 2020

Penumbra 4.18.x brings support to safari, however we dynamically import encrypt/decrypt functions into the the main thread for safari use. This created files 0.js and 1.js and 2.js that needed to be copied into the build. Since webpack commonly uses these file names, this often created a file naming conflict with the application that is importing penumbra.

The changes here modify the namespace of the compiled penumbra files so that all files end in .penumbra.js. This is a breaking change to the previous webpack configuration.

New Style

webpack.js

 // Copy in penumbra workers
    new CopyPlugin({
      patterns: readdirSync(PENUMBRA_DIRECTORY)
        .filter((fil) => fil.indexOf('.') > 0)
        .map((fil) => ({
          from: `${PENUMBRA_DIRECTORY}/${fil}`,
          to: `${outputPath}/${fil}`,
        })),
    }),

index.html
<script src="/main.penumbra.js"></script>

Old Style

webpack.js

 // Copy in penumbra workers
    new CopyPlugin({
      patterns: [
        {
          from: `${PENUMBRA_DIRECTORY}/penumbra.worker.js`,
          to: `${outputPath}/penumbra.worker.js`,
        },
        {
          from: `${PENUMBRA_DIRECTORY}/penumbra.js`,
          to: `${outputPath}/penumbra.js`,
        },
      ],
    }),

index.html
<script src="/penumbra.js"></script>

@michaelfarrell76 michaelfarrell76 marked this pull request as ready for review November 3, 2020 04:02
@eligrey eligrey self-requested a review November 3, 2020 04:02
@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #171 into master will decrease coverage by 0.48%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
- Coverage   66.94%   66.46%   -0.49%     
==========================================
  Files          34       34              
  Lines         829      829              
  Branches      139      139              
==========================================
- Hits          555      551       -4     
- Misses        194      195       +1     
- Partials       80       83       +3     
Impacted Files Coverage Δ
src/workers.ts 60.71% <0.00%> (ø)
src/tests/api.test.ts 84.21% <0.00%> (-1.76%) ⬇️
src/zip.ts 67.13% <0.00%> (-0.70%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf2bf60...68d246f. Read the comment docs.

Copy link
Member

@eligrey eligrey left a comment

Choose a reason for hiding this comment

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

🚀

@michaelfarrell76 michaelfarrell76 merged commit 9682e85 into master Nov 3, 2020
@michaelfarrell76 michaelfarrell76 deleted the eligrey/temp-safari-workaround branch November 3, 2020 04:17
@ghost ghost assigned michaelfarrell76 Nov 3, 2020
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.

2 participants