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

Release v1.0.4 #28

Merged
merged 9 commits into from
Apr 14, 2022
Merged

Release v1.0.4 #28

merged 9 commits into from
Apr 14, 2022

Conversation

devonpis
Copy link
Contributor

  • update FormioLoader callback
  • improve story code snippets to be more meaningful
  • improve folder structure

@devonpis devonpis requested a review from a team April 13, 2022 22:59
<script>
${indent(
SimpleWizard.toString().replaceAll(
"_helpers_FormioLoader__WEBPACK_IMPORTED_MODULE_0__",
Copy link
Member

Choose a reason for hiding this comment

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

why do you need to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this code will show in the code snippet of the story, provides a functional example if the user copy and paste the code to a html page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the function has alredy transpiled by webpack, and webpack has replaced FormioLoader with _helpers_FormioLoader__WEBPACK_IMPORTED_MODULE_0__, so i have to convert it back...

export const singleSignOnCode = `
<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://static.qgov.net.au/formio-qld/v1/v1.x.x-latest/formio-script.prod.min.js"></script>
Copy link
Member

Choose a reason for hiding this comment

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

why is there 'prod' in the name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

formio-script.prod.min.js will load the scripts defined in src/helpers/FormioScript/index.prod.js
formio-script.dev.min.js will load the scripts defined in src/helpers/FormioScript/index.dev.js
etc.

Copy link
Contributor Author

@devonpis devonpis Apr 13, 2022

Choose a reason for hiding this comment

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

maybe the prod one can be renamed to formio-script.min.js

Copy link
Member

Choose a reason for hiding this comment

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

if you can, that would be great.

@@ -4,9 +4,16 @@ import { Meta } from "@storybook/addon-docs";

# FormioScript

FormioScript provide shorthand implementation that helps loading the necessary scripts that need to load a Formio form in your application.
FormioScript provide shorthand implementation to lazy load the necessary libraries and scripts that need to initiate a Formio form in your application.
Copy link
Contributor

Choose a reason for hiding this comment

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

The grammar here could use more work. Perhaps:

"FormioScript provides a shorthand implementation to lazy-load the necessary libraries and scripts to initiate a Formio form in your application."

**Benefits**

- One script and for all, reduce the chance of missing dependency.
- Enforce the script are loading in certain order, wrong order will break the application, which is prone to error if insert manually.
Copy link
Contributor

Choose a reason for hiding this comment

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

"script" should be "scripts"

@devonpis devonpis merged commit 3f87c4b into main Apr 14, 2022
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