How to import Beta components in Shopify Polaris - shopify

I have not been able to access the new Text component offered by the Shopify Polaris library. I am getting the following import error:
The requested module '/node_modules/.vite/deps/#shopify_polaris.js?v=e5492b37' does not provide an export named 'Text'
Any ideas on how to resolve this? The other text components are all deprecated and I'm using the latest version of Polaris.

Related

How to Create React Native Component Library for the use in any project

Im looking everywhere but i cant find anything somebody can explain this question ?
I want to be create my own component library i cant find it
Creating a React Native component library can be a great way to standardize your UI components and speed up your development process. Here are the steps to create a React Native component library:
Set up a new React Native project: Create a new React Native project using the react-native init command. You can choose any name you like for your project.
Create your components: Create the components that you want to include in your library. Each component should be a separate file and should be self-contained.
Export your components: Export each component using the export default statement. This will make the component available for use in other projects.
Create an index file: Create an index.js file in the root of your project. In this file, you can export all of your components as a single object using the export statement.
Publish your library: Publish your library to a package manager like NPM or Yarn. This will make your library available for others to install and use in their projects.
Document your library: Create documentation for your library, including installation instructions, usage examples, and a list of available components. You can use tools like JSDoc or Markdown to create your documentation.
Update your library: Keep your library up-to-date by fixing bugs, adding new features, and improving documentation. You can release new versions of your library to the package manager as needed.
Once you have created your React Native component library, you can use it in any React Native project by installing it from the package manager and importing the components that you need. This can save you time and help you maintain consistency in your UI design across multiple projects.

Tinymce - tinymce is not defined integrated with Vue 2

I'm following the official doc to integrate TinyMCE with Vue2. The editor is loaded successfully with basic configuration. But the link and table are not working as expected. So I installed tinymce(5.10.3) package and imported the plugins as follows:
import 'tinymce/plugins/table'
import 'tinymce/plugins/link'
But there's the error occurred and the editor is failed to load.
What's the possible cause of this?

SPFx webpart not working in IE11 - Reflect is undefined

I created a custom form using SharePoint Framework and pure JS, HTML and Sass. No React, Angular or any other frameworks. The form works perfectly in Chrome but when I try displaying it on IE (which we have to support), I get the following error:
Something went wrong
If the problem persists, contact the site administrator and give them the information in Technical Details.
Technical Details
[SPLoaderError.loadComponentError]:
***Failed to load component "48a33395-b489-4696-b8ee-bcab3d186d5e"
Original error: ***Failed to load entry point from component "48a33395-b489-4696-b8ee-bcab3d186d5e" (AgileHumanaIntakeFormWebPart). Original error: 'Reflect' is undefined
I am using PNPJS so I made sure to import their polyfill package at the top and I also tried installing and importing core-js with no luck.
import "#pnp/polyfill-ie11";
import 'core-js/es/reflect';
From what I can see in other similar issues, 'Reflect' is used in React but as I mentioned I'm not using React in my webpart so I'm at a loss.
I would appreciate some help! Thanks in advance.

react native how to import from third library by using "import"?

I am trying to use SliderButton, I recently installed slider-button in my terminal,
npm install --save react-native-slider-button
and tried to import it, but somehow it did not work.
on website, I am supposed to write
var SliderButton = require("react-native-slider-button");
but my react-native is latest ver so i am guessing that I probably should not use require, how do I write code with using "import"?
You can replace require with import by placing the following at the top of your file:
import SliderButton from "react-native-slider-button"
export default class MyComponent extends Component {
...
}
You can't really just "import" this particular component. It was written using an earlier implementation of JS called CommonJS which is used in NodeJS. React Native now uses ES6 for module management. The SliderButton Component is a little problematic. First, it uses the CommonJS module syntax inside the component itself, including loading React and React Native in ways that are no longer supported. So parts of this module would have to be rewritten to work with current versions of react native. You could roll back to a previous react native version that supports CommonJS, or you could modify the Component to use the ES6-style module importation.

react native: can't find variable: define

I have a library that is written in TypeScript, that then has been compiled into one js file as an amd module.
I'm then trying to import { Stuff } from 'that/library'
but get an error message: Can't find variable: define;
can I not used AMD modules to import into my RN app?
bonus question: what bundling mechanism is used under the bonnet in react-native, it's clearly not Webpack..? and what types of modules are supported.
edit: just tried to recompile my library as System type module, that does not get recognised either react native: can't find variable: System;
React Native uses it's own packager, which relies on CommonJS (and ES6 Imports, transpiled by babel to, you guessed it, CommonJS). This answers both questions, UMD is not supported. There are different starter kits using webpack, though, if you would like to use it, for example this one.