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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update setup checklists with latest js package version #1588

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

ShubhamPalriwala
Copy link
Contributor

What does this PR do?

Update js package version to 1.1.4 from 1.1.2

Type of change

  • This change is a documentation update

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 馃檹

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented Nov 7, 2023

The latest updates on your projects. Learn more about Vercel for Git 鈫楋笌

2 Ignored Deployments
Name Status Preview Updated (UTC)
formbricks-cloud 猬滐笍 Ignored (Inspect) Nov 7, 2023 8:24am
formbricks-com 猬滐笍 Ignored (Inspect) Nov 7, 2023 8:24am

Copy link
Contributor

github-actions bot commented Nov 7, 2023

Thank you for following the naming conventions for pull request titles! 馃檹

Copy link
Contributor

apps/formbricks-com/app/docs/getting-started/framework-guides/page.mdx

It's good to see that you're updating the version of the Formbricks library. However, it's important to note that hardcoding the version number in multiple places can lead to inconsistencies and maintenance issues. Consider using a single source of truth for the version number, such as a configuration file or environment variable, and reference it in your code. This way, you only need to update the version number in one place.
Create Issue

    const formbricksVersion = "^1.1.4";
    var t = document.createElement("script");
    t.type = "text/javascript";
    t.async = !0;
    t.src = `https://unpkg.com/@formbricks/js@${formbricksVersion}/dist/index.umd.js`;

apps/formbricks-com/components/home/SetupTabs.tsx

Hardcoding sensitive information like environmentId and apiHost can pose a security risk and limit flexibility. Consider using environment variables or a secure configuration file to store this information. This not only improves security but also makes your code more flexible.
Create Issue

    const environmentId = process.env.FORMBRICKS_ENV_ID;
    const apiHost = process.env.FORMBRICKS_API_HOST;
    formbricks.init({
      environmentId: environmentId,
      apiHost: apiHost,
    });

Comment on lines +48 to 49
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.1.4/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init({environmentId: "<your-environment-id>", apiHost: "<api-host>"})},500)}();
</script>
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace hardcoded version number with a variable reference to ensure consistency and ease of maintenance.

Suggested change
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src="https://unpkg.com/@formbricks/js@^1.1.4/dist/index.umd.js";var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init({environmentId: "<your-environment-id>", apiHost: "<api-host>"})},500)}();
</script>
<script type="text/javascript">
!function(){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=`https://unpkg.com/@formbricks/js@${formbricksVersion}/dist/index.umd.js`;var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),setTimeout(function(){window.formbricks.init({environmentId: "<your-environment-id>", apiHost: "<api-host>"})},500)}();
</script>

@mattinannt mattinannt added this pull request to the merge queue Nov 7, 2023
@mattinannt
Copy link
Member

thank you :-)
For patch updates this is not so important as the ^ in ^1.1.2 means that it automatically picks the highest path release when requesting the js file from the server.

Merged via the queue into main with commit 536e610 Nov 7, 2023
14 checks passed
@mattinannt mattinannt deleted the shubham/update-js-package-in-app branch November 7, 2023 21:29
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.

None yet

2 participants