Skip to content

Commit ed04556

Browse files
rafaelfrancazzak
andauthored
Update guides/source/upgrading_ruby_on_rails.md
Co-authored-by: zzak <[email protected]>
1 parent 1ca27cc commit ed04556

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

guides/source/upgrading_ruby_on_rails.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,14 @@ If you run a single file's tests (`bin/rails test test/models/user_test.rb`), `t
260260
### Import syntax from `@rails/ujs` is modified
261261

262262
Starting from Rails 7.1, the syntax for importing modules from `@rails/ujs` is modified. Rails no longer supports the
263-
direct import of a module from `@rails/ujs`. If users create and build a JavaScript file with the line `import
264-
{ fileInputSelector } from "@rails/ujs"`, they will encounter the error `export 'fileInputSelector'
265-
(imported as 'fileInputSelector') was not found in '@rails/ujs' (possible exports: default)`.
263+
direct import of a module from `@rails/ujs`.
264+
265+
For example, attempting to import a function from the library will fail:
266+
267+
\```
268+
import { fileInputSelector } from "@rails/ujs"
269+
#=> export 'fileInputSelector' (imported as 'fileInputSelector') was not found in '@rails/ujs' (possible exports: default)
270+
\```
266271

267272
In Rails 7.1, users should first import the Rails object directly from `@rails/ujs`.
268273
Users can then import specific modules from the Rails object.

0 commit comments

Comments
 (0)